Replace vol_id command with blkid.
[grml-debootstrap.git] / grml-debootstrap
index 7a84794..72ff57d 100755 (executable)
@@ -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:
@@ -58,6 +58,8 @@ Configuration options:
   -d, --confdir <path>     Place of config files for debootstrap, defaults
                              to /etc/debootstrap
       --packages <file>    Install packages defined in specified list file.
+      --nopackages         Skip installation of packages defined in
+                             /etc/debootstrap/packages
       --debconf <file>     Pre-seed packages using specified pre-seed db file.
       --keep_src_list      Do not overwrite user provided apt sources.list.
       --hostname <name>    Hostname of Debian system.
@@ -208,7 +210,7 @@ prompt_for_target()
   fi
 
   PARTITION_LIST=$(for i in $(echo $AVAILABLE_PARTITIONS) ; do
-                       echo "$i $(vol_id --type $i 2>/dev/null || echo [no_filesystem_yet])"
+                       echo "$i $(blkid -s TYPE -o value $i 2>/dev/null || echo [no_filesystem_yet])"
                    done)
 
   TARGET=$(dialog --title "$PN" --single-quoted --stdout \
@@ -389,7 +391,7 @@ AVAILABLE_PARTITIONS=$(LANG=C fdisk -l 2>/dev/null | \
              gawk -v num=0 -v ORS=' ' '/^\/dev\// {print $1}')
 [ -n "$AVAILABLE_PARTITIONS" ] || echo "FIXME: no partitions available?"
 PARTITION_LIST=$(for i in $(echo $AVAILABLE_PARTITIONS) ; do
-                     echo "$i $(vol_id --type $i 2>/dev/null || echo [no_filesystem_yet]) off"
+                     echo "$i $(blkid -s TYPE -o value $i 2>/dev/null || echo [no_filesystem_yet]) off"
                  done)
 
 dialog --title "$PN" --separate-output \
@@ -992,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 $?