-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing the opensuse build for different providers (#1591)
* fixing the opensuse build for different providers --------- Signed-off-by: Nicolino Curalli <[email protected]>
- Loading branch information
Showing
6 changed files
with
119 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
os_name = "opensuse-leap" | ||
os_version = "15.6" | ||
os_arch = "aarch64" | ||
iso_url = "http://provo-mirror.opensuse.org/distribution/leap/15.6/iso/openSUSE-Leap-15.6-DVD-aarch64-Media.iso" | ||
iso_checksum = "file:https://provo-mirror.opensuse.org/distribution/leap/15.6/iso/openSUSE-Leap-15.6-DVD-aarch64-Media.iso.sha256" | ||
iso_url = "https://download.opensuse.org/distribution/leap/15.6/iso/openSUSE-Leap-15.6-DVD-aarch64-Build710.3-Media.iso" | ||
iso_checksum = "sha256:6ecade658ef3e4dd7175176781f80fcd070250fe7e922f6240224ff810755ac6" | ||
parallels_guest_os_type = "opensuse" | ||
vbox_guest_os_type = "OpenSUSE_64" | ||
vbox_guest_os_type = "OpenSUSE_Leap_arm64" | ||
vmware_guest_os_type = "arm-other-64" | ||
boot_command = ["<wait5><esc><wait>e<wait><down><down><down><down><end> biosdevname=0 net.ifnames=0 netdevice=eth0 netsetup=dhcp lang=en_US textmode=1 modprobe.blacklist=vmwgfx autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse/autoinst-uefi.xml<f10><wait>"] | ||
vboxmanage = [ | ||
[ | ||
"modifyvm", | ||
"{{.Name}}", | ||
"--audio", | ||
"none", | ||
"--nat-localhostreachable1", | ||
"on", | ||
"--usb-xhci", | ||
"on" | ||
] | ||
] | ||
vbox_hard_drive_interface = "virtio" | ||
vbox_iso_interface = "virtio" | ||
vbox_firmware_option = "efi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
os_name = "opensuse-leap" | ||
os_version = "15.6" | ||
os_arch = "x86_64" | ||
iso_url = "http://sfo-korg-mirror.kernel.org/opensuse/distribution/leap/15.6/iso/openSUSE-Leap-15.6-DVD-x86_64-Media.iso" | ||
iso_checksum = "file:http://sfo-korg-mirror.kernel.org/opensuse/distribution/leap/15.6/iso/openSUSE-Leap-15.6-DVD-x86_64-Media.iso.sha256" | ||
iso_url = "https://download.opensuse.org/distribution/leap/15.6/iso/openSUSE-Leap-15.6-DVD-x86_64-Build710.3-Media.iso" | ||
iso_checksum = "sha256:a74d4072e639c75ca127df3d869c1e57bcc44a093a969550f348a3ead561fe4f" | ||
parallels_guest_os_type = "opensuse" | ||
vbox_guest_os_type = "OpenSUSE_64" | ||
vbox_guest_os_type = "OpenSUSE_Leap_64" | ||
vmware_guest_os_type = "opensuse-64" | ||
boot_command = ["<wait5><esc><enter><wait>linux biosdevname=0 net.ifnames=0 netdevice=eth0 netsetup=dhcp lang=en_US textmode=1 autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse/autoinst.xml<enter><wait>"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,59 @@ | ||
#!/bin/sh -eux | ||
|
||
# set a default HOME_DIR environment variable if not set | ||
HOME_DIR="${HOME_DIR:-/home/vagrant}"; | ||
|
||
case "$PACKER_BUILDER_TYPE" in | ||
virtualbox-iso|virtualbox-ovf) | ||
VER="$(cat "$HOME_DIR"/.vbox_version)"; | ||
ISO="VBoxGuestAdditions_$VER.iso"; | ||
|
||
# mount the ISO to /tmp/vbox | ||
mkdir -p /tmp/vbox; | ||
mount -o loop "$HOME_DIR"/"$ISO" /tmp/vbox; | ||
|
||
echo "installing deps necessary to compile kernel modules" | ||
# We install things like kernel-headers here vs. kickstart files so we make sure we install them for the updated kernel not the stock kernel | ||
if [ -f "/bin/dnf" ]; then | ||
dnf install -y --skip-broken perl cpp gcc make bzip2 tar kernel-headers kernel-devel kernel-uek-devel || true # not all these packages are on every system | ||
elif [ -f "/bin/yum" ] || [ -f "/usr/bin/yum" ]; then | ||
yum install -y --skip-broken perl cpp gcc make bzip2 tar kernel-headers kernel-devel kernel-uek-devel || true # not all these packages are on every system | ||
elif [ -f "/usr/bin/apt-get" ]; then | ||
apt-get install -y build-essential dkms bzip2 tar linux-headers-"$(uname -r)" | ||
elif [ -f "/usr/bin/zypper" ]; then | ||
zypper install -y perl cpp gcc make bzip2 tar kernel-default-devel | ||
fi | ||
|
||
echo "installing the vbox additions" | ||
# this install script fails with non-zero exit codes for no apparent reason so we need better ways to know if it worked | ||
/tmp/vbox/VBoxLinuxAdditions.run --nox11 || true | ||
|
||
if ! modinfo vboxsf >/dev/null 2>&1; then | ||
echo "Cannot find vbox kernel module. Installation of guest additions unsuccessful!" | ||
exit 1 | ||
fi | ||
|
||
echo "unmounting and removing the vbox ISO" | ||
umount /tmp/vbox; | ||
rm -rf /tmp/vbox; | ||
rm -f "$HOME_DIR"/*.iso; | ||
|
||
echo "removing kernel dev packages and compilers we no longer need" | ||
if [ -f "/bin/dnf" ]; then | ||
dnf remove -y gcc cpp kernel-headers kernel-devel kernel-uek-devel | ||
elif [ -f "/bin/yum" ] || [ -f "/usr/bin/yum" ]; then | ||
yum remove -y gcc cpp kernel-headers kernel-devel kernel-uek-devel | ||
elif [ -f "/usr/bin/apt-get" ]; then | ||
apt-get remove -y build-essential gcc g++ make libc6-dev dkms linux-headers-"$(uname -r)" | ||
elif [ -f "/usr/bin/zypper" ]; then | ||
zypper -n rm -u kernel-default-devel gcc make | ||
fi | ||
|
||
echo "removing leftover logs" | ||
rm -rf /var/log/vboxadd* | ||
;; | ||
esac | ||
if ! ([ "$(uname -m)" = "aarch64" ] && [ -f /etc/os-release ] && (grep -qi 'opensuse' /etc/os-release || grep -qi 'sles' /etc/os-release)); then | ||
|
||
# set a default HOME_DIR environment variable if not set | ||
HOME_DIR="${HOME_DIR:-/home/vagrant}"; | ||
|
||
case "$PACKER_BUILDER_TYPE" in | ||
virtualbox-iso|virtualbox-ovf) | ||
VER="$(cat "$HOME_DIR"/.vbox_version)"; | ||
ISO="VBoxGuestAdditions_$VER.iso"; | ||
|
||
# mount the ISO to /tmp/vbox | ||
mkdir -p /tmp/vbox; | ||
mount -o loop "$HOME_DIR"/"$ISO" /tmp/vbox; | ||
|
||
echo "installing deps necessary to compile kernel modules" | ||
# We install things like kernel-headers here vs. kickstart files so we make sure we install them for the updated kernel not the stock kernel | ||
if [ -f "/bin/dnf" ]; then | ||
dnf install -y --skip-broken perl cpp gcc make bzip2 tar kernel-headers kernel-devel kernel-uek-devel || true # not all these packages are on every system | ||
elif [ -f "/bin/yum" ] || [ -f "/usr/bin/yum" ]; then | ||
yum install -y --skip-broken perl cpp gcc make bzip2 tar kernel-headers kernel-devel kernel-uek-devel || true # not all these packages are on every system | ||
elif [ -f "/usr/bin/apt-get" ]; then | ||
apt-get install -y build-essential dkms bzip2 tar linux-headers-"$(uname -r)" | ||
elif [ -f "/usr/bin/zypper" ]; then | ||
zypper install -y perl cpp gcc make bzip2 tar kernel-default-devel | ||
fi | ||
|
||
echo "installing the vbox additions" | ||
# this install script fails with non-zero exit codes for no apparent reason so we need better ways to know if it worked | ||
/tmp/vbox/VBoxLinuxAdditions.run --nox11 || true | ||
|
||
if ! modinfo vboxsf >/dev/null 2>&1; then | ||
echo "Cannot find vbox kernel module. Installation of guest additions unsuccessful!" | ||
exit 1 | ||
fi | ||
|
||
echo "unmounting and removing the vbox ISO" | ||
umount /tmp/vbox; | ||
rm -rf /tmp/vbox; | ||
rm -f "$HOME_DIR"/*.iso; | ||
|
||
echo "removing kernel dev packages and compilers we no longer need" | ||
if [ -f "/bin/dnf" ]; then | ||
dnf remove -y gcc cpp kernel-headers kernel-devel kernel-uek-devel | ||
elif [ -f "/bin/yum" ] || [ -f "/usr/bin/yum" ]; then | ||
yum remove -y gcc cpp kernel-headers kernel-devel kernel-uek-devel | ||
elif [ -f "/usr/bin/apt-get" ]; then | ||
apt-get remove -y build-essential gcc g++ make libc6-dev dkms linux-headers-"$(uname -r)" | ||
elif [ -f "/usr/bin/zypper" ]; then | ||
zypper -n rm -u kernel-default-devel gcc make | ||
fi | ||
|
||
echo "removing leftover logs" | ||
rm -rf /var/log/vboxadd* | ||
;; | ||
esac | ||
else | ||
echo "Skipping Virtualbox guest additions installation on aarch64 architecture for opensuse and derivatives" | ||
fi |