Files
xen/tools/pygrub
Ian Campbell fb31b1475f tools: pygrub: if partition table is empty, try treating as a whole disk
pygrub (in identify_disk_image()) detects a DOS style partition table
via the presence of the 0xaa55 signature at the end of the first
sector of the disk.

However this signature is also present in whole-disk configurations
when there is an MBR on the disk. Many filesystems (e.g. ext[234])
include leading padding in their on disk format specifically to enable
this.

So if we think we have a DOS partition table but do not find any
actual partition table entries we may as well try looking at it as a
whole disk image. Worst case is we probe and find there isn't anything
there.

This was reported by Sjors Gielen in Debian bug #745419. The fix was
inspired by a patch by Adi Kriegisch in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=745419#27

Tested by genext2fs'ing my /boot into a new raw image (works) and
then:
   dd if=/usr/lib/grub/i386-pc/g2ldr.mbr of=img conv=notrunc bs=512 count=1

to add an MBR (with 0xaa55 signature) to it, which after this patch
also works.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: 745419-forwarded@bugs.debian.org
2015-11-16 11:01:50 +00:00
..
2006-07-14 11:49:26 +01:00

pygrub is a grub-like bootloader for xen. This tool is to use to boot domU images.

To compile pygrub, you will need the following packages installed:

1) Libraries of ext2fs, which is the following package (depend on your Linux distribution):
	- e2fslibs-dev on Debian based distributions (Debian, Ubuntu, Linspire, Libranet, Xandros, etc...)
	- e2fsprogs-devel on RedHat, Fedora Core
	- libext2fs2-devel on Mandriva/Mandrake
	- e2fsprogs on Gentoo

2) Libraries of reiserfs, which is the following package (depend on your Linux distribution):
	- libreiserfs-dev on Debian based distributions (Debian, Ubuntu, Xandros, Libranet, Xandros, etc...)
	- progsreiserfs-devel on RedHat
	- progsreiserfs on Gentoo