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"
27 export https_proxy="$PROXY"
29 export DEBIAN_FRONTEND=noninteractive
30 chroot "$TARGET" apt-get -y --force-yes install grub grub-common
33 mknod $TARGET/dev/sda b $(stat -L -c "0x%t 0x%T" $BLOCKDEV)
34 CLEANUP+=("rm -f $TARGET/dev/sda")
37 mknod $TARGET/dev/sda1 b $(stat -L -c "0x%t 0x%T" $FSYSDEV)
38 CLEANUP+=("rm -f $TARGET/dev/sda1")
40 # create grub directory
41 mkdir -p "$TARGET/boot/grub"
44 cat > "$TARGET/boot/grub/device.map" <<EOF
49 chroot "$TARGET" update-grub
51 # install grub to the block device
52 grub-install --no-floppy --root-directory="$TARGET" "$BLOCKDEV"