# foo, even if a GRMLCFG partition is present.
DCSDIR=""
DCSMP="/mnt/grml"
+# autoconfig, see issue673
+GRMLCFG="$(getbootparam 'autoconfig' 2>>$DEBUG)"
+[ -n "$GRMLCFG" ] || GRMLCFG="GRMLCFG"
if checkbootparam 'noautoconfig' || checkbootparam 'forensic' ; then
- ewarn "Skipping running automount of device(s) labeled GRMLCFG as requested." ; eend 0
+ ewarn "Skipping running automount of device(s) labeled $GRMLCFG as requested." ; eend 0
else
if [ -z "$INSTALLED" ] ; then
if checkbootparam 'myconfig' ; then
eerror "Error: No device for bootoption myconfig provided." ; eend 1
fi # [ -z "$DCSDEVICE" ]
elif checkvalue $CONFIG_MYCONFIG; then # checkbootparam myconfig
- einfo "Searching for device(s) labeled with GRMLCFG. (Disable this via boot option: noautoconfig)" ; eend 0
+ einfo "Searching for device(s) labeled with $GRMLCFG. (Disable this via boot option: noautoconfig)" ; eend 0
eindent
# We do need the following fix so floppy disk is available to blkid in any case :-/
if [ -r /dev/fd0 ] ; then
blkid /dev/fd0 >>$DEBUG 2>&1
fi
fi
- DCSDEVICE=$(blkid -t LABEL=GRMLCFG | head -1 | awk -F: '{print $1}')
+ DCSDEVICE=$(blkid -t LABEL=$GRMLCFG | head -1 | awk -F: '{print $1}')
if [ -n "$DCSDEVICE" ]; then
DCSMP="/mnt/grmlcfg"
fi
file system labeled GRMLCFG is found, the DCS directory is the root directory of
that file system. Alternatively, the myconfig boot parameter can be used to
directly specify a device which is then taken as DCS directory
-(myconfig=/dev/sda1, for example).
+(myconfig=/dev/sda1, for example). If your device is labeled different to
+GRMLCFG the proper label can be set via the autoconfig boot parameter
+(autoconfig=SOMELABEL, for example).
Without any additional boot parameters, the GCA at DCSDIR/config.tbz is
automatically unpacked and DCSDIR/scrips/grml.sh is automatically executed on
myconfig=/dev/sda1 => read DCS from usb-device
myconfig=/dev/fd0 => read DCS from floppy-disk
+autoconfig::
+
+ This parameter specifies the label used to determine the DCS device.
+ If undefined the label GRMLCFG is used to find the DCS device.
+
+ autoconfig=SOMELABEL => search for device labeled SOMELABEL to use as
+ DCS device.
+
home::
This parameter is for setting a specific partition as home directory. Usage
--- /dev/null
+#!/bin/zsh
+
+EXPECTED_LABEL=''
+TMPNAME=$(mktemp)
+
+export_var() {
+ echo $1=$(eval echo $"$1") >> $TMPNAME
+}
+
+blkid() {
+ echo > "$TMPNAME"
+ while [ -n "$1" ] ; do
+ case "$1" in
+ LABEL*)
+ assertEquals "unexpected label value" "${EXPECTED_LABEL:-GRMLCFG}" "${1/LABEL=/}" >&2
+ export_var __shunit_testSuccess
+ export_var __shunit_assertsFailed
+ export_var __shunit_assertsTotal
+ esac
+ shift
+ done
+}
+
+test_grmlcfg() {
+ CONFIG_MYCONFIG='yes'
+ INSTALLED=""
+
+ EXPECTED_LABEL=''
+ CMDLINE=""
+ config_finddcsdir >/dev/null
+ . "$TMPNAME"
+
+ EXPECTED_LABEL='test1'
+ CMDLINE="autoconfig=$EXPECTED_LABEL"
+ config_finddcsdir >/dev/null
+ . "$TMPNAME"
+}
+
+
+tearDown() {
+ rm "$TMPNAME"
+}
+
+. ./common_tests $0