3 # This is an example script that install and configure grub after installation.
4 # To use it put it in your CUSTOMIZE_DIR and make it executable.
6 # Do not include grub in EXTRA_PKGS of
7 # $sysconfdir/default/ganeti-instance-debootstrap because it will
8 # cause error of debootstrap.
18 if [ -z "$TARGET" -o ! -d "$TARGET" ]; then
19 echo "Missing target directory"
26 export http_proxy="$PROXY"
28 export DEBIAN_FRONTEND=noninteractive
29 chroot "$TARGET" apt-get -y --force-yes install grub grub-common
32 mknod $TARGET/dev/sda b $(stat -L -c "0x%t 0x%T" $BLOCKDEV)
33 CLEANUP+=("rm -f $TARGET/dev/sda")
36 mknod $TARGET/dev/sda1 b $(stat -L -c "0x%t 0x%T" $FSYSDEV)
37 CLEANUP+=("rm -f $TARGET/dev/sda1")
39 # create grub directory
40 mkdir -p "$TARGET/boot/grub"
43 cat > "$TARGET/boot/grub/device.map" <<EOF
48 chroot "$TARGET" update-grub
50 # install grub to the block device
51 grub-install --no-floppy --root-directory="$TARGET" "$BLOCKDEV"