X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=4e977fd47bb6d499f522da9b51b1a4b639f5e364;hp=91d319c00c2be811c2b304c77a6d9f1ca0d84ebb;hb=3438c84df5f5a5c4e5a99799d2a8eded3c6dcf12;hpb=86755390622078baf777237e957a81e10fc7d3b4 diff --git a/grml-debootstrap b/grml-debootstrap index 91d319c..4e977fd 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -11,7 +11,7 @@ set -e # exit on any error # variables {{{ PN="$(basename $0)" -VERSION='0.34' +VERSION='0.35' MNTPOINT="/mnt/debootstrap.$$" # inside the chroot system locales might not be available, so use minimum: @@ -57,15 +57,17 @@ Configuration options: /etc/debootstrap/config -d, --confdir Place of config files for debootstrap, defaults to /etc/debootstrap - --packages[=] Install packages defined in specified list file. - --debconf[=] Pre-seed packages using specified pre-seed db file. + --packages Install packages defined in specified list file. + --nopackages Skip installation of packages defined in + /etc/debootstrap/packages + --debconf Pre-seed packages using specified pre-seed db file. --keep_src_list Do not overwrite user provided apt sources.list. --hostname Hostname of Debian system. --password Use specified password as password for user root. --bootappend Add specified appendline to kernel whilst booting. --chroot-scripts Execute chroot scripts from specified directory. - --pre-scripts[=] Execute scripts from specified directory (before chroot-scripts). - --scripts[=] Execute scripts from specified directory (after chroot-scripts). + --pre-scripts Execute scripts from specified directory (before chroot-scripts). + --scripts Execute scripts from specified directory (after chroot-scripts). Other options: @@ -140,6 +142,7 @@ fi [ "$_opt_interactive" ] && INTERACTIVE=1 [ "$_opt_config" ] && CONFIGFILE=$_opt_config [ "$_opt_packages_set" ] && PACKAGES='yes' +[ "$_opt_nopackages" ] && PACKAGES='' [ "$_opt_debconf_set" ] && DEBCONF='yes' [ "$_opt_scripts_set" ] && SCRIPTS='yes' [ "$_opt_pre_scripts_set" ] && PRE_SCRIPTS='yes' @@ -793,6 +796,7 @@ preparechroot() { [ -n "$ROOTPASSWORD" ] && echo "ROOTPASSWORD=$ROOTPASSWORD" >> $CHROOT_VARIABLES [ -n "$TARGET" ] && echo "TARGET=$TARGET" >> $CHROOT_VARIABLES [ -n "$TARGET_UUID" ] && echo "TARGET_UUID=$TARGET_UUID" >> $CHROOT_VARIABLES + [ -n "$RM_APTCACHE" ] && echo "RM_APTCACHE=$RM_APTCACHE" >> $CHROOT_VARIABLES cp $VERBOSE $CONFFILES/chroot-script $MNTPOINT/bin/chroot-script chmod 755 $MNTPOINT/bin/chroot-script @@ -922,18 +926,21 @@ grub_install() { return 0 fi + if ! [ -x "$(which grub-install)" ] ; then + echo "Error: grub-install not available. (Error while installing grub package?)" + return 1 + fi + if [ -n "$SELECTED_PARTITIONS" ] ; then # using sw-raid for device in $SELECTED_PARTITIONS ; do GRUB="${device%%[0-9]}" einfo "Installing grub on ${GRUB}:" - [ -x /usr/sbin/grub-install ] && GRUBINSTALL="/usr/sbin/grub-install --no-floppy" || GRUBINSTALL="/sbin/grub-install --no-floppy" - $GRUBINSTALL --root-directory="$MNTPOINT" "$GRUB" + grub-install --no-floppy --root-directory="$MNTPOINT" "$GRUB" eend $? done else einfo "Installing grub on ${GRUB}:" - [ -x /usr/sbin/grub-install ] && GRUBINSTALL="/usr/sbin/grub-install --no-floppy" || GRUBINSTALL="/sbin/grub-install --no-floppy" - $GRUBINSTALL --root-directory="$MNTPOINT" "$GRUB" + grub-install --no-floppy --root-directory="$MNTPOINT" "$GRUB" eend $? fi } @@ -987,6 +994,12 @@ done # }}} # finalize {{{ +if [ -n "$ISODIR" ] ; then + einfo "Unmounting Debian image loopback from $MNTPOINT/$ISODIR." + umount "$MNTPOINT/$ISODIR" + eend $? +fi + einfo "Removing ${CHROOT_VARIABLES}" ; rm "$CHROOT_VARIABLES" ; eend $? einfo "Removing ${STAGES}" ; rmdir "$STAGES" ; eend $?