From 994b80a1a154051c24a46eebcbb30c0d787619a9 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Fri, 17 Mar 2023 23:35:26 -0300 Subject: [PATCH] kernel: postinst: use `--nofsroot` option to `findmnt` when finding` /boot`'s filesystem type - otherwise we might get `/dev/mmcblk2p1[/boot]` when `/boot` is bind-mounted - `--nofsroot: don't print [/dir] for bind or btrfs mounts` --- lib/functions/compilation/kernel-debs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/functions/compilation/kernel-debs.sh b/lib/functions/compilation/kernel-debs.sh index 09c65ef1a6..382a161240 100644 --- a/lib/functions/compilation/kernel-debs.sh +++ b/lib/functions/compilation/kernel-debs.sh @@ -245,7 +245,7 @@ function kernel_package_callback_linux_image() { if [[ "${script}" == "preinst" ]]; then cat <<- HOOK_FOR_REMOVE_VFAT_BOOT_FILES check_boot_dev (){ - boot_partition=\$(findmnt -n -o SOURCE /boot) + boot_partition=\$(findmnt --nofsroot -n -o SOURCE /boot) bootfstype=\$(blkid -s TYPE -o value \$boot_partition) if [ "\$bootfstype" = "vfat" ]; then rm -f /boot/System.map* /boot/config* /boot/vmlinuz* /boot/$image_name /boot/uImage