Skip to contentSkip to conversation

Add details to PV-GRUB documentation

PATCH In review Samuel Thibault 2 participants 6 messages Mar 3, 2010 – Mar 7, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add details to PV-GRUB documentation

Add a couple of documentation details about PV-GRUB support

- the menu.lst content can be passed as a ramdisk.
- virtual partitions are not supported.

stubdom/README +15 -2
diff -r b8d2a4134a68 stubdom/README
@@ -52,11 +52,17 @@
 
 extra = "(hd0,0)/boot/grub/menu.lst"
 
-you can also use a tftp path (dhcp will be automatically performed):
+or you can provide the content of a menu.lst stored in dom0 by passing it as a
+ramdisk:
+
+ramdisk = "/boot/domU-1-menu.lst"
+
+or you can also use a tftp path (dhcp will be automatically performed):
 
 extra = "(nd)/somepath/menu.lst"
 
-or you can set it in option 150 of your dhcp server and leave extra empty
+or you can set it in option 150 of your dhcp server and leave extra and ramdisk
+empty (dhcp will be automatically performed)
 
 Limitations
 ===========
@@ -69,6 +75,13 @@
 - bootsplash is supported, but the ioemu backend does not yet support restart
 for use by the booted kernel.
 
+- PV-GRUB doesn't support virtualized partitions. For instance:
+
+disk = [ 'phy:hda7,hda7,w' ]
+
+will be seen by PV-GRUB as (hd0), not (hd0,6), since GRUB will not see any
+partition table.
+
 
                                 Your own stubdom
                                 ================
#1 lore raw
Quoted 5 lines · Samuel Thibault

Add a couple of documentation details about PV-GRUB support

- the menu.lst content can be passed as a ramdisk.
- virtual partitions are not supported.

BTW, I had a problem with pvgrub with an ext4 /boot, where it hung indefinitely after starting. It seemed to be spinning in a readdir loop on a zero-length directory entry. The directory in question was a single extent.

Does pvgrub support ext4 /boot?

Thanks,
J

Quoted 46 lines

diff -r b8d2a4134a68 stubdom/README

stubdom/README +15 -2
@@ -52,11 +52,17 @@
 
  extra = "(hd0,0)/boot/grub/menu.lst"
 
-you can also use a tftp path (dhcp will be automatically performed):
+or you can provide the content of a menu.lst stored in dom0 by passing it as a
+ramdisk:
+
+ramdisk = "/boot/domU-1-menu.lst"
+
+or you can also use a tftp path (dhcp will be automatically performed):
 
  extra = "(nd)/somepath/menu.lst"
 
-or you can set it in option 150 of your dhcp server and leave extra empty
+or you can set it in option 150 of your dhcp server and leave extra and ramdisk
+empty (dhcp will be automatically performed)
 
  Limitations
  ===========
@@ -69,6 +75,13 @@
  - bootsplash is supported, but the ioemu backend does not yet support restart
  for use by the booted kernel.
 
+- PV-GRUB doesn't support virtualized partitions. For instance:
+
+disk = [ 'phy:hda7,hda7,w' ]
+
+will be seen by PV-GRUB as (hd0), not (hd0,6), since GRUB will not see any
+partition table.
+
 
                                  Your own stubdom
                                  ================

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 6 lines · Jeremy Fitzhardinge, le Wed 03 Mar 2010 14:48:47 -0800, a écrit :
Quoted 4 lines · Samuel Thibault

Add a couple of documentation details about PV-GRUB support

- the menu.lst content can be passed as a ramdisk.
- virtual partitions are not supported.

Quoted 6 lines

BTW, I had a problem with pvgrub with an ext4 /boot, where it hung indefinitely after starting. It seemed to be spinning in a readdir loop on a zero-length directory entry. The directory in question was a single extent.

Does pvgrub support ext4 /boot?

According to the ext4 howto, once extents are enabled, the filesystem can not be mounted by ext2/3 tools: “If you convert your root filesystem ("/") to ext4, and you use the GRUB boot loader, you will need to install a version of GRUB which understands ext4. Your system may boot OK the first time, but when your kernel is upgraded, it will become unbootable.”

So I guess for now we at least need to document that ext4 is not supported. The long-term plan could probably be to PV-ize grub2 of course...

Samuel

#3 lore raw
Quoted 9 lines · Samuel Thibault

According to the ext4 howto, once extents are enabled, the filesystem can not be mounted by ext2/3 tools: “If you convert your root filesystem ("/") to ext4, and you use the GRUB boot loader, you will need to install a version of GRUB which understands ext4. Your system may boot OK the first time, but when your kernel is upgraded, it will become unbootable.”

So I guess for now we at least need to document that ext4 is not supported.

Yes. It should also test the filesystem feature flags for features it doesn't support and give a useful error message (though I did finally work out how to use gdbsx while tracking this down).

Quoted 3 lines

The long-term plan could probably be to PV-ize grub2 of
course...

I suppose. At least Fedora's grub1 supports ext4 (it was the F12 installer which made this /boot); perhaps pvgrub needs a resync with upstream grub?

J

#4 lore raw
Quoted 5 lines · Jeremy Fitzhardinge, le Wed 03 Mar 2010 15:04:33 -0800, a écrit :
Quoted 2 lines

The long-term plan could probably be to PV-ize grub2 of
course...

I suppose. At least Fedora's grub1 supports ext4 (it was the F12 installer which made this /boot);

Ah, so we can probably steal their patch.

Quoted 1 line

perhaps pvgrub needs a resync with upstream grub?

Upstream has stopped all grub1 developments after 0.97. Everything else is patches on top of it in various distributions (see debian's 60th version of package :) )

Samuel

#5 lore raw

PATCH 1/1 Fix gzip support and iso support on x86_64

In reply to Samuel Thibault

Fix gzip support and iso support on x86_64

stubdom/grub.patches/99minios +67 -0
diff -r 8dada4c897c9 stubdom/grub.patches/99minios
@@ -1501,3 +1501,70 @@
  #else
  	/* This is slower but this works on all x86 architectures.  */
  	__asm__("xchgb %b0, %h0" \
+--- grub.orig/stage2/gunzip.c	2010-03-07 23:03:34.000000000 +0100
++++ grub/stage2/gunzip.c	2010-03-07 23:05:36.000000000 +0100
+@@ -141,7 +141,7 @@
+ static int gzip_filemax;
+ static int gzip_fsmax;
+ static int saved_filepos;
+-static unsigned long gzip_crc;
++static unsigned int gzip_crc;
+ 
+ /* internal extra variables for use of inflate code */
+ static int block_type;
+@@ -157,7 +157,7 @@
+  *  Linear allocator.
+  */
+ 
+-static unsigned long linalloc_topaddr;
++static unsigned int linalloc_topaddr;
+ 
+ static void *
+ linalloc (int size)
+@@ -253,7 +253,7 @@
+ 
+ typedef unsigned char uch;
+ typedef unsigned short ush;
+-typedef unsigned long ulg;
++typedef unsigned int ulg;
+ 
+ /*
+  *  Window Size
+@@ -316,8 +316,8 @@
+       return 0;
+     }
+ 
+-  gzip_crc = *((unsigned long *) buf);
+-  gzip_fsmax = gzip_filemax = *((unsigned long *) (buf + 4));
++  gzip_crc = *((unsigned int *) buf);
++  gzip_fsmax = gzip_filemax = *((unsigned int *) (buf + 4));
+ 
+   initialize_tables ();
+ 
+diff -ur grub.orig/stage2/fsys_iso9660.c grub-upstream/stage2/fsys_iso9660.c
+--- grub.orig/stage2/fsys_iso9660.c	2010-03-07 23:39:00.000000000 +0100
++++ grub/stage2/fsys_iso9660.c	2010-03-07 23:39:56.000000000 +0100
+@@ -43,7 +43,7 @@
+ 
+ /* iso fs inode data in memory */
+ struct iso_inode_info {
+-  unsigned long file_start;
++  unsigned int file_start;
+ };
+ 
+ #define ISO_SUPER	\
+@@ -88,12 +88,12 @@
+   if (byte_len <= 0)
+     return 1;
+ 
+-  sector += (byte_offset >> sector_size_lg2);
+-  byte_offset &= (buf_geom.sector_size - 1);
+   asm volatile ("shl%L0 %1,%0"
+ 		: "=r"(sector)
+ 		: "Ic"((int8_t)(ISO_SECTOR_BITS - sector_size_lg2)),
+ 		"0"(sector));
++  sector += (byte_offset >> sector_size_lg2);
++  byte_offset &= (buf_geom.sector_size - 1);
+ 
+ #if !defined(STAGE1_5)
+   if (disk_read_hook && debug)