Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FreeBSD 14] Missing the desktop cause the failure of testcase ovt_verify_status at detecting vmtoolsd user process #587

Merged
merged 9 commits into from
Jun 5, 2024
48 changes: 27 additions & 21 deletions autoinstall/FreeBSD/14/installerconfig
Original file line number Diff line number Diff line change
Expand Up @@ -64,47 +64,53 @@ env ASSUME_ALWAYS_YES=YES pkg update -f > /dev/ttyu0
# Different packages between the 32bit image and 64bit image
machtype=$(uname -m)
echo "Machine type is $machtype" > /dev/ttyu0
packages_to_install="bash sudo wget curl e2fsprogs iozone lsblk"
if [ "$machtype" == "amd64" ] || [ "$machtype" == "x86_64" ]; then
packages_to_install='bash sudo xorg kde5 xf86-video-vmware'
packages_to_install="$packages_to_install xorg kde5 xf86-video-vmware sddm open-vm-tools xf86-input-vmmouse"
else
packages_to_install='bash sudo'
packages_to_install="$packages_to_install open-vm-tools-nox11"
fi
ZouYuhua marked this conversation as resolved.
Show resolved Hide resolved

failed_packages=""
for package_to_install in $packages_to_install
do
echo "Install package $package_to_install ..." > /dev/ttyu0
env ASSUME_ALWAYS_YES=YES pkg install -y $package_to_install
ret=$?
if [ $ret == 0 ]
then
echo "Succeed to install the package($package_to_install)" > /dev/ttyu0
then
echo "Successfully installed the package $package_to_install from ISO repo" > /dev/ttyu0
else
echo "Failed to install the package($package_to_install)" > /dev/ttyu0
failed_packages="$failed_packages $package_to_install"
fi
done

# Disable ISO repo and enable default repo
rm -rf /usr/local/etc/pkg/repos/FreeBSD_install_cdrom.conf
env ASSUME_ALWAYS_YES=YES pkg update -f > /dev/ttyu0
if [ "$machtype" == "amd64" ] || [ "$machtype" == "x86_64" ]; then
packages_to_install='sddm open-vm-tools xf86-input-vmmouse wget curl e2fsprogs iozone lsblk'
else
packages_to_install='open-vm-tools-nox11 wget curl e2fsprogs iozone lsblk'
fi

for package_to_install in $packages_to_install
do
ret=1
try_count=1
until [ $ret -eq 0 ]
if [ "$failed_packages" != "" ]; then
echo "To install the following packages from offical repo: $failed_packages" > /dev/ttyu0
for package_to_install in $failed_packages
do
echo "Install package $package_to_install (try $try_count time) ..." > /dev/ttyu0
env ASSUME_ALWAYS_YES=YES pkg install -y $package_to_install
ret=$?
try_count=$((try_count+1))
ret=1
try_count=1
until [ $ret -eq 0 ] || [ $try_count -ge 10 ]
do
echo "Install package $package_to_install (try $try_count time) ..." > /dev/ttyu0
env ASSUME_ALWAYS_YES=YES pkg install -y $package_to_install
ret=$?
try_count=$((try_count+1))
if [ $ret -eq 0 ]; then
echo "Successfully installed the package $package_to_install from online repo" > /dev/ttyu0
fi
done

if [ $ret -ne 0 ] && [ $try_count -ge 10 ]; then
echo "Error: Failed to install $package_to_install from ISO and online repo" > /dev/ttyu0
fi
done
echo "The package($package_to_install) is already installed" > /dev/ttyu0
done
fi

# Add new user.
{% if new_user is defined and new_user != 'root' %}
Expand Down