Commit b35bd3f7 authored by Jonathan Michalon's avatar Jonathan Michalon

debootstrap grub hook: be compatible with Debian Stretch

Two points: rc.local does not exist + interface name (fallback to eth0)
parent 6ac02c29
......@@ -42,10 +42,13 @@ fi
# install a command in rc.local of the VM to install grub on first boot
INSTALL_COMMAND='[ -f /var/lib/dpkg/info/grub-pc.list ] || (DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends grub-pc; halt -p)'
# stretch does not provide an rc.local by default! create it… with shebang
echo -e '#!/bin/sh -e\n' >> ${TARGET}/etc/rc.local
chmod +x ${TARGET}/etc/rc.local
sed -i '$i'"$INSTALL_COMMAND" ${TARGET}/etc/rc.local
# pre-configure grub's installation questions
chroot "$TARGET" debconf-set-selections <<< "debconf grub2/linux_cmdline_default string console=ttyS0,38400 console=tty1 quiet"
chroot "$TARGET" debconf-set-selections <<< "debconf grub2/linux_cmdline_default string net.ifnames=0 console=ttyS0,38400 console=tty1 quiet"
chroot "$TARGET" debconf-set-selections <<< "debconf grub-pc/install_devices string /dev/vda"
# download packages now to avoid network dep on setup boot
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment