2 # Filename: grml-bootstrap
3 # Purpose: wrapper around debootstrap for installing plain Debian via grml
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 ################################################################################
8 # http://www.debian.org/releases/stable/i386/index.html.en
10 set -e # exit on any error
15 MNTPOINT="/mnt/debootstrap.$$"
17 # inside the chroot system locales might not be available, so use minimum:
21 # make sure interactive mode is only executed when
22 # using an empty configuration file or option --interactive
26 # source core functions {{{
27 . /etc/grml/lsb-functions
28 . /etc/grml/script-functions
33 echo "$PN - wrapper around debootstrap for installing Debian
37 -h|--help Print this usage information and exit.
38 -v|--version Show summary of options and exit.
40 -c|--config <configfile> Use specified configuration file,
41 defaults to /etc/debootstrap/config
42 -i|--iso <mnt> Mountpoint where a Debian ISO is mounted to,
43 for use instead of fetching packages from a mirror
44 -m|--mirror <URL> Mirror which should be used for apt-get/aptitude.
45 -p|--mntpoint <mnt> Mountpoint used for mounting the target system.
46 -r|--release <release> Release of new Debian system (default: stable)
47 -t|--target <target> Target partition (/dev/...) or directory.
49 --boot_append <appendline> Add specified appendline to kernel whilst booting
50 --groot <device> Root device for usage in grub, corresponds with
51 \$TARGET in grub syntax, like hd0,0 for /dev/sda1
52 --grub <device> Target for grub installation. Use grub syntax
53 for specifying, like hd0 for /dev/sda
54 --interactive Use interactive mode (frontend)
55 --password <pwd> Use specified password as password for user root.
57 Send bugreports to the grml-team: bugs@grml.org || http://grml.org/bugs/
61 if [ "$1" = '-h' ] || [ "$1" = '-help' ] ; then
63 echo 'Please notice that this script requires root permissions!'
68 # make sure we have what we need {{{
69 check4progs debootstrap dialog || exit 1
73 # source configuration file {{{
74 if [ -r /etc/debootstrap/config ] ; then
75 if [ -n "$CONFIGFILE" ] ; then
76 if ! . "$CONFIGFILE" ; then
77 eerror "Error reading config file $CONFIGFILE" ; eend 1 ; exit 1
80 . /etc/debootstrap/config
85 # cmdline handling {{{
87 while [ "$#" -gt "0" ] ; do
111 [ -n "$MIRROR" ] && unset MIRROR
136 einfo "$PN - version $VERSION"
137 einfo "Send bug reports to bugs@grml.org or http://grml.org/bugs/"
142 eerror "Syntax error."
154 dialog --title "$PN" --yesno "Welcome to the interactive configuration of ${PN}.
155 Do you want to continue installing Debian using this frontend?" 0 0
162 AVAILABLE_PARTITIONS=$(LANG=C fdisk -l 2>/dev/null | \
164 grep -v 'Extended$' | \
165 gawk -v num=0 -v ORS=' ' '/^\/dev\// {print $1}')
167 [ -n "$AVAILABLE_PARTITIONS" ] || echo "FIXME: no partitions available?"
168 PARTITION_LIST=$(for i in $(echo $AVAILABLE_PARTITIONS) ; do
169 echo "$i $(vol_id --type $i 2>/dev/null || echo [no_filesystem_yet])"
172 TARGET=$(dialog --title "$PN" --single-quoted --stdout \
173 --menu "Please select the target partition:" 0 0 0 \
178 # ask for bootmanager {{{
179 prompt_for_bootmanager()
182 for device in sda hda; do
183 if [ /dev/$device != ${TARGET%[0-9]} ]; then
184 grep -q $device /proc/partitions && \
185 ADDITIONAL_PARAMS=:$device:"install bootmanager grub into MBR of /dev/${device}"
188 ADDITIONAL_PARAMS=${ADDITIONAL_PARAMS#:}
192 if echo $TARGET | grep -q "*md*" ; then
195 MBRPART="${TARGET%[0-9]}"
198 GETMBR=$(dialog --stdout --title "$PN" --default-item mbr \
199 --menu "Where do you want to install the bootmanager grub?" 0 0 0 \
200 mbr "install bootmanager into MBR of $MBRPART" \
201 partition "install bootmanager into partition $TARGET" \
202 nowhere "do not install bootmanager at all" \
203 ${ADDITIONAL_PARAMS})
204 [ $? -eq 0 ] || bailout 3
209 # /dev/md0: has to be installed in MBR of /dev/md0 and not in /dev/md:
210 if echo $TARGET | grep -q "*md*" ; then
211 BOOT_PARTITION="${TARGET}"
213 BOOT_PARTITION="${TARGET%[0-9]}"
217 BOOT_PARTITION="$TARGET"
220 BOOT_PARTITION="/dev/hda"
223 BOOT_PARTITION="/dev/sda"
232 # ask for Debian release {{{
235 RELEASE="$(dialog --stdout --title "${PN}" --default-item etch --menu \
236 "Please enter the Debian release you would like to use for installation:" \
239 lenny Debian/testing \
240 sid Debian/unstable)"
244 # ask for Debian mirror {{{
247 MIRROR="$(dialog --stdout --title "${PN}" --inputbox \
248 "Please enter Debian mirror you would like to use for installing packages." \
249 0 0 http://ftp.de.debian.org/debian)"
253 # get grub's syntax for /dev/ice {{{
254 # usage example: 'grubdevice /dev/sda2' returns 'hd0,1'
256 if [ -z "$1" ] ; then
257 echo "Usage: grubdevice <device>">&2
262 device_map=/boot/grub/device.map
265 if ! [ -f "$device_map" ] ; then
266 echo 'quit' | grub --device-map="$device_map" 1>/dev/null 2>&1
269 # based on code from d-i's trunk/packages/arch/i386/grub-installer/grub-installer:
270 tmp_disk=`echo "$device" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \
271 -e 's%\(fd[0-9]*\)$%\1%' \
272 -e 's%/part[0-9]*$%/disc%' \
273 -e 's%\(c[0-7]d[0-9]*\).*$%\1%'`
274 tmp_part=`echo "$device" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \
275 -e 's%.*/fd[0-9]*$%%' \
276 -e 's%.*/floppy/[0-9]*$%%' \
277 -e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%' \
278 -e 's%.*c[0-7]d[0-9]*p*%%'`
279 tmp_drive=$(grep -v '^#' $device_map | grep "$tmp_disk *$" | sed 's%.*\([hf]d[0-9][a-g0-9,]*\).*%\1%')
282 /dev/[sh]d[a-z]) # we expect something like 'hd0'
285 *) # we expect something like 'hd0,0'
286 echo "$tmp_drive" | sed "s%$%,`expr $tmp_part - 1`%" # FIXME => md0
292 # software raid setup {{{
293 config_swraid_setup()
296 RAIDLEVEL=$(dialog --stdout --title "$PN" --default-item raid1 \
297 --menu "Which RAID level do you want to use?" 0 0 0 \
298 raid1 "Software RAID level 1" \
299 raid5 "Software RAID level 5")
300 [ $? -eq 0 ] || bailout 20
302 MD_LIST=$(for i in $(seq 0 9) ; do
303 awk '{print $4}' /proc/partitions | grep -q md$i || \
304 echo "/dev/md$i /dev/md$i"
307 TARGET=$(dialog --stdout --title "$PN" --default-item /dev/md0 \
308 --menu "Which device do you want to use for ${RAIDLEVEL}?
310 Notice: activated devices will not be listed for security reasons. Anyway, please make sure the selected device is not in use already!" 0 0 0 \
312 [ $? -eq 0 ] || bailout 20
314 AVAILABLE_PARTITIONS=$(LANG=C fdisk -l 2>/dev/null | \
316 grep -v 'Extended$' | \
317 gawk -v num=0 -v ORS=' ' '/^\/dev\// {print $1}')
318 [ -n "$AVAILABLE_PARTITIONS" ] || echo "FIXME: no partitions available?"
319 PARTITION_LIST=$(for i in $(echo $AVAILABLE_PARTITIONS) ; do
320 echo "$i $(vol_id --type $i 2>/dev/null || echo [no_filesystem_yet]) off"
323 dialog --title "$PN" \
325 --checklist "Please select the partitions you would like to use for your $RAIDLEVEL on ${TARGET}:" 0 0 0 \
326 $PARTITION_LIST 2>$TMPFILE
328 SELECTED_PARTITIONS="$(cat $TMPFILE)"
331 for i in $(cat $TMPFILE) ; do
332 NUM_PARTITIONS=$((${NUM_PARTITIONS}+1))
337 # TODO: better error handling?
338 yes | mdadm --create "${TARGET}" --level="${RAIDLEVEL}" \
339 --raid-devices="${NUM_PARTITIONS}" ${SELECTED_PARTITIONS} 1>/dev/null 2>$ERRORFILE
343 if [ "$RC" = 0 ] ; then
344 dialog --title "$PN" --msgbox \
345 "Creating $TARGET was successful." 0 0
346 rm -f "$TMPFILE" "$ERRORFILE"
348 dialog --title "$PN" --msgbox \
349 "There was an error setting up $TARGET:
354 rm -f "$TMPFILE" "$ERRORFILE"
362 if dialog --stdout --title "$PN" \
363 --defaultno --yesno "Do you want to configure Software RAID?
365 Please notice that currently only RAID levels 1 and 5 are supported by ${PN}. Configuration will take place using mdadm." 0 0 ; then
371 # make sure the user is aware of the used configuration {{{
374 if [ -n "$AUTOINSTALL" ] ; then
375 if checkforrun ; then
376 eerror "Exiting as requested" ; eend 0
379 elif [ -n "$INTERACTIVE" ] ; then
381 INFOTEXT="Please recheck configuration before execution:
383 [ -n "$TARGET" ] && INFOTEXT="$INFOTEXT
385 [ -n "$GRUB" ] && INFOTEXT="$INFOTEXT
387 [ -n "$RELEASE" ] && INFOTEXT="$INFOTEXT
388 Using release: $RELEASE"
389 [ -n "$MIRROR" ] && INFOTEXT="$INFOTEXT
390 Using mirror: $MIRROR"
394 Is this ok for you? Notice: canceling will exit ${PN}."
396 dialog --title "$PN" --no-collapse \
397 --yesno "$INFOTEXT" 0 0
399 else # if not running automatic installation display configuration and prompt for execution:
400 einfo "$PN - Please recheck configuration before execution:"
402 echo " Target: $TARGET"
403 case "$MNTPOINT" in "$TARGET") ;; *) echo " Mount point: $MNTPOINT" ;; esac
404 [ -n "$GRUB" ] && echo " Install grub: $GRUB" || echo " Install grub: no"
405 [ -n "$RELEASE" ] && echo " Using release: $RELEASE"
406 [ -n "$MIRROR" ] && echo " Using mirror: $MIRROR"
407 [ -n "$ISO" ] && echo " Using iso: $ISO"
408 case "$MNTPOINT" in "$TARGET") ;; *) echo " Important! Continuing will delete all data from ${TARGET}!" ;; esac
410 einfon "Is this ok for you? [y/N] "
412 if ! [ "$a" = 'y' -o "$a" = 'Y' ] ; then
413 eerror "Exiting as requested." ; eend 1
420 # interactive mode {{{
427 # do not prompt for partition dialog if swraid has been configured already
428 [ -n "$TARGET" ] || prompt_for_target
430 prompt_for_bootmanager
434 # FIXME: there seems to be a problem with grubdevice if it's /dev/md*
435 if echo "$TARGET" | grep -q '/dev/md' ; then
436 echo "debug: SELECTED_PARTITIONS = $SELECTED_PARTITIONS">&2
438 [ -n "$BOOT_PARTITION" ] && GRUB="$(grubdevice $BOOT_PARTITION)"
439 [ -n "$TARGET" ] && GROOT="$(grubdevice $TARGET)"
447 # run interactive mode if we didn't get the according configuration yet
448 if [ -z "$TARGET" -o -n "$INTERACTIVE" ] ; then
449 # only target might be unset, so make sure the INTERACTIVE flag is set as well
455 # finally make sure at least $TARGET is set [the partition for the new system] {{{
456 if [ -n "$TARGET" ] ; then
457 SHORT_TARGET="${TARGET##*/}"
459 eerror "Please adjust /etc/debootstrap/config or..."
460 eerror "... use the interactive version for configuration before running ${0}" ; eend 1
466 if [ -z "$STAGES" ] ; then
467 STAGES="/var/cache/grml-debootstrap/stages_${SHORT_TARGET}"
468 [ -d "$STAGES" ] || mkdir -p "$STAGES"
471 if [ -r "$STAGES"/grml-debootstrap ] ; then
472 if grep -q done $STAGES/grml-debootstrap ; then
473 eerror "Error: grml-debootstrap has been executed already, won't continue therefore."
474 eerror "If you want to re-execute grml-debootstrap just manually remove ${STAGES}" ; eend 1
479 # partition handling {{{
488 # assume we are installing into a directory, don't run mkfs and grub related stuff therefore
500 # architecture setup {{{
501 if [ -n "$ARCH" ] ; then
502 ARCHCMD="--arch $ARCH"
503 ARCHINFO=" (${ARCH})"
505 ARCH="$(dpkg --print-architecture)"
506 ARCHCMD="--arch $ARCH"
507 ARCHINFO=" (${ARCH})"
511 # make sure we have the right syntax when using an iso image {{{
512 if [ -n "$ISO" ] ; then
525 # provide variables to chroot system {{{
526 CHROOT_VARIABLES="/var/cache/grml-debootstrap/variables_${SHORT_TARGET}"
527 touch $CHROOT_VARIABLES
528 chmod 600 $CHROOT_VARIABLES # make sure nobody except root can read it
529 [ -n "$ARCH" ] && echo "ARCH=$ARCH" > $CHROOT_VARIABLES
530 [ -n "$GRUB" ] && echo "GRUB=$GRUB" >> $CHROOT_VARIABLES
531 [ -n "$GROOT" ] && echo "GROOT=$GROOT" >> $CHROOT_VARIABLES
532 [ -n "$TARGET" ] && echo "TARGET=$TARGET" >> $CHROOT_VARIABLES
533 [ -n "$ISO" ] && echo "ISO=$ISO" >> $CHROOT_VARIABLES
534 [ -n "$ISODIR" ] && echo "ISODIR=$ISO" >> $CHROOT_VARIABLES
535 [ -n "$MIRROR" ] && echo "MIRROR=$MIRROR" >> $CHROOT_VARIABLES
536 [ -n "$MIRROR" ] && echo "CHROOTMIRROR=$MIRROR" >> $CHROOT_VARIABLES
537 [ -n "$ROOTPASSWORD" ] && echo "ROOTPASSWORD=$ROOTPASSWORD" >> $CHROOT_VARIABLES
540 # helper functions {{{
541 # we want to exit smoothly and clean:
543 # make sure $TARGET is not mounted when exiting grml-debootstrap
544 if [ -n "$MNTPOINT" ] ; then
545 if grep -q $MNTPOINT /proc/mounts ; then
546 # make sure nothing is left inside chroot so we can unmount it
547 [ -x "$MNTPOINT"/etc/init.d/ssh ] && "$MNTPOINT"/etc/init.d/ssh stop
548 [ -x "$MNTPOINT"/etc/init.d/mdadm ] && "$MNTPOINT"/etc/init.d/mdadm stop
549 # ugly, but make sure we really don't leav anything
550 [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount /sys 1>/dev/null 2>&1
551 [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount -a 1>/dev/null 2>&1
552 [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount /proc 1>/dev/null 2>&1
553 [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount /proc 1>/dev/null 2>&1
554 [ -d "$MNTPOINT/$ISODIR" ] && umount "$MNTPOINT/$ISODIR" 1>/dev/null 2>&1
555 einfo "Unmounting $MNTPOINT" ; umount "$MNTPOINT" ; eend $?
557 if [ -n "$STAGES" ] ; then
558 echo -n "Removing stages directory ${STAGES}: "
559 rm -rf "$STAGES" && echo done
562 # remove directory only if we used the default with process id inside the name
563 if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then
564 einfo "Removing directory ${MNTPOINT}" ; rmdir $MNTPOINT ; eend $?
569 [ -n "$1" ] && EXIT="$1" || EXIT="1"
570 [ -n "$3" ] && einfo "Notice: just remove $STAGES/$3 to reexecute the stage"
574 trap bailout HUP INT QUIT TERM
576 # we want to execute all the functions only once, simple check for it:
578 if [ -n "$2" ] ; then
579 echo "$2" > "${STAGES}/${1}"
581 elif grep -q done "${STAGES}/${1}" 2>/dev/null ; then
582 ewarn "Notice: stage $1 has been executed already, skipping execution therefore." ; eend 0
584 ewarn "To reexecute it clean up the according directory inside $STAGES" ; eend 0
591 # user should recheck his configuration {{{
592 # support full automatic installation:
594 dialog --timeout 10 --title "$PN" \
595 --yesno "Do you want to stop at this stage?
597 Notice: you are running ${PN} in non-interactive mode.
598 ${PN} will install Debian ${RELEASE} on ${TARGET}.
599 Last chance to quit. Timeout of 10 seconds running....
601 Do you want to stop now?" 0 0 2>/dev/null
604 # create filesystem {{{
606 if [ -n "$MKFS" ] ; then
607 einfo "Running $MKFS on $TARGET"
614 # modify filesystem settings {{{
616 if [ -n "$TUNE2FS" ] ; then
617 einfo "Disabling automatic filesystem check on $TARGET via tune2fs"
624 # mount the new partition or if it's a directory do nothing at all {{{
626 if [ -n "$DIRECTORY" ] ; then
627 einfo "Running grml-debootstrap on a directory, nothing to mount."
629 if grep -q $TARGET /proc/mounts ; then
630 eerror "$TARGET already mounted, exiting."
632 [ -d "$MNTPOINT" ] || mkdir -p "$MNTPOINT"
633 einfo "Mounting $TARGET to $MNTPOINT"
634 mount -o rw,suid,dev $TARGET $MNTPOINT
638 if [ -n "$ISODIR" ] ; then
639 einfo "Mounting Debian image loopback to $MNTPOINT/$ISODIR."
640 mkdir -p "$MNTPOINT/$ISODIR"
641 mount --bind "$ISODIR" "$MNTPOINT/$ISODIR"
647 # install main chroot {{{
648 debootstrap_system() {
649 if ! grep -q $MNTPOINT /proc/mounts ; then
652 if grep -q $MNTPOINT /proc/mounts ; then
653 einfo "Running $DEBOOTSTRAP for release ${RELEASE}${ARCHINFO} using ${MIRROR}${ISO}"
654 [ -n "$MIRROR" ] && $DEBOOTSTRAP $ARCHCMD $RELEASE $MNTPOINT $MIRROR || \
655 $DEBOOTSTRAP $ARCHCMD $RELEASE $MNTPOINT $ISO
658 eerror "Error: $MNTPOINT not mounted, can not continue."
664 # prepare chroot via chroot-script {{{
666 einfo "Preparing chroot system"
667 cp $CONFFILES/chroot-script $MNTPOINT/bin/chroot-script
668 chmod 755 $MNTPOINT/bin/chroot-script
669 mkdir $MNTPOINT/etc/debootstrap/
671 # make sure we have our files for later use via chroot-script
672 cp /etc/debootstrap/config $MNTPOINT/etc/debootstrap/
673 # make sure we adjust the configuration variables accordingly:
674 sed -i "s/RELEASE=.*/RELEASE=\"$RELEASE\"/" $MNTPOINT/etc/debootstrap/config
675 sed -i "s/TARGET=.*/TARGET=\"$TARGET\"/" $MNTPOINT/etc/debootstrap/config
676 sed -i "s/GRUB=.*/GRUB=\"$GRUB\"/" $MNTPOINT/etc/debootstrap/config
677 sed -i "s/GROOT=.*/GROOT=\"$GROOT\"/" $MNTPOINT/etc/debootstrap/config
679 cp /etc/debootstrap/packages $MNTPOINT/etc/debootstrap/packages
681 # notice: do NOT use $CHROOT_VARIABLES inside chroot but statically file instead!
682 cp $CHROOT_VARIABLES $MNTPOINT/etc/debootstrap/variables
684 cp -a /etc/debootstrap/extrapackages/ $MNTPOINT/etc/debootstrap/
686 # make sure we can access network [relevant for cdebootstrap]
687 [ -f "$MNTPOINT/etc/resolv.conf" ] || cp /etc/resolv.conf $MNTPOINT/etc/resolv.conf
689 # provide system's /etc/hosts to the target:
690 if ! [ -f "$MNTPOINT/etc/hosts" ] ; then
691 cp /etc/hosts $MNTPOINT/etc/hosts
692 sed -i "s/127.0.0.1 .*/127.0.0.1 localhost $HOSTNAME/" /etc/hosts
695 # setup default locales
696 [ -n "$LOCALES" ] && cp /etc/debootstrap/locale.gen $MNTPOINT/etc/locale.gen
698 # MAKEDEV is just a forking bomb crap, let's do it on our own instead :)
699 ( cd $MNTPOINT/dev && tar zxf /etc/debootstrap/devices.tar.gz )
701 # copy any existing existing files to chroot
702 [ -d /etc/debootstrap/boot ] && cp -a /etc/debootstrap/boot/* $MNTPOINT/boot/
703 [ -d /etc/debootstrap/etc ] && cp -a /etc/debootstrap/etc/* $MNTPOINT/etc/
704 [ -d /etc/debootstrap/share ] && cp -a /etc/debootstrap/share/* $MNTPOINT/share/
705 [ -d /etc/debootstrap/usr ] && cp -a /etc/debootstrap/usr/* $MNTPOINT/usr/
706 [ -d /etc/debootstrap/var ] && cp -a /etc/debootstrap/var/* $MNTPOINT/var/
708 # copy local network setup to chroot
709 if [ -r /etc/network/interfaces -a ! -r "${MNTPOINT}"/etc/network/interfaces ] ; then
710 [ -d $MNTPOINT/etc/network ] || mkdir $MNTPOINT/etc/network
711 cp /etc/network/interfaces $MNTPOINT/etc/network/interfaces
718 # execute chroot-script {{{
720 if ! [ -r "$MNTPOINT/bin/chroot-script" ] ; then
723 if [ -x "$MNTPOINT/bin/chroot-script" ] ; then
724 einfo "Executing chroot-script now"
725 chroot "$MNTPOINT" /bin/chroot-script
728 eerror "Fatal: $MNTPOINT/bin/chroot-script could not be found."
734 # install booloader grub {{{
736 if [ -z "$GRUB" -o -z "$GROOT" ] ; then
737 echo "Notice: \$GRUB or \$GROOT not defined, will not install grub therefor."
738 elif [ -n "$SELECTED_PARTITIONS" ] ; then # using sw-raid
739 for device in $SELECTED_PARTITIONS ; do
740 GRUB=$(grubdevice $device)
741 einfo "Installing grub on ${GRUB}:"
742 [ -x /usr/sbin/grub-install ] && GRUBINSTALL=/usr/sbin/grub-install --no-floppy || GRUBINSTALL=/sbin/grub-install
743 $GRUBINSTALL --root-directory="$MNTPOINT" "(${GRUB})"
747 einfo "Installing grub on ${GRUB}:"
748 [ -x /usr/sbin/grub-install ] && GRUBINSTALL=/usr/sbin/grub-install --no-floppy || GRUBINSTALL=/sbin/grub-install
749 $GRUBINSTALL --root-directory="$MNTPOINT" "(${GRUB})"
755 # unmount $MNTPOINRT {{{
757 if [ -n "$ISODIR" ] ; then
758 if grep -q "$ISODIR" /proc/mounts ; then
759 einfo "Unmount $MNTPOINT/$ISODIR"
760 umount "$MNTPOINT/$ISODIR"
764 if grep -q "$MNTPOINT" /proc/mounts ; then
765 if [ -n "$PARTITION" ] ; then
766 einfo "Unmount $MNTPOINT"
774 # execute filesystem check {{{
776 if [ "$FSCK" = 'yes' ] ; then
777 [ -n "$FSCKTOOL" ] || FSCKTOOL="fsck.${MKFS#mkfs.}"
778 einfo "Checking filesystem on $TARGET using $FSCKTOOL"
785 # now execute all the functions {{{
786 for i in mkfs tunefs mount_target debootstrap_system preparechroot \
787 chrootscript grub_install umount_chroot fscktool ; do
788 if stage "${i}" ; then
789 $i && ( stage "${i}" done && rm -f "${STAGES}/${i}" ) || bailout 2 "i"
795 einfo "Removing ${CHROOT_VARIABLES}" ; rm "$CHROOT_VARIABLES" ; eend $?
796 einfo "Removing ${STAGES}" ; rmdir "$STAGES" ; eend $?
798 # Remove temporary mountpoint again
799 if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then
800 einfo "Removing directory ${MNTPOINT}" ; rmdir "$MNTPOINT" ; eend $?
804 # end dialog of autoinstallation {{{
805 if [ -n "$AUTOINSTALL" ] ; then
806 dialog --title "$PN" --msgbox \
807 "Finished execution of ${PN}. Enjoy your Debian system." 0 0
809 einfo "Finished execution of ${PN}. Enjoy your Debian system." ; eend 0
813 ## END OF FILE #################################################################
814 # vim: ai tw=100 expandtab foldmethod=marker shiftwidth=3