X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=06200d87a7ed6e4a177d577741d4790e7c9b3f95;hp=3cccbca4d02eabdf874ba0ac74b347f2ff9376c2;hb=329df0b2f15d3ddb56010205c19eae7dd0d5f015;hpb=bba7c1961b43afcbe30097fc3fbbf6c53c57b1ac diff --git a/grml-debootstrap b/grml-debootstrap index 3cccbca..06200d8 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -1231,17 +1231,34 @@ preparechroot() { [ -d $CONFFILES/usr ] && cp $VERBOSE -a -L $CONFFILES/usr/* $MNTPOINT/usr/ [ -d $CONFFILES/var ] && cp $VERBOSE -a -L $CONFFILES/var/* $MNTPOINT/var/ - # copy local network setup to chroot + # network setup + DEFAULT_INTERFACES="# /etc/network/interfaces - generated by grml-debootstrap + +# Include files from /etc/network/interfaces.d when using +# ifupdown v0.7.44 or newer: +#source-directory /etc/network/interfaces.d + +auto lo +iface lo inet loopback + +allow-hotplug eth0 +iface eth0 inet dhcp +" + if [ -n "$NOINTERFACES" ] ; then einfo "Not installing /etc/network/interfaces as requested via --nointerfaces option" ; eend 0 elif [ -n "$VIRTUAL" ] ; then - einfo "Installing into Virtual Machine, skipping installation of /etc/network/interfaces" ; eend 0 + einfo "Installing into Virtual Machine, installing default /etc/network/interfaces" + echo "$DEFAULT_INTERFACES" > "${MNTPOINT}/etc/network/interfaces" + eend $? elif [ -r /etc/network/interfaces ] ; then einfo "Copying /etc/network/interfaces from host to target system" - cp $VERBOSE /etc/network/interfaces $MNTPOINT/etc/network/interfaces + cp $VERBOSE /etc/network/interfaces "${MNTPOINT}/etc/network/interfaces" eend $? else - ewarn "Couldn't read /etc/network/interfaces, not copying to target system" ; eend 0 + ewarn "Couldn't read /etc/network/interfaces, installing default /etc/network/interfaces" + echo "$DEFAULT_INTERFACES" > "${MNTPOINT}/etc/network/interfaces" + eend $? fi # install config file providing some example entries