It works on a file in /tmp, but not on the actual /boot/grub/grub.cfg file on
my machine. Not sure why, permissions look fine...
I will attempt to RTFM from Stephen's message and see if I can do it the Right
Way (tm) ;-)
-Tom
On Apr 5, 2011, at 3:33 AM, Erik Christiansen wrote:
> On Mon, Apr 04, 2011 at 09:51:20AM -0400, Tom Easterday wrote:
>>
>> On Apr 4, 2011, at 9:22 AM, Tom Easterday wrote:
>>> Your instructions didn't work for me (I am on 10.04). I assume it is due
>>> to the above. Looks like the lines start with "linux" not kernel....? See
>>> attached snipped from Grub.cfg.
>>
>> Hmm, I tried substituting "linux" for "kernel" and that didn't work either.
>> I changed the mv to cp at the end to see if the script would leave something
>> in /tmp but nothing is there....
>
> Thanks for the grub.cfg sample. The problem was that menu.lst had no
> leading whitespace on the kernel command line, while grub.cfg does.
> Removing the "^" (anchor to start of line) allows your "linux"
> substitution to do the job.
>
> Here is the script snippet, updated for your sample grub.cfg, but
> with a leading #!/bin/bash , so that it can be run by itself (after
> doing a chmod a+x on it), to test it at your end.
>
> ----------------
> #!/bin/bash
>
> # Addition to update-grub, to auto post-edit bootargs.
>
> gawk '
> /^[ \t]*linux/ && $2 ~ /-rtai$/ {
> printf("%s %s\n",$0,"isolcpus=1")
> next
> }
>
> { print $0 }
>
> ' /tmp/foo.grub > /tmp/grub.cfg
>
> ----------------
>
> You'll need to lose that extra first line, if using this version at the
> end of update-grub. Alternatively, just change "^" to "^[ \t]*" in
> yours. The new regex fragment accepts any number (*) of spaces or tabs
> ([ \t]) after the start of line (^), before looking for "linux".
>
> It continues to look for "-rtai" at the end ($) of the second field ($2)
> on the line, so that it won't modify a non-rtai entry. (Which is the
> whole point of this jiggery-pokery, AIUI.
>
> Here is what it now does to your sample text, using diff to show only
> what has changed:
>
> $ diff /tmp/foo.grub /tmp/grub.cfg
> 7c7
> < linux /boot/vmlinuz-2.6.32-122-rtai
> root=UUID=506b5468-6b3c-4e97-86d0-899b469a2948 ro quiet splash
> ---
>> linux /boot/vmlinuz-2.6.32-122-rtai
>> root=UUID=506b5468-6b3c-4e97-86d0-899b469a2948 ro quiet splash isolcpus=1
> 16c16
> < linux /boot/vmlinuz-2.6.32-122-rtai
> root=UUID=506b5468-6b3c-4e97-86d0-899b469a2948 ro single
> ---
>> linux /boot/vmlinuz-2.6.32-122-rtai
>> root=UUID=506b5468-6b3c-4e97-86d0-899b469a2948 ro single isolcpus=1
>
> Here, "<" indicates /tmp/foo.grub , and ">" indicates /tmp/grub.cfg,
> while "---" separates "before" and "after". 7c7 and 16c16 declare that
> input lines 7 & 16 changed content, but did not change position.
> This also confirms that all other lines were passed unmodified.
> (But maybe that's all old hat.)
>
> That should be pretty close now. :-)
>
> Erik
>
> --
> Meskimen's Law:
> There's never time to do it right, but always time to do it over.
>
> ------------------------------------------------------------------------------
> Xperia(TM) PLAY
> It's a major breakthrough. An authentic gaming
> smartphone on the nation's most reliable network.
> And it wants your games.
> http://p.sf.net/sfu/verizon-sfdev
> _______________________________________________
> Emc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-users
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users