[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [augeas-devel] Does augeas support grub2 config files



Hey Raphael,

Thanks for reply. I am not trying to modify grub.cfg file manually or through augeas. What grub2 says that in order to make changes in grub.cfg file , you need to change some of the parameters in environment variable file - /etc/default/grub or scripts under /etc/grub.d directory. 

So what i did is :
1: Try to parse / change file /etc/default/grub using augeas .
2: Hoping augeas will make the change in /etc/default/grub file . (I have verified this entire flow by making change manually in this file.)
3: execute this command to alter grub.cfg file :
/usr/sbin/grub2-mkconfig --output /boot/grub2/grub.cfg

This flow works if I do change /etc/default/grub file. But what I am trying to do with augeas is not working.

---------------------------------------------------------------------------------------------------------------------------------------------------------
Sample /etc/default/grub file :

root ip-10-0-162-247 ec2-user]# cat /etc/default/grub 

GRUB_TIMEOUT=1

GRUB_DEFAULT=saved

GRUB_DISABLE_SUBMENU=true

GRUB_TERMINAL_OUTPUT="console"

GRUB_CMDLINE_LINUX="crashkernel=auto console=ttyS0,115200n8 console=tty0"

GRUB_DISABLE_RECOVERY="true"


now using augeas I tried to get the value of GRUB_CMDLINE_LINUX , I got the value "crashkernel=auto console=ttyS0,115200n8 console=tty0"
correctly. But when I do 

set /files/etc/default/grub/GRUB_CMDLINE_LINUX/rootdelay 300, it does not set under node GRUB_CMDLINE_LINUX.

---------------------------------------------------------------------------------------------------------------------------------------------------------

This is jut for /etc/default/grub file. I need to alter some other files under /etc/grub.d. So thats why, my question was does augeas support parsing these grub2 related files or not ?
BDW, I tried using Shellvars.lns as well. It didnt work.


On Mon, Jun 15, 2015 at 11:05 PM, Raphaël Pinson <raphael pinson camptocamp com> wrote:
Hi Gaurav,


If I remember correctly, grub.cfg is not really a configuration file—contrarily to what its name might promise—but rather a shell script, with lots of commands and logic in there. You might try to parse it using Shellvars.lns, but there's no garantee that it will work at all.


Cheers,

Raphaël




On Tue, Jun 16, 2015 at 1:47 AM, Gaurav Dalvi <gaurav1424 gmail com> wrote:
Hello,

I have been truing to modify /boot/grub2/grub.cfg file using augeas. I dont think it supports grub.cfg file.

I was able to take take entire parameter from /etc/default/grub file and then altering it, then executing grub2-mkconfig --ouput /boot/grub2/grub.cfg , serves the purpose. But I need more granularity when it comes parsing grub2 related files.

Could you please tell me whether augeas support grub2 config files or not and if yes, could you please point me to documentation ?

Thanks a lot. I appreciate your help.
Awaiting your reply.

_______________________________________________
augeas-devel mailing list
augeas-devel redhat com
https://www.redhat.com/mailman/listinfo/augeas-devel



--
Raphaël Pinson
Infrastructure Developer & Training Leader
+33 458 482 013

Camptocamp France
Savoie Technolac
BP 352
48, avenue du Lac du Bourget
73372 Le Bourget du Lac, Cedex
www.camptocamp.com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]