aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pygrub
Commit message (Collapse)AuthorAgeFilesLines
* pygrub: Support (/dev/xvda) style disk specificationsIan Campbell2013-10-142-1/+109
| | | | | | | | | | | You get these if you install Debian Wheezy as HVM and then try to convert to PV. This is Debian bug #603391. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Tested-by: Tril <tril@metapipe.net> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* pygrub: add Debian extlinux.conf pathIan Campbell2013-08-271-0/+1
| | | | | | | | | This is Debian bug #697407. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=697407 Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* pygrub: allow user to specify an explicit offset to fsKjetil Torgrim Homme2013-07-171-4/+13
| | | | | | | This new option overrides partition table parsing Signed-off-by: Kjetil Torgrim Homme <kjetil.homme@redpill-linpro.com> Reviewed-by: Matt Wilson <msw@amazon.com>
* pygrub: add fedora 19 grub.cfg exampleMarcel J.E. Mol2013-06-271-0/+117
| | | | | | | | | This grub.cfg from a default fedora 19 Beta install caused pygrub failures.The previous pygrub commit fixed taht. So this example file added for reference. Signed-off-by: Marcel Mol <marcel@mesa.nl> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub/GrubConf: fix boot problem for fedora 19 grub.cfg (2nd attempt)Marcel J.E. Mol2013-06-271-0/+2
| | | | | | | | | | | | | | | Booting a fedora 19 domU failed because a it could not properly parse the grub.cfg file. This was cased by set default="${next_entry}" This statement actually is within an 'if' statement, so maybe it would be better to skip code within if/fi blocks... But this patch seems to work fine. Signed-off-by: Marcel Mol <marcel@mesa.nl> Acked-by: Ian Campbell <ian.campbell@citix.com> Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* tools/pygrub: Fix install when $(BINDIR) and $(PRIVATE_BINDIR) are the sameChristoph Egger2013-04-241-1/+2
| | | | | | | | | Do not override pygrub with a symbolic link in this case. Signed-off-by: Christoph Egger <chegger@amazon.de> Reviewed-by: Matt Wilson <msw@amazon.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- reworded summary to fit on one line ]
* Fix pygrub handling non-default entryMiroslav Rezanina2013-01-171-1/+1
| | | | | | | | | If we pass 0 as pygrub --entry argument (i.e. we want to boot first item), default value is used instead. This is dueto wrong check for range of allowed values of index - 0 is index of first item. Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com> Acked-by: Matt Wilson <msw@amazon.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: Fix command line argument error handlingMatthew Daley2012-11-123-4/+4
| | | | | | | | | | | | | pygrub's individual config file parsers do not correctly check the amount of command line arguments given to them. In addition, the LILO config parser would report an incorrect message. Use len() to correctly check the amount of arguments, and fix the LILO error message. Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: Add option to list grub entriesCharles Arnold2012-10-261-4/+20
| | | | | | | | | | | | | | | | The argument to "--entry" allows 2 syntaxes, either directly the entry number in menu.lst, or the whole string behind the "title" key word. This poses the following issue: From Dom0 there is no way to guess the number and, or the complete title string because this string contains the kernel version, which will change with a kernel update. This patch adds [-l|--list-entries] as an argument to pygrub. Signed-off-by: Charles Arnold <carnold@suse.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* pygrub: correct typo in --args assignmentOlaf Hering2012-10-091-3/+3
| | | | | | | | | | | | | If pygrub was called with --args="some thing", then this string should be append to the kernel command line. But the last changeset 25941:795c493fe561 contained a typo, it assigns 'args' instead of 'arg'. Rename the local variable which holds the string from the domain config file to avoid further confusion. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: always append --argsOlaf Hering2012-09-251-2/+4
| | | | | | | | | | | | | | | | | If a bootloader entry in menu.lst has no additional kernel command line options listed and the domU.cfg has 'bootargs="--args=something"' the additional arguments from the config file are not passed to the kernel. The reason for that incorrect behaviour is that run_grub appends arg only if the parsed config file has arguments listed. Fix this by appending args from image section and the config file separatly. To avoid adding to a NoneType initialize grubcfg['args'] to an empty string. This does not change behaviour but simplifies the code which appends the string. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: add quoting to install receipeOlaf Hering2012-08-021-2/+2
| | | | | | | | | | | | | | | | | The changeset 25694:e20085770cb5 causes a syntax error if readline returns nothing due to non-existant path: [ 148s] set -e; if [ `readlink -f /home/abuild/rpmbuild/BUILD/xen-4.2.25700/non-dbg/dist/install//usr/bin` != \ [ 148s] `readlink -f /usr/lib64/xen/bin` ]; then \ [ 148s] ln -sf /usr/lib64/xen/bin/pygrub /home/abuild/rpmbuild/BUILD/xen-4.2.25700/non-dbg/dist/install//usr/bin; \ [ 148s] fi [ 148s] /bin/sh: line 0: [: /home/abuild/rpmbuild/BUILD/xen-4.2.25700/non-dbg/dist/install/usr/bin: unary operator expected Add quoting to fix the error. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* tools/build: fix pygrub linkingRoger Pau Monne2012-08-011-1/+4
| | | | | | | | | | | | | | Prevent creating a symlink to $(DESTDIR)/$(BINDIR) if it is the same as $(PRIVATE_BINDIR) This fixes NetBSD install, where $(DESTDIR)/$(BINDIR) == $(PRIVATE_BINDIR). Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: don't leave fds openRoger Pau Monne2012-07-231-0/+3
| | | | | | | | | | | On NetBSD a block device can only be opened once, so make sure pygrub closes it every time, if this is not done libfsimage is not able to open the disk later. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: cope better with big files in the guest.M A Young2012-07-041-17/+44
| | | | | | | | | | | | | | | Only read the first megabyte of a configuration file (grub etc.) and read the kernel and ramdisk files from the guest in one megabyte pieces so pygrub doesn't use a lot of memory if the files are large. With --not-really option check that the chosen kernel and ramdisk files exist. If there are problems writing the copy of the kernel or ramdisk, delete the copied files and exit in case they have filled the filesystem. Signed-off-by: Michael Young <m.a.young@durham.ac.uk> Acked-by: Matt Wilson <msw@amazon.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* tools/pygrub: Makefile cleanupAnthony PERARD2012-06-081-1/+0
| | | | | | | | | This patch removes the extra command `install pygrub` because this is already done by the setup.py script. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools/pygrub: Fix pygrub installAnthony PERARD2012-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The script pygrub is currently installed in the wrong location. Instead of /usr/lib/xen/bin, the script is installed in $destdir/usr/lib/xen/bin. $(DESTDIR) is apply twice. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> diff -r 474b5a6b1d91 -r 836e6618e86b tools/pygrub/Makefile --- a/tools/pygrub/Makefile Fri Jun 08 16:39:24 2012 +0100 +++ b/tools/pygrub/Makefile Fri Jun 08 16:42:05 2012 +0100 @@ -12,7 +12,7 @@ build: install: all CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \ $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" \ - --install-scripts=$(DESTDIR)/$(PRIVATE_BINDIR) --force + --install-scripts=$(PRIVATE_BINDIR) --force $(INSTALL_PYTHON_PROG) src/pygrub $(DESTDIR)/$(PRIVATE_BINDIR)/pygrub $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot ln -sf $(PRIVATE_BINDIR)/pygrub $(DESTDIR)/$(BINDIR)
* tools: Install pv bootloaders in libexec rather than /usr/binGeorge Dunlap2012-05-151-2/+4
| | | | | | | | | | | | pygrub and xenpvnetboot are meant to be run by tools, and not by the user, and thus should be in /usr/lib/xen/bin rather than /usr/bin. Because most config files will still have an absolute path pointing to /usr/bin/pygrub, make a symbolic link that we will deprecate. Signed-off-by: George Dunlap <george.dunlap@eu.ctirix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: extlinux parsing correctnessRoger Pau Monne2012-02-071-1/+1
| | | | | | | | | | | | The "in" operator should be used instead of the find method, since we are only interested in knowing whether the line contains "initrd=", but we don't care about it's position. Also fixes an error that happens when initrd= it's at the start of the line, since find returns 0 and is evaluated as False. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* pygrub: fix extlinux parsingRoger Pau Monne2012-01-032-1/+21
| | | | | | | | | | | | | | | | | | pygrub was unable to parse extlinux config files correctly, exactly the ones like: LABEL grsec KERNEL vmlinuz-3.0.10-grsec APPEND initrd=initramfs-3.0.10-grsec root=UUID=cfd4a7b4-8c40-4025-b877-8205f1c622ee modules=sd-mod,usb-storage,ext4 xen quiet This patch fixes it, adding a new case when parsing the "append" line, that searches for the initrd image. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* pygrub: Fix "a" entry editing in grub2Miroslav Rezanina2011-12-131-1/+1
| | | | | | | | | | | | When user wants to change entry in grub2 menu in pygrub, there's no response in case of appending command line arguments ('a' key). Append malfunction is caused by change of keyword used for kernel record. Grub uses 'kernel' for line with linux kernel but grub2 uses 'linux' instead. This patch adds checking for both grub 1 and 2 keywords. Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* pygrub: Allow scrolling of the list of entriesMiroslav Rezanina2011-12-131-4/+19
| | | | | | | | | | | | | When user wants to change entry in grub2 menu in pygrub, there may be crash of pygrub in case of editing item ('e' key). Crash on editing is caused longer entry list in case of grub2. As entry window is 10 lines high, it can hold only 8 entries (2 lines for border). Adding line outside of windows high causes crash. Patch add handling for longer lists and scrolling through them. Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* pygrub: Add HybridISO support for PyGrub2Philipp Hahn2011-11-021-7/+19
| | | | | | | | | | | | | | | | grub-mkrescue internally uses xorriso, which generates a so-called "Hybrid ISO": The ISO images also contains a DOS partition table, which allows the identical ISO file to be stored on an USB stick for booting from it. This breaks PyGrub, since it (wrongly) detects only the DOS partition table and uses the first partition instead of the complete ISO file. Add a check to detect HybridISO files and use offset 0 in addition to partition table parsing. Signed-off-by: Philipp Hahn <hahn@univention.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* pygrub: example grub2 configuration file (fedora-16-with-xen.grub2)Michael Young2011-10-251-0/+112
| | | | | | | | | Sample grub2 configuration file (some duplication removed) from Fedora 16 with a xen hypervisor installed Signed-off-by: Michael Young <m.a.young@durham.ac.uk> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* pyrgrub: cope with configurations with set default="${saved_entry}" lineMichael Young2011-10-251-0/+2
| | | | | | | | | | Fedora 16 grub2 configuration file can have lines like set default="${saved_entry}" and a string containing an integer is expected Signed-off-by: Michael Young <m.a.young@durham.ac.uk> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* pygrub: cope with configurations with submenusMichael Young2011-10-251-2/+11
| | | | | | | | | | | | | | | | | The grub2 configuration file in Fedora 16 can have one or more menuentrys in a submenu, with configuration of the form submenu "Xen 4.1" { menuentry ... { ... } } (this example occurs when the xen hypervisor is installed on the guest) Ignore the submenu line and the corresponding } Signed-off-by: Michael Young <m.a.young@durham.ac.uk> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: Allow GPT partition referencesMichael Young2011-10-251-0/+2
| | | | | | | | The grub2 configuration file in Fedora 16 can have GPT partition references like (hd0,gpt2) so remove the "gpt" string where necessary Signed-off-by: Michael Young <m.a.young@durham.ac.uk> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: look in /boot/grub2 (for eg Fedora 16)Michael Young2011-10-251-1/+2
| | | | | | | | Fedora 16 puts grub configuration files in /boot/grub2/grub.cfg so pygrub should look there as well Signed-off-by: Michael Young <m.a.young@durham.ac.uk> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: check all GPT partitionsMichael Young2011-10-251-4/+13
| | | | | | | | | | | | | On Fedora 16 the first GPT partition is a boot partition for grub2 with the grub2 configuration in the second partition. Check all GPT partitions for grub configuration, not just the first. [ Also remove now-inaccurate comment. -iwj ] Signed-off-by: Michael Young <m.a.young@durham.ac.uk> Tested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* pygrub: add debug flagGuido Gunther2011-10-111-2/+10
| | | | | | | | | | Debugging config file errors is tedious so help a bit by not silently dropping parsing exceptions when --debug is given. Also intialize the logging API at debug level in this case. Signed-off-by: Guido Gunther <agx@sigxcpu.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* pygrub: prefer Grub2 to Grub1Ian Campbell2011-07-151-5/+5
| | | | | | | | If a VM image has grub2 installed it is likely the one we need to be using. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools/pygrub: fix solaris kernel snifftools/pygrub: fix solaris kernel sniff2011-07-141-2/+5
| | | | | | | | | | | | Solaris 11 build 163+ removes '/platform/i86xpv/kernel/unix' and only the 64-bit PV kernel file '/platform/i86xpv/kernel/amd64/unix' exists. This patch fixes the detection. Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com> Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com> Signed-off-by: Frank Che <frank.che@oracle.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* build: Make XEN_ROOT an absolute path.Keir Fraser2011-03-171-1/+1
| | | | | | | | Otherwise make can search the path relative to certain standard paths such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in Config.mk suffers from this). Signed-off-by: Keir Fraser <keir@xen.org>
* pygrub: support grub2 "(hdX,msdosY)" partition syntaxIan Campbell2010-10-131-0/+2
| | | | | | | | This appeared in Debian Squeeze at some point. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* pygrub: look in every partition for something to bootIan Jackson2010-07-151-35/+62
| | | | | | | | | pygrub: look in every partition for something to boot, in case the OS installer (SLES 10 sp1 in particular) forgets to mark the boot partition as active. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Acked-by: David Markey <admin@dmarkey.com>
* pygrub: introduce easier to parse output formatIan Jackson2010-07-141-13/+44
| | | | | | | | | | | | | | | | | libxl would rather like to parse the output of pygrub. Rather than implement an SXP parser in libxl add a --output-format option to pygrub which can select an alternative, simpler to parse, format. Available formats are: sxp: current SXP output format; simple: simple key+value output with \n separating item ( for debugging). key and value are separated by a single space (and key therefore cannot contain a space); simple0: as simple but with \0 as a separator; Also add --output-directory to allow temporary files to be placed somewhere other than /var/run/xend/boot. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* tools/pygrub: --not-really option for debuggingIan Jackson2010-07-021-15/+24
| | | | | | | Add a --not-really option to pygrub that lets us see what files it would have extracted instead of actually extracting them. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* tools/pygrub: Fix a typo handling device specs with no partition partIan Jackson2010-07-021-1/+1
| | | | | | | pygrub: fix a typo that causes exceptions when looking at device specifications that don't have a partition part (e.g. (hd0)). Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* tools/pygrub: Fix default when out of rangeIan Jackson2010-06-291-0/+3
| | | | | | | | | | | | | This is the patch to fix pyGrub default value when it's being set out of range. This patch makes the quiet and interactive mode select the same default image when the default value for boot entry is out of range, i.e. when the guest is having wrong configuration in it's boot loader (like 3 entries with default mistakenly set to 10 etc). When the boot entry number is being set out of range it falls back to 0 (first entry of boot loader). Signed-off-by: Michal Novotny <minovotn@redhat.com>
* pyGrub: Use proper bootloader class when entering command manuallyKeir Fraser2010-05-264-6/+26
| | | | | | | | | | | | | | | | | | Use the proper bootloader class when entering the boot commands manually (i.e. using the 'c' option). Before this patch the bootloader was always treated to be Grub but when user is using Grub2/ExtLinux or Lilo it's rather confusing. After applying this patch the proper bootloader image class is being used, e.g. Grub2Image for Grub2 etc. when you define the boot commands manually using the 'c' command in pyGrub. Also, fix for using isconfig has been applied since if there is not fs set in the run_grub() method the read_config() would fail since it's trying to access undefined self.cf which is now being set to parser() from cfg_list. Signed-off-by: Michal Novotny <minovotn@redhat.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: Fix Grub2 support for Ubuntu 10.04Keir Fraser2010-04-151-1/+1
| | | | | | | | Due to changes in grub2, menu entry titles now have single quote around them rather than double quotes, but the memtest entries still are using double quotes, so we need to catch both. Signed-off-by: David Markey <david.markey@citrix.com>
* pygrub: fix 64b Solaris PV guest boot on 32b Linux dom0 & 64b XenKeir Fraser2010-04-121-12/+14
| | | | Signed-off-by: Mark Johnson <mark.r.johnson@oracle.com>
* pygrub: further improve grub2 supportKeir Fraser2010-03-151-11/+16
| | | | | | | | | | | | | | * Improve syntax error messages to say what actually went wrong instead of giving an arbitrary and basically useless integer. * Improve handling of quoted values used with the "set" command, previously only the default variable was special cased to handle quoting. * Allow for extra options to the menuentry command, syntax now appears to be menuentry "TITLE" --option1 --option2 {...} Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: Fix grub2 support when config is on a separate /boot partitionKeir Fraser2010-03-051-1/+1
| | | | | Signed-off-by: David Markey <david@dmarkey.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: support parsing of syslinux configuration filesKeir Fraser2010-02-013-1/+206
| | | | | | | | | | Allows booting from ISOs which use isolinux as well as guests using extlinux. Also add copyright header to GrubConf.py, I think the grub2 support added last year qualifies as a substantial change. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: improve grub 2 supportKeir Fraser2010-01-261-3/+19
| | | | | | | | | | | | | | | | | * The "default" value can be a quoted string (containing an integer) so strip the quotes before interpreting. * The "set" command takes a variable with an arbitrary name so instead of whitelisting the ones to ignore simply silently accept any set command with an unknown variable. * Ignore the echo command. * Handle the function { ... } syntax. Previously pygrub would error out with a syntax error on the closing "}" because it thought it was the closing bracket of a menuentry. This makes pygrub2 work with the configuration files generated by Debian Squeeze today. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: fix attribute error when not found parserKeir Fraser2009-12-161-1/+1
| | | | Signed-off-by: Wei Kong <weikong.cn@gmail.com>
* pygrub: add basic support for parsing grub2 style grub.cfg fileKeir Fraser2009-11-232-4/+123
| | | | | | | | | | This represents a very simplistic aproach to parsing these file. It is basically sufficient to parse the files produced by Debian Squeeze's version of update-grub. The actual grub.cfg syntax is much more expresive but not apparently documented apart from a few examples... Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: track the title of an item as an independant fieldKeir Fraser2009-11-232-18/+19
| | | | | | | | | | | | separate to the other fields. This makes the list of lines within a GrubImage 0 based rather than 1 based therefore adjust the user interface parts to suit. This is in preparation for grub2 support where the syntax for the item title does not fit the existing usage. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: factor generic Grub functionality into GrubConf base classesKeir Fraser2009-11-232-77/+90
| | | | | | | | | | | and inherit from these classes to implement Grub-legacy functionality. Use a tuple of (parser-object,configuration-file) in pygrub to allow for multiple parsers. Makes way for grub2 support. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>