[Fai-commit] r6163 - branches/experimental/patches
Michael Tautschnig
mt at alioth.debian.org
Sat Oct 16 12:53:32 UTC 2010
Author: mt
Date: 2010-10-16 12:53:31 +0000 (Sat, 16 Oct 2010)
New Revision: 6163
Added:
branches/experimental/patches/grub-in-target
Modified:
branches/experimental/patches/series
Log:
bind-mount /dev and /proc into target and call grub-install inside chroot; this
is what other installers do, as researched by Mika. This will finally fix
#523617.
Added: branches/experimental/patches/grub-in-target
===================================================================
--- branches/experimental/patches/grub-in-target (rev 0)
+++ branches/experimental/patches/grub-in-target 2010-10-16 12:53:31 UTC (rev 6163)
@@ -0,0 +1,46 @@
+2010-10-16 Michael Tautschnig <mt at debian.org>
+
+ * subroutines: bind-mount /proc and /dev into target. Thanks Michael Prokop
+ <mika at debian.org> for providing all the info and looking at other
+ references.
+ * examples/simple/files/boot/grub/menu.lst/postinst: Call grub-install within
+ chroot, which works with the above change (closes: #523617)
+Index: trunk/lib/subroutines
+===================================================================
+--- trunk.orig/lib/subroutines
++++ trunk/lib/subroutines
+@@ -421,6 +421,13 @@
+ sendmon "TASKERROR mountdisks 705"
+ task_error 705
+ fi
++ # mount /dev and /proc on target otherwise grub-installer will fail
++ mount -o bind /dev $FAI_ROOT/dev
++ task_error 706 $?
++ if [ ! -e $FAI_ROOT/proc/version ]; then
++ mount -o bind /proc $FAI_ROOT/proc
++ task_error 707 $?
++ fi
+ }
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ task_configure() {
+@@ -494,6 +501,7 @@
+ die "Internal error when calling /tmp/rebootCD."
+ fi
+ umount $FAI_ROOT/proc
++ umount $FAI_ROOT/dev
+ umount -ar
+ exec reboot -dfi
+ }
+Index: trunk/examples/simple/files/boot/grub/menu.lst/postinst
+===================================================================
+--- trunk.orig/examples/simple/files/boot/grub/menu.lst/postinst
++++ trunk/examples/simple/files/boot/grub/menu.lst/postinst
+@@ -17,7 +17,7 @@
+ [ -z "$BOOT_DEVICE" ] && exit 701
+ [ -z "$BOOT_PARTITION" ] && exit 702
+
+-grub-install --no-floppy --root-directory=$target $BOOT_DEVICE
++$ROOTCMD grub-install --no-floppy $BOOT_DEVICE
+ GROOT=$(device2grub $BOOT_PARTITION)
+ perl -pi -e 's/#(\w+)#/$ENV{$1}/g' $2
+ $ROOTCMD /usr/sbin/update-grub
Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series 2010-10-16 12:23:50 UTC (rev 6162)
+++ branches/experimental/patches/series 2010-10-16 12:53:31 UTC (rev 6163)
@@ -20,3 +20,4 @@
setup-storage_no-empty-config
setup-storage_entire-disk-in-volume
setup-storage_disklist-LOGDIR-defaults
+grub-in-target
More information about the Fai-commit
mailing list