Permalink
Browse files

Move grub stamp to later in install, after we have a chance to run sc…

…ripts.
  • Loading branch information...
1 parent d4ca180 commit cce092d61dfd1244b2f2e2600334a418ec3c0ac7 @kmoore134 kmoore134 committed Jun 19, 2013
@@ -383,38 +383,6 @@ set_root_pw()
};
-# Script which stamps grub on the specified disks
-setup_grub()
-{
- # Mount devfs
- rc_halt "mount -t devfs devfs ${FSMNT}/dev"
-
- # Make sure to copy zpool.cache first
- rc_halt "cp /boot/zfs/zpool.cache ${FSMNT}/boot/zfs/"
-
- # Read through our list and stamp grub for each device
- while read line
- do
- # Make sure we have a /dev in front of the disk name
- echo $line | grep -q '/dev/'
- if [ $? -eq 0 ] ; then
- gDisk="$line"
- else
- gDisk="/dev/$line"
- fi
-
- # Stamp GRUB now
- rc_halt "chroot ${FSMNT} grub-install --force $gDisk"
- done < ${TMPDIR}/.grub-install
-
- # Make sure we re-create the default grub.cfg
- rc_halt "chroot ${FSMNT} grub-mkconfig -o /boot/grub/grub.cfg"
-
- # Sleep and cleanup
- sleep 5
- rc_halt "umount ${FSMNT}/dev"
-};
-
run_final_cleanup()
{
# Check if we need to run any gmirror setup
@@ -442,7 +410,4 @@ run_final_cleanup()
# Generate the fstab for the installed system
setup_fstab
- # Check if we need to setup GRUB
- if [ -e "${TMPDIR}/.grub-install" ] ; then setup_grub; fi
-
};
@@ -66,6 +66,9 @@ unmount_all_filesystems()
cp ${LOGOUT} ${FSMNT}/root/pc-sysinstall.log
cd /
+ # Check if we need to setup GRUB
+ if [ -e "${TMPDIR}/.grub-install" ] ; then setup_grub; fi
+
# Start by unmounting any ZFS partitions
zfs_cleanup_unmount
@@ -218,3 +221,38 @@ unmount_all_filesystems_failure()
umount ${CDMNT} >/dev/null 2>/dev/null
};
+
+# Script which stamps grub on the specified disks
+setup_grub()
+{
+ # Mount devfs
+ rc_halt "mount -t devfs devfs ${FSMNT}/dev"
+
+ # Make sure to copy zpool.cache first
+ rc_nohalt "cp /boot/zfs/zpool.cache ${FSMNT}/boot/zfs/"
+
+ # Copy the hostid so that our zfs cache works
+ rc_nohalt "cp /etc/hostid ${FSMNT}/etc/hostid"
+
+ # Read through our list and stamp grub for each device
+ while read line
+ do
+ # Make sure we have a /dev in front of the disk name
+ echo $line | grep -q '/dev/'
+ if [ $? -eq 0 ] ; then
+ gDisk="$line"
+ else
+ gDisk="/dev/$line"
+ fi
+
+ # Stamp GRUB now
+ rc_halt "chroot ${FSMNT} grub-install --force $gDisk"
+ done < ${TMPDIR}/.grub-install
+
+ # Make sure we re-create the default grub.cfg
+ rc_halt "chroot ${FSMNT} grub-mkconfig -o /boot/grub/grub.cfg"
+
+ # Sleep and cleanup
+ sleep 5
+ rc_halt "umount ${FSMNT}/dev"
+};

0 comments on commit cce092d

Please sign in to comment.