[oe] [RFC Patch] initscripts-1.0 checkroot: fix rootfs identification

Phil Blundell philb at gnu.org
Thu Jul 2 14:13:07 UTC 2009


On Thu, 2009-07-02 at 09:59 -0400, Brian Bloniarz wrote:
> Hi Phil, I had a question about the checkroot script from initscripts-1.0.
> 
> >ROOTFSDEV="/dev/root"
> >if ! grep -q "^$ROOTFSDEV\w" /proc/mounts; then
> >  ROOTFSDEV="rootfs"
> >fi
> >if [ x$(grep "^$ROOTFSDEV\w" /proc/mounts | awk '{print $4}') = "xrw" ]; then
> >	echo "Root filesystem already read-write, not remounting"
> >	exit 0
> >fi
> 
> If this code is intended to look for the rootfs dev, I don't think \w (word
> character) is right. grep "^/dev/root\w" doesn't match "/dev/root", it matches
> stuff like "/dev/rootf". Was this intended?  It looks like this change was from
> 8f5f3f87a526b585717f3064a8db5a2e6ae849ec: "initscripts: tweak mtab reading in
> checkroot.sh so that r/w ramdisk works on epia"

You're right, that "\w" expression does look wrong.  I guess I probably
intended to write "\W" and just missed the shift key, but I don't really
remember for sure.  But yes, your suggestion to use \> sounds like a
fine one.  Please go ahead and make that change.

p.





More information about the Openembedded-devel mailing list