Commit 5d1c7ba9 authored by Jonathan Michalon's avatar Jonathan Michalon
Browse files

debootstrap grub hook: don't try badly to keep /etc/rc.local content

parent 1dbbcc3d
......@@ -43,9 +43,10 @@ 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
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
echo 'exit 0' >> ${TARGET}/etc/rc.local
# pre-configure grub's installation questions
chroot "$TARGET" debconf-set-selections <<< "debconf grub2/linux_cmdline_default string net.ifnames=0 console=ttyS0,38400 console=tty1 quiet"
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