diff --git a/arm64-minimized-alignment.patch b/arm64-minimized-alignment.patch new file mode 100644 index 00000000..784e2373 --- /dev/null +++ b/arm64-minimized-alignment.patch @@ -0,0 +1,40 @@ +diff --git a/live-build/auto/config b/live-build/auto/config +index 20d28139..8f188b5d 100755 +--- a/live-build/auto/config ++++ b/live-build/auto/config +@@ -1048,12 +1048,13 @@ case $PROJECT in + add_task install ubuntu-server-raspi + ;; + armhf*) +- add_package install flash-kernel ++ if [ "${SUBPROJECT:-}" != minimized ]; then ++ add_package install flash-kernel ++ fi + ;; + arm64*) +- add_package install flash-kernel +- if [ "${SUBARCH:-}" = "generic" ]; then +- KERNEL_FLAVOURS=generic ++ if [ "${SUBPROJECT:-}" != minimized ]; then ++ add_package install flash-kernel + fi + ;; + amd64*) +diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +index 3685e464..4602267c 100755 +--- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary ++++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +@@ -112,11 +112,11 @@ install_grub() { + # please file a bug against grub2 to include the affected module. + case $ARCH in + arm64) +- chroot mountpoint apt-get -qqy install --no-install-recommends shim-signed grub-efi-arm64-signed ++ chroot mountpoint apt-get install -qqy shim-signed + efi_target=arm64-efi + ;; + armhf) +- chroot mountpoint apt-get -qqy install --no-install-recommends grub-efi-arm grub-efi-arm-bin ++ chroot mountpoint apt-get -qqy install grub-efi-arm grub-efi-arm-bin + efi_target=arm-efi + ;; + amd64) diff --git a/debian/changelog b/debian/changelog index 909132d6..c5126412 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,20 @@ -livecd-rootfs (23.10.55+1) noble; urgency=medium +livecd-rootfs (24.04.2) noble; urgency=medium - * Add Noble + * Enable snap preseeding with ppc64el images where /boot/vmlinux is used + instead of /boot/vmlinuz. (LP: #2038957) - -- Gauthier Jolly Fri, 20 Oct 2023 15:39:47 +0200 + -- Philip Roche Thu, 26 Oct 2023 17:56:00 +0100 + +livecd-rootfs (24.04.1) noble; urgency=medium + + [ Steve Langasek ] + * call ubuntu-image classic with --debug, because --verbose doesn't give + us anything useful in the livefs build logs. + + [ Heinrich Schuchardt ] + * arm: fix console parameter for ARM cloud-images (LP: #2036730) + + -- Paride Legovini Wed, 25 Oct 2023 17:58:13 +0200 livecd-rootfs (23.10.55) mantic; urgency=medium diff --git a/live-build/auto/build b/live-build/auto/build index 479ac5a5..8c48a00e 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -108,7 +108,7 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then xz -0 -T4 "$PREFIX".img mv output/seed.manifest "$PREFIX".manifest else - /snap/bin/ubuntu-image classic --verbose $UBUNTU_IMAGE_ARGS \ + /snap/bin/ubuntu-image classic --debug $UBUNTU_IMAGE_ARGS \ -O output "$IMAGE_DEFINITION" # Since the output of the ubuntu-image call can vary based on what # kind of an image we build, the safest bet is to 'export' all the diff --git a/live-build/functions b/live-build/functions index b017e4be..6f631b8c 100644 --- a/live-build/functions +++ b/live-build/functions @@ -768,9 +768,18 @@ snap_preseed() { snap_validate_seed() { local CHROOT_ROOT=$1 local kern_major_min=undefined + local boot_filename=undefined + # ppc64el still uses /boot/vmlinux so we need to determine the boot file name as non ppc64el use /boot/vmlinuz + # We don't need to query the arch as we can use existence of the file to determine the boot file name. Both + # will never be present at the same time. if [ -e ${CHROOT_ROOT}/boot/vmlinuz ]; then - kern_major_min=$(readlink --canonicalize --no-newline ${CHROOT_ROOT}/boot/vmlinuz | grep --extended-regexp --only-matching --max-count 1 '[0-9]+\.[0-9]+') + boot_filename=vmlinuz + elif [ -e ${CHROOT_ROOT}/boot/vmlinux ]; then + boot_filename=vmlinux + fi + if [ ${boot_filename} != undefined ]; then # we have a known boot file so we can proceed with checking for features to mount + kern_major_min=$(readlink --canonicalize --no-newline ${CHROOT_ROOT}/boot/${boot_filename} | grep --extended-regexp --only-matching --max-count 1 '[0-9]+\.[0-9]+') if [ -d /usr/share/livecd-rootfs/live-build/apparmor/${kern_major_min} ]; then # if an Ubuntu version has different kernel apparmor features between LTS and HWE kernels # a snap pre-seeding issue can occur, where the incorrect apparmor features are reported diff --git a/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot b/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot index 12956529..772c4a0c 100755 --- a/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot +++ b/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot @@ -170,6 +170,16 @@ fi psuedo_grub_probe > "${gprobe}" chmod 755 "${gprobe}" +case $arch in + armhf|arm64) + # QEMU virt machine provides AMBA PrimeCell UART + serial_console='ttyAMA0' + ;; + *) + serial_console='ttyS0' + ;; +esac + # for Quantal and later, use /etc/default/grub.d functionality # rather than modifying the grub configuration itself. # This avoids the mess of having to do dpkg stuff @@ -186,7 +196,7 @@ GRUB_RECORDFAIL_TIMEOUT=0 GRUB_TIMEOUT=0 # Set the default commandline -GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0" +GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=${serial_console}" # Set the grub console type GRUB_TERMINAL=console diff --git a/livecd-rootfs b/livecd-rootfs new file mode 120000 index 00000000..f5d3076e --- /dev/null +++ b/livecd-rootfs @@ -0,0 +1 @@ +/home/philroche/Working/livecd-rootfs \ No newline at end of file