From 894c4c19e05a12b783345700dedf68184930747d Mon Sep 17 00:00:00 2001 From: Daniel Reichelt Date: Wed, 2 Jan 2008 19:57:32 +0100 Subject: update-initramfs: fix ro-mounted /boot check (closes: #458772) Hi Kernel-Team, i stumbled over this bug when I wanted to update my initrd while I had some isos loop-mounted like this: $ cat /proc/mounts |grep boot /dev/hda1 /boot ext2 rw 0 0 /dev/loop57 /srv/pub/iso_loop/sys/bootrescue-cd-20071129-59 iso9660 ro 0 0 /dev/loop58 /srv/pub/iso_loop/sys/bootrescue-cd-dev iso9660 ro 0 0 /dev/loop59 /srv/pub/iso_loop/sys/bootrescue-dvd-20071129-59 iso9660 ro 0 0 /dev/loop60 /srv/pub/iso_loop/sys/bootrescue-dvd-dev iso9660 ro 0 0 The check for a ro-mounted /boot partition was falsly triggered by the mount targets of the iso-images. As you can see in the patch attached, for the conditional awk output to work as desired, another pair of hyphen enclosing the awk match calls is required. HTH, Daniel Reichelt --- update-initramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-initramfs b/update-initramfs index eb1db44..42f2831 100755 --- a/update-initramfs +++ b/update-initramfs @@ -266,7 +266,7 @@ ro_boot_check() return 0 fi - boot_opts=$(awk '/boot/{if (match($4, /^ro/) || match($4, /,ro/) \ + boot_opts=$(awk '/boot/{if ((match($4, /^ro/) || match($4, /,ro/)) \ && $2 == "/boot") print "ro"}' /proc/mounts) if [ -n "${boot_opts}" ]; then echo "WARNING: /boot is ro mounted." -- cgit v1.2.3