X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=chroot-script;h=cea2f7d26da762e8d0e927aa4eccf210af4c27fd;hp=bc933531be275fa5f8f0a9fc2107be50c2f55d1f;hb=e1bac354b542d9f6fed10d26a051cd7bd3b86d33;hpb=4fdbdbc3bccf62350c5fee4683ab9e701ca001f1 diff --git a/chroot-script b/chroot-script old mode 100644 new mode 100755 index bc93353..cea2f7d --- a/chroot-script +++ b/chroot-script @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Mon Apr 23 12:02:03 CEST 2007 [mika] +# Latest change: Son Dez 16 16:30:31 CET 2007 [mika] ################################################################################ set -e # exit on any error @@ -45,8 +45,13 @@ stage() { # define chroot mirror {{{ chrootmirror() { - if [ -n "$CHROOTMIRROR" ] ; then - echo "deb $CHROOTMIRROR $RELEASE main contrib non-free" > /etc/apt/sources.list + if [ -n "$ISO" ] ; then + echo "deb $ISO $RELEASE main contrib" > /etc/apt/sources.list + [ -n "$CHROOTMIRROR" ] && echo "deb $CHROOTMIRROR $RELEASE main contrib non-free" >> /etc/apt/sources.list + else + if [ -n "$CHROOTMIRROR" ] ; then + echo "deb $CHROOTMIRROR $RELEASE main contrib non-free" > /etc/apt/sources.list + fi fi } # }}} @@ -253,6 +258,7 @@ passwords() { echo "Setting password for user root:" set +e # do not exit if passwd returns error due to missmatching passwords passwd + until passwd; do echo "Please try again to set the password:" ; done echo "" set -e # restore default behaviour again fi @@ -270,13 +276,20 @@ hosts() { # set up /etc/network/interfaces {{{ interfaces() { - if ! [ -f /etc/network/interfaces ] ; then + touch /etc/network/interfaces + # make sure we add the entries only once + if ! grep -q eth0 /etc/network/interfaces ; then echo "Setting up /etc/network/interfaces" cat >> /etc/network/interfaces << EOF + +# loopback device: iface lo inet loopback -iface eth0 inet dhcp auto lo -auto eth0 + +# eth0: +# iface eth0 inet dhcp +# auto eth0 + EOF fi } @@ -391,7 +404,9 @@ grub() { # make sure we don't have any running processes left {{{ services() { for service in ssh mdadm mdadm-raid ; do - [ -x "/etc/init.d/$service" ] && "/etc/init.d/$service" stop + if [ -x /etc/init.d/"$service" ] ; then + /etc/init.d/"$service" stop || /bin/true + fi done } # }}}