summaryrefslogtreecommitdiff
path: root/update-initramfs
diff options
context:
space:
mode:
authorDaniel Reichelt <debian@itamservices.de>2008-01-02 19:57:32 +0100
committermaximilian attems <max@stro.at>2008-01-05 16:57:52 +0100
commit894c4c19e05a12b783345700dedf68184930747d (patch)
tree28824667d852c761ff4e85bbb82df150fc481f43 /update-initramfs
parent7e40a0b28df5f0aef150b9b7244cba35857b2b99 (diff)
downloadinitramfs-tools-894c4c19e05a12b783345700dedf68184930747d.tar.gz
initramfs-tools-894c4c19e05a12b783345700dedf68184930747d.zip
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
Diffstat (limited to 'update-initramfs')
-rwxr-xr-xupdate-initramfs2
1 files changed, 1 insertions, 1 deletions
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."