Andrew Benton b3nton at
Wed Jan 6 03:30:00 PST 2010

On 06/01/10 03:42, Agathoklis D. Hatzimanikas wrote:
> Hi Andy,
> On Wed, Jan 06, at 12:12 Andrew Benton wrote:
>> ln -s $(awk '{ print $1; print $2; print $3; print $4; print $5 }'
>> /proc/cmdline | sed '/dev/!d;s at root=/dev/@@') /dev/root
>> That works fine and causes no problems, even on systems which don't use
>> NILFS2, but it isn't pretty. Is there a simpler way to get awk to print
>> all the fields at one go? Or would some other tool (perl?) be more
>> appropriate? That's the main reason I wrote this email, for a bit of
>> scripting advice.
> Using your pattern, maybe you can do something like,
> ln -sv $(sed 's at root=/dev/\([^ ]*\).*@\1@' /proc/cmdline) /dev/root

That would work if the root= option was the first argument, but grub 
puts BOOT_IMAGE= first, giving

andy:~$ sed 's at root=/dev/\([^ ]*\).*@\1@' /proc/cmdline
BOOT_IMAGE=/boot/bzImage sda2

More information about the lfs-dev mailing list