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

various updates #1575

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ Markdown table generated at <https://www.tablesgenerator.com/markdown_tables#>
- Update oraclelinux 8 to 8.10
- Update rhel 8 to 8.10
- Update freebsd 14 to 14.1
- update debian 11 to 11.10
- Update debian 12 to 12.6
- Fix dnf cleanup command for broken pkg deps
- Fix parallel tools install for aarch64 oraclelinux-8
- Fix shell exec err for ubuntu user-data script
- Fix FreeBSD 14 builds due to change in home directory location

## [v4.1.2] (2024-05-23)

Expand Down
3 changes: 2 additions & 1 deletion os_pkrvars/almalinux/almalinux-9-aarch64.pkrvars.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ os_arch = "aarch64"
iso_url = "https://repo.almalinux.org/almalinux/9/isos/aarch64/AlmaLinux-9.4-aarch64-dvd.iso"
iso_checksum = "file:https://repo.almalinux.org/almalinux/9/isos/aarch64/CHECKSUM"
parallels_guest_os_type = "centos"
vbox_guest_os_type = "RedHat_64"
vbox_guest_os_type = "Oracle_arm64"
vmware_guest_os_type = "arm-rhel9-64"
vbox_boot_wait = "10s"
boot_command = ["<wait><up>e<wait><down><down><end><wait> inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg <leftCtrlOn>x<leftCtrlOff>"]
4 changes: 2 additions & 2 deletions os_pkrvars/debian/debian-11-aarch64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
os_name = "debian"
os_version = "11.9"
os_version = "11.10"
os_arch = "aarch64"
iso_url = "https://cdimage.debian.org/cdimage/archive/latest-oldstable/arm64/iso-dvd/debian-11.9.0-arm64-DVD-1.iso"
iso_url = "https://cdimage.debian.org/cdimage/archive/latest-oldstable/arm64/iso-dvd/debian-11.10.0-arm64-DVD-1.iso"
iso_checksum = "file:https://cdimage.debian.org/cdimage/archive/latest-oldstable/arm64/iso-dvd/SHA256SUMS"
parallels_guest_os_type = "debian"
vbox_guest_os_type = "Debian_64"
Expand Down
4 changes: 2 additions & 2 deletions os_pkrvars/debian/debian-11-x86_64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
os_name = "debian"
os_version = "11.9"
os_version = "11.10"
os_arch = "x86_64"
iso_url = "https://cdimage.debian.org/cdimage/archive/latest-oldstable/amd64/iso-dvd/debian-11.9.0-amd64-DVD-1.iso"
iso_url = "https://cdimage.debian.org/cdimage/archive/latest-oldstable/amd64/iso-dvd/debian-11.10.0-amd64-DVD-1.iso"
iso_checksum = "file:https://cdimage.debian.org/cdimage/archive/latest-oldstable/amd64/iso-dvd/SHA256SUMS"
parallels_guest_os_type = "debian"
vbox_guest_os_type = "Debian_64"
Expand Down
6 changes: 3 additions & 3 deletions os_pkrvars/debian/debian-12-aarch64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
os_name = "debian"
os_version = "12.5"
os_version = "12.6"
os_arch = "aarch64"
iso_url = "https://cdimage.debian.org/cdimage/release/12.5.0/arm64/iso-dvd/debian-12.5.0-arm64-DVD-1.iso"
iso_checksum = "file:https://cdimage.debian.org/cdimage/release/12.5.0/arm64/iso-dvd/SHA256SUMS"
iso_url = "https://cdimage.debian.org/cdimage/release/12.6.0/arm64/iso-dvd/debian-12.6.0-arm64-DVD-1.iso"
iso_checksum = "file:https://cdimage.debian.org/cdimage/release/12.6.0/arm64/iso-dvd/SHA256SUMS"
parallels_guest_os_type = "debian"
vbox_guest_os_type = "Debian_64"
vmware_guest_os_type = "arm-debian12-64"
Expand Down
6 changes: 3 additions & 3 deletions os_pkrvars/debian/debian-12-x86_64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
os_name = "debian"
os_version = "12.5"
os_version = "12.6"
os_arch = "x86_64"
iso_url = "https://cdimage.debian.org/cdimage/release/12.5.0/amd64/iso-dvd/debian-12.5.0-amd64-DVD-1.iso"
iso_checksum = "file:https://cdimage.debian.org/cdimage/release/12.5.0/amd64/iso-dvd/SHA256SUMS"
iso_url = "https://cdimage.debian.org/cdimage/release/12.6.0/amd64/iso-dvd/debian-12.6.0-amd64-DVD-1.iso"
iso_checksum = "file:https://cdimage.debian.org/cdimage/release/12.6.0/amd64/iso-dvd/SHA256SUMS"
parallels_guest_os_type = "debian"
vbox_guest_os_type = "Debian_64"
vmware_guest_os_type = "debian-64"
Expand Down
33 changes: 28 additions & 5 deletions packer_templates/pkr-sources.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ locals {
) : var.qemuargs

# virtualbox-iso
vboxmanage = var.vboxmanage == null ? (
var.os_arch == "aarch64" ? [
["modifyvm", "{{.Name}}", "--chipset", "armv8virtual"],
["modifyvm", "{{.Name}}", "--vrde", "off"],
["modifyvm", "{{.Name}}", "--audio-enabled", "off"],
["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"],
["modifyvm", "{{.Name}}", "--mouse", "usb"],
["modifyvm", "{{.Name}}", "--keyboard", "usb"],
["modifyvm", "{{.Name}}", "--usb-xhci", "on"],
["modifyvm", "{{.Name}}", "--usb-ohci", "off"],
["storagectl", "{{.Name}}", "--name", "IDE Controller", "--remove"],
] : [
["modifyvm", "{{.Name}}", "--chipset", "ich9"],
["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"]
]
) : var.vboxmanage
vbox_gfx_controller = var.vbox_gfx_controller == null ? (
var.is_windows ? "vboxsvga" : "vmsvga"
) : var.vbox_gfx_controller
Expand Down Expand Up @@ -254,16 +270,23 @@ source "qemu" "vm" {
}
source "virtualbox-iso" "vm" {
# Virtualbox specific options
#firmware = "efi"
# chipset = var.os_arch == "aarch64" ? "armv8virtual" : "ich9"
firmware = var.os_arch == "aarch64" ? "efi" : "bios"
rtc_time_base = "UTC"
# hard_drive_discard = true
# hard_drive_nonrotational = true
# sound = "none"
# usb = true

gfx_controller = local.vbox_gfx_controller
gfx_vram_size = local.vbox_gfx_vram_size
guest_additions_path = var.vbox_guest_additions_path
guest_additions_mode = local.vbox_guest_additions_mode
guest_additions_interface = var.vbox_guest_additions_interface
guest_os_type = var.vbox_guest_os_type
hard_drive_interface = var.vbox_hard_drive_interface
iso_interface = var.vbox_iso_interface
vboxmanage = var.vboxmanage
hard_drive_interface = var.os_arch == "aarch64" ? "virtio" : var.vbox_hard_drive_interface
iso_interface = var.os_arch == "aarch64" ? "virtio" : var.vbox_iso_interface
vboxmanage = local.vboxmanage
virtualbox_version_file = var.virtualbox_version_file
# Source block common options
boot_command = var.boot_command
Expand Down Expand Up @@ -294,7 +317,7 @@ source "virtualbox-ovf" "vm" {
guest_additions_path = var.vbox_guest_additions_path
source_path = var.vbox_source_path
checksum = var.vbox_checksum
vboxmanage = var.vboxmanage
vboxmanage = local.vboxmanage
virtualbox_version_file = var.virtualbox_version_file
# Source block common options
communicator = local.communicator
Expand Down
13 changes: 2 additions & 11 deletions packer_templates/pkr-variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -233,17 +233,8 @@ variable "vbox_iso_interface" {
default = "sata"
}
variable "vboxmanage" {
type = list(list(string))
default = [
[
"modifyvm",
"{{.Name}}",
"--audio",
"none",
"--nat-localhostreachable1",
"on",
]
]
type = list(list(string))
default = null
}
variable "virtualbox_version_file" {
type = string
Expand Down
18 changes: 7 additions & 11 deletions packer_templates/scripts/_common/parallels-rhel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ parallels-iso|parallels-pvm)
# make sure we use dnf on EL 8+
if [ "$major_version" -ge 8 ]; then
dnf -y install checkpolicy selinux-policy-devel gcc kernel-devel kernel-headers make
if [ "$major_version" -eq 8 ]; then
dnf -y install -- *epel-release*
dnf -y install gcc-toolset-12 gcc-toolset-12-runtime gcc-toolset-12-gcc-c++
mv /usr/bin/gcc /usr/bin/gcc.old
ln -s /opt/rh/gcc-toolset-12/root/usr/bin/gcc /usr/bin/gcc
dnf -y remove -- *epel-release*
fi
else
yum -y install checkpolicy selinux-policy-devel gcc kernel-devel kernel-headers make
fi
Expand All @@ -32,16 +39,5 @@ parallels-iso|parallels-pvm)
umount /tmp/parallels;
rm -rf /tmp/parallels;
rm -f "$HOME_DIR"/*.iso;

# Parallels Tools for Linux includes native auto-mount script,
# which causes losing some of Vagrant-relative shared folders.
# So, we should disable this behavior.
# https://github.com/Parallels/vagrant-parallels/issues/325#issuecomment-418727113
# TODO: verify this is fixed in latest version of parallels
# auto_mount_script='/usr/bin/prlfsmountd'
# if [ -f "${auto_mount_script}" ]; then
# printf '#!/bin/sh\n # Shared folders auto-mount is disabled by Vagrant' > "${auto_mount_script}"
# fi

;;
esac
11 changes: 0 additions & 11 deletions packer_templates/scripts/_common/parallels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,5 @@ parallels-iso|parallels-pvm)
umount /tmp/parallels;
rm -rf /tmp/parallels;
rm -f "$HOME_DIR"/*.iso;

# Parallels Tools for Linux includes native auto-mount script,
# which causes losing some of Vagrant-relative shared folders.
# So, we should disable this behavior.
# https://github.com/Parallels/vagrant-parallels/issues/325#issuecomment-418727113
# TODO: verify this is fixed in latest version of parallels
# auto_mount_script='/usr/bin/prlfsmountd'
# if [ -f "${auto_mount_script}" ]; then
# printf '#!/bin/sh\n # Shared folders auto-mount is disabled by Vagrant' > "${auto_mount_script}"
# fi

;;
esac
29 changes: 17 additions & 12 deletions packer_templates/scripts/_common/virtualbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,26 @@ virtualbox-iso|virtualbox-ovf)
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 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
arch="$(uname -m)"
if [ "$arch" = "aarch64" ]; then
/tmp/vbox/VBoxLinuxAdditions-arm64.run --nox11 || true
else
/tmp/vbox/VBoxLinuxAdditions.run --nox11 || true
fi

if ! modinfo vboxsf >/dev/null 2>&1; then
echo "Cannot find vbox kernel module. Installation of guest additions unsuccessful!"
Expand Down
2 changes: 1 addition & 1 deletion packer_templates/scripts/rhel/cleanup_dnf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo "Remove development and kernel source packages"
dnf -y remove gcc cpp gc kernel-devel kernel-headers glibc-devel elfutils-libelf-devel glibc-headers kernel-devel kernel-headers

echo "remove orphaned packages"
dnf -y autoremove
dnf -y autoremove --skip-broken

echo "Remove previous kernels that preserved for rollbacks"
dnf -y remove "$(dnf repoquery --installonly --latest-limit=-1 -q)"
Expand Down