+ if [ -d ${DCSDIR}/scripts ] && [ -z "$SCRIPTS" ]; then
+ SCRIPTS="$(cd ${DCSDIR}/scripts; /bin/ls -1d [Gg][Rr][Mm][Ll].[Ss][Hh] 2>>$DEBUG)"
+ fi
+ if ! echo $SCRIPTS | grep -q '/'; then
+ # backwards compatibility: if no path is given get scripts from scripts/
+ SCRIPTS="scripts/$SCRIPTS"
+ fi
+ if [ "$DCSMP" = "/mnt/grmlcfg" ]; then
+ # we are executing from a GRMLCFG labeled fs
+ # kick everything we have done before and start over
+ SCRIPTS="$(cd ${DCSDIR}; /bin/ls -1d [Gg][Rr][Mm][Ll].[Ss][Hh] 2>>$DEBUG)"
+ fi
+ if [ -n "$SCRIPTS" ]; then
+ SCRIPTS="${DCSDIR}/$SCRIPTS"
+ if [ "$DCSMP" = "/mnt/grmlcfg" ]; then
+ einfo "Trying to execute ${SCRIPTS}"
+ sh -c $SCRIPTS
+ elif [ -d "$SCRIPTS" ]; then
+ einfo "Bootparameter scripts found. Trying to execute from directory ${SCRIPTS}:"
+ run-parts $SCRIPTS
+ else
+ einfo "Bootparameter scripts found. Trying to execute ${SCRIPTS}:"
+ sh -c $SCRIPTS
+ fi
+ fi
+fi
+}
+
+config_config(){
+if checkbootparam 'config' || [ "$DCSMP" = "/mnt/grmlcfg" ]; then
+ CONFIG="$(getbootparam 'config' 2>>$DEBUG)"
+ if [ -z "$CONFIG" ]; then
+ CONFIG="$(cd ${DCSDIR}; ls -1d [Cc][Oo][Nn][Ff][Ii][Gg].[Tt][Bb][Zz] 2>>$DEBUG)"
+ fi
+ if [ -n "$CONFIG" ]; then
+ if [ -d "${DCSDIR}/${CONFIG}" ] ; then
+ einfo "Taking configuration from directory ${DCSDIR}/${CONFIG}"
+
+ cp -a ${DCSDIR}/${CONFIG}/* /
+ elif [ -f "${DCSDIR}/${CONFIG}" ]; then
+ einfo "Extracting configuration from file ${DCSDIR}/${CONFIG}"
+
+ cd /
+ unp ${DCSDIR}/${CONFIG} $EXTRACTOPTIONS ; eend $?
+ else
+ ewarn "Sorry, could not find configuration file or directory ${DCSDIR}/${FILENAME}." ; eend 1
+ fi
+ fi