472,782 Members | 2,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,782 software developers and data experts.

parsing grub's menu.lst

I need some code that will read in grubs menu.lst file, and give me a
list of dicts:

[{'title':'Ubuntu, kernel 2.6.15-23-686',
'root':'(hd0,0)',
'kernel':'/boot/vmlinuz-2.6.15-23-686 root=/dev/hda1 ro quiet splash',
'initrd':'/boot/initrd.img-2.6.15-23-686',
'savedefault':'',
'boot':''},
{'title':....} ]

I am not really sure what the rules are, like does it have to have a
title, and do blank lines mean anything? so 1/2 of what I am looking
for is something that already knows what the rules are.

What I really want to parse is pxelinux.cfg/default file typically
used when pxe booting. which I 'think' is the same format is grub/
menu.lst, and it uses 'label' instead of 'title' which is making me
wonder if I should rely n the rules being the same. For now I am
willing to take that chance.

Carl K
Nov 17 '08 #1
0 1231

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris | last post by:
I've added a configuration file similar to Web.config but that does not invoke a restart when changed, just a cache dependency. At various times I'm getting a seeingly random one of the following...
3
by: dadapeer | last post by:
hai In my computer i am having dual boot operating system one is winxpsp2 another one is linux red hat 3 i removed the the redhat partition (deleated). arter i rebooted the system system is...
0
kestrel
by: kestrel | last post by:
I just installed Ubuntu 7.04 on my computer today. I have both Ubuntu and Windows on my computer. It worked fine for a while, both Ubuntu and Windows booted properly. But i went to go use Windows,...
6
AmberJain
by: AmberJain | last post by:
Well, I installed Red hat linux a few days ago and recently I tried to repair my XP installation on same machine. It displayed the following message when I expected it to repair my XP-"Setup is...
1
by: sasimca007 | last post by:
Hello friends, At first, I installed windows-xp and after ubuntu. My windows-xp has encountered a problem that registry files are corrupted, then i re-installed windows-xp....
11
AmberJain
by: AmberJain | last post by:
Hello, From many few days whenever I tried installing Xubuntu on my PC, I failed as Xubuntu installer simply couldnot startup. Whenever I booted from Xubuntu Cd both Live CD and Xubuntu...
1
by: gaurav92K | last post by:
sir , please tell me what is the greate difference in lilo & grub boot loader. please tell me.
1
by: Albert Hopkins | last post by:
On Mon, 2008-11-17 at 10:27 -0800, CarlFK wrote: Why take a chance when you can get it right the first time? There is documentation on the syslinux config formats at their web site...
3
by: P4ZP47Z | last post by:
Here is my situation: - My windows install/apps/games were eaten by a virus that replicates into and wrecks .exe files - I made an Ubuntu 9.10 CD on my friends pc, and a Xubuntu 9.10 DVD...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.