initial commit of scripts to build pvgrub image
authorAdam Glasgall <glasgall@mit.edu>
Sun, 8 Jun 2014 19:53:23 +0000 (15:53 -0400)
committerAdam Glasgall <glasgall@mit.edu>
Sun, 8 Jun 2014 19:53:23 +0000 (15:53 -0400)
Makefile [new file with mode: 0644]
boot/grub-internal/grub-internal.cfg [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..27faef1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,11 @@
+all:
+       grub-mkstandalone --grub-mkimage=./grub-mkimage -o grub.xen -O x86_64-xen \
+                         -d /usr/lib/grub/x86_64-xen  -c boot/grub-internal/grub-internal.cfg \
+                         boot/grub-internal/grub-internal.cfg
+
+install: all
+       mkdir -p $(DESTDIR)/usr/lib/grub/
+       cp grub.xen $(DESTDIR)/usr/lib/grub/
+
+clean:
+       rm -f grub.xen
diff --git a/boot/grub-internal/grub-internal.cfg b/boot/grub-internal/grub-internal.cfg
new file mode 100644 (file)
index 0000000..8d67fe3
--- /dev/null
@@ -0,0 +1,32 @@
+insmod part_msdos
+insmod part_gpt
+insmod normal
+insmod search_fs_file
+insmod fshelp
+insmod archelp
+insmod ext2
+insmod fat
+insmod xfs
+insmod reiserfs
+insmod udf
+insmod iso9660
+insmod btrfs
+insmod squash4
+insmod xzio
+insmod gzio
+insmod configfile
+
+# first look for a separate /boot
+search.file /grub/grub.cfg root
+if [ "$root" != "memdisk" ]; then
+   # we found it
+   normal /grub/grub.cfg
+else
+  # try /boot/grub on the root 
+   search.file /boot/grub/grub.cfg root
+   if [ "$root" != "memdisk" ]; then
+      normal /boot/grub/grub.cfg
+   fi
+fi
+# we didn't find anything. give up and let grub show a prompt.
+normal