3 # This is an example script that install and configure grub after installation.
4 # To use it put it in your CUSTOMIZE_DIR, make it executable, and edit EXTRAPKGS
5 # of your $sysconfdir/default/ganeti-instance-debootstrap.
7 # Xen, for etch/lenny i386:
8 # EXTRA_PKGS="linux-image-xen-686,libc6-xen"
9 # Xen, for etch/lenny amd64:
10 # EXTRA_PKGS="linux-image-xen-amd64"
12 # no extra packages needed besides the normal suggested ones
14 # Do not include grub in EXTRA_PKGS because it will cause error of debootstrap.
24 if [ -z "$TARGET" -o ! -d "$TARGET" ]; then
25 echo "Missing target directory"
31 chroot "$TARGET" apt-get -y --force-yes install grub grub-common
34 mknod $TARGET/dev/sda b $(stat -L -c "0x%t 0x%T" $BLOCKDEV)
35 CLEANUP+=("rm -f $TARGET/dev/sda")
38 mknod $TARGET/dev/sda1 b $(stat -L -c "0x%t 0x%T" $FSYSDEV)
39 CLEANUP+=("rm -f $TARGET/dev/sda1")
41 # create grub directory
42 mkdir -p "$TARGET/boot/grub"
45 cat > "$TARGET/boot/grub/device.map" <<EOF
50 chroot "$TARGET" update-grub
52 # install grub to the block device
53 grub-install --no-floppy --root-directory="$TARGET" "$BLOCKDEV"