X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=0bbe4098cdcd7e4d401ec93ce5d0f8ecea5f84dd;hp=a22a021ca8dadf90c522f0eb2d9e31ef986ef9dd;hb=89e2ad98ad3b1362bb43d7b1634780c1c9db372f;hpb=b2febf4be9ecebfea7d91197cd319753638169f9;ds=inline diff --git a/grml-debootstrap b/grml-debootstrap index a22a021..0bbe409 100644 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -4,11 +4,11 @@ # 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: Fre Nov 03 00:54:39 CET 2006 [mika] +# Latest change: Fre Nov 03 15:34:02 CET 2006 [mika] ################################################################################ # http://www.debian.org/releases/stable/i386/apcs04.html.en -set -eu # exit on any error +set -e # exit on any error . /etc/grml/lsb-functions . /etc/grml/script-functions @@ -27,15 +27,26 @@ if [ -z "$TARGET" ] ; then exit 1 fi -# make an ext3 filesystem on /dev/sda1 -einfo "Running $MKFS on $TARGET" -$MKFS $TARGET -eend $? +if [ -n "$MKFS" ] ; then + einfo "Running $MKFS on $TARGET" + $MKFS $TARGET + eend $? +fi + +if [ -n "$TUNE2FS" ] ; then + einfo "Disabling automatic filesystem check on $TARGET via tune2fs" + TUNE2FS $TARGET + eend $? +fi # now mount the new partition -einfo "Mounting $TARGET to $MNTPOINT" -mount -o rw,suid,dev $TARGET $MNTPOINT -eend $? +if grep -q $TARGET /proc/mounts ; then + eerror "$TARGEt already mounted, exiting." +else + einfo "Mounting $TARGET to $MNTPOINT" + mount -o rw,suid,dev $TARGET $MNTPOINT + eend $? +fi # get main packages from a debian-mirror einfo "Running $DEBOOTSTRAP for release $RELEASE using mirror $MIRROR" @@ -45,10 +56,11 @@ eend $? einfo "Preparing chroot system" cp $CONFFILES/chroot-script $MNTPOINT/bin/chroot-script chmod 755 $MNTPOINT/bin/chroot-script - mkdir $MNTPOINT/etc/deboostrap/ + mkdir $MNTPOINT/etc/debootstrap/ - # make sure we have our config file for later use via chroot-script + # make sure we have our files for later use via chroot-script cp /etc/debootstrap/config $MNTPOINT/etc/debootstrap/ + cp /etc/debootstrap/packages $MNTPOINT/etc/debootstrap/packages # copy any existing existing files to chroot [ -d /etc/debootstrap/boot ] && cp -a /etc/debootstrap/boot/* $MNTPOINT/boot/ @@ -56,7 +68,7 @@ einfo "Preparing chroot system" [ -d /etc/debootstrap/share ] && cp -a /etc/debootstrap/share/* $MNTPOINT/share/ [ -d /etc/debootstrap/usr ] && cp -a /etc/debootstrap/usr/* $MNTPOINT/usr/ [ -d /etc/debootstrap/var ] && cp -a /etc/debootstrap/var/* $MNTPOINT/var/ -eend $? +eend 0 einfo "Executing chroot-script now" chroot $MNTPOINT /bin/chroot-script @@ -66,6 +78,13 @@ einfo "Unmount $MNTPOINT" umount $MNTPOINT eend $? +if [ "$FSCK" = 'yes' ] ; then + [ -n "$FSCKTOOL" ] || FSCKTOOL="fsck.${MKFS#mkfs.}" + einfo "Checking filesystem on $TARGET using $FSCKTOOL" + $FSCKTOOL $TARGET + eend $? +fi + einfo "Finished execution of $0 - enjoy your Debian system." ; eend 0 ## END OF FILE #################################################################