Bug#388241: [Repoen]: test for [ -r /proc/mounts ] preferd to test for [ -d /proc ]
notfound 388241 0.97
found 388241 0.79
found 388241 0.80
reopen 388241
thanks
Firstly sorry for getting the wrong version... must be more careful
with manually crafted bug reports.
Secondly the "fix" in incoming (0.80) has code that looks like this:
ro_boot_check()
{
[ -d /proc ] || return 0
boot_opts=$(awk '/boot/{if (match($4, /ro/)) print "ro"}' /proc/mounts)
if [ -n "${boot_opts}" ]; then
echo "WARNING: /boot is ro mounted."
echo "update-initramfs: Not updating ${initramfs}"
exit 0
fi
}
Even on chroot systems with /proc unmounted there is likely to be a
/proc directory (as a potential mount point). Thus the test [ -d /proc
] is likely to be TRUE all the time... even when proc is not mounted.
A better test would be:
[ -r /proc/mounts ] || return 0
Which would o test for the readability of /proc/mounts which is the
file we want to read in the next line!
Regards
Alex Owen
Reply to: