-config_unpack(){
-MOUNTDEVICE="$1"
-MESSAGE="$2"
-
-if [ ! -b "$MOUNTDEVICE" ] ; then
- return;
-fi
-
-
-[ -d /mnt/grml ] || mkdir /mnt/grml
-umount /mnt/grml 1>>$DEBUG 2>&1 # make sure it is not mounted
-mount -o ro -t auto $MOUNTDEVICE /mnt/grml ; RC="$?"
-if [[ $RC == 0 ]]; then
- einfo "Successfully mounted $MOUNTDEVICE $MESSAGE to /mnt/grml (readonly)." ; eend 0
- eindent
- CONFIG=''
- CONFIG="$(/bin/ls -1d /mnt/grml/[Cc][Oo][Nn][Ff][Ii][Gg].[Tt][Bb][Zz] 2>>$DEBUG)"
- if checkbootparam config ; then
- FILENAME="$(getbootparam 'config' 2>>$DEBUG)"
- if [ -e /mnt/grml/"${FILENAME}" ] ; then
- einfo "Using /mnt/grml/$FILENAME instead of config.tbz"
- CONFIG="/mnt/grml/${FILENAME}"
- fi
- else
- FILENAME="$(basename $CONFIG)"
- fi
- if [ -n "$CONFIG" ]; then
- einfo "Found file ${WHITE}${CONFIG}${NORMAL} - trying to extract it."
- cd /
- unp $CONFIG $EXTRACTOPTIONS ; eend $?
- else
- ewarn "Sorry, could not find file ${FILENAME} on device ${MOUNTDEVICE} ${MESSAGE}." ; eend 1
- fi
-
- SCRIPT=''
- SCRIPT="$(/bin/ls -1d /mnt/grml/[Gg][Rr][Mm][Ll].[Ss][Hh] 2>>$DEBUG)"
- if [ -n "$SCRIPT" ]; then
- einfo "Found script ${WHITE}${SCRIPT}${NORMAL} - trying to execute it."
- $SCRIPT ; eend $?
- fi
- eoutdent
- else
- einfo "Could not mount $MOUNTDEVICE to /mnt/grml - sorry." ; eend 1
-fi # mount $MOUNTDEVICE
-
-grep -q '/mnt/grml' /proc/mounts && umount /mnt/grml
-
-}
-
-config_automount(){
-if checkbootparam noautoconfig || checkbootparam forensic ; then
+config_finddcsdir() {
+# - If no GRMLCFG partition is found and noautoconfig is _not_ given
+# on the command line, nothing is changed and the dcs files are
+# searched within the .iso, $dcs-dir is set to the root directory
+# within the .iso
+# - If a GRMLCFG partition is found, $dcs-dir is set to the root of
+# the GRMLCFG partition unless noautoconfig is set. If noautoconfig is
+# set, $dcs-dir is set to the root directory within the .iso.
+# - If myconfig=foo is set on the command line, $dcs-dir is set to
+# foo, even if a GRMLCFG partition is present.
+DCSDIR=""
+DCSMP="/mnt/grml"
+if checkbootparam 'noautoconfig' || checkbootparam 'forensic' ; then