Bug#513504: flash-kernel should handle LVM roots better
* Paul Jakma <paul@jakma.org> [2009-01-29 21:21]:
>> # Record the root filesystem device for use during boot
>> rootdev=$(egrep '^[^# ]+[ ]+/[ ]' /etc/fstab | awk '{print $1}') || true
>
> Aside: I think this may be fragile (literal tabs), using [:white:] would
> be better. Indeed, grep piped to AWK is often redundant (as AWK will parse
> the line again, and has its own POSIX RE support). Indeed AWK has, what I
> would consider more comprehensible way of writing this (tested along with
> the patch):
>
> rootdev=$(awk '$1 !~ /^#/ && $2 == "/" { print $1; exit }' /etc/fstab) || true
Joey, do you remember why you used egrep rather than awk?
> This works fine for me!
I just tested it myself and maks acked the patch on IRC, so I'll go
ahead and upload the fix.
--
Martin Michlmayr
http://www.cyrius.com/
Reply to: