From b20e894a9878837ed84f9db71997f68476d632b5 Mon Sep 17 00:00:00 2001 From: Gauthier Jolly Date: Tue, 9 May 2023 14:39:17 +0200 Subject: [PATCH] ubuntu-cpc: disable kernel and initramfs symlinks in /boot This is required by the new UEFI binary hook as we mount the ESP on /boot and the ESP filesystem doesn't support symlinks. We keep symlinks for s390x images which do not use UEFI anyway. --- .../hooks.d/chroot/999-cpc-fixes.chroot | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 9a25c0a0..50b6a496 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 @@ -124,6 +124,21 @@ fi #### END COMMON ARCH FUNCTIONS +# For everything except s390x, disable kernel and initramfs symlinks +case $arch in + # On s390x the sipl.conf is static right now with just two boot options. + s390x) + exit 0 + ;; +esac + +find "${rootd}/boot" -type l -exec rm {} \; +kernel_img_conf="${rootd}/etc/kernel-img.conf" +if grep -q '^do_symlinks = ' "$kernel_img_conf" 2> /dev/null; then + sed -i 's/^do_symlinks = .*$/do_symlinks = no/g' "$kernel_img_conf" +else + echo "do_symlinks = no" >> "$kernel_img_conf" +fi case $arch in # ARM, ppc, riscv64 and s390x images are special