X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=11dd166d978fd87e5117169623198454802077e6;hp=e21481d61dc3e8e33d261c9a10ac8dfd4e601762;hb=f4a3b6cf30d373a4ef0425b48be2d314a1db7019;hpb=b6bdf6d754ebe00b9e3472f1a3e9668d7538ae42 diff --git a/autoconfig.functions b/autoconfig.functions index e21481d..11dd166 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Klaus Knopper , (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Son Apr 15 12:20:14 CEST 2007 [mika] +# Latest change: Mon Apr 16 19:32:25 CEST 2007 [mika] ################################################################################ # {{{ path, variables, signals, umask, zsh @@ -1065,7 +1065,7 @@ if [ -z "$INSTALLED" ] ; then *) continue ;; # *) NONEFOUND='1'; continue ;; esac - + # use a swapfile if [ -z "$NOSWAP" ] ; then mount -o "$MOUNTOPTS" -t $f $p $m 2>>$DEBUG || continue @@ -1083,7 +1083,7 @@ if [ -z "$INSTALLED" ] ; then fi mount -o remount,ro $m 2>>$DEBUG && MOUNTED=1 fi - + # use a image as home IMAGE="$(/bin/ls -1d $m/[Gg][Rr][Mm][Ll].[Ii][Mm][Gg] 2>/dev/null)" if [ -z "$GRML_IMG" -a -n "$IMAGE" -a -f "$IMAGE" ]; then @@ -1098,10 +1098,10 @@ if [ -z "$INSTALLED" ] ; then fi fi eend 0 - + # Umount, if not in use [ -n "$MOUNTED" ] && umount -r $m 2>/dev/null - + done <> /etc/inittab fi @@ -2098,49 +2096,132 @@ fi # {{{ grml2hd: automatic installation config_grml2hd(){ +if stringinstring "BOOT_IMAGE=grml2hd " "$CMDLINE" ; then + if checkbootparam "user" ; then - NEWUSER='' - NEWUSER="$(getbootparam 'user' 2>>$DEBUG)" - sed -i "s/^NEWUSER=.*/NEWUSER=$NEWUSER/" /etc/grml2hd/config || export GRML2HD_FAIL=1 + NEWUSER='' + NEWUSER="$(getbootparam 'user' 2>>$DEBUG)" + sed -i "s/^NEWUSER=.*/NEWUSER=$NEWUSER/" /etc/grml2hd/config || export GRML2HD_FAIL=1 fi if checkbootparam "filesystem" ; then - FILESYSTEM='' - FILESYSTEM="$(getbootparam 'filesystem' 2>>$DEBUG)" - sed -i "s/^FILESYSTEM=.*/FILESYSTEM=$FILESYSTEM/" /etc/grml2hd/config || export GRML2HD_FAIL=1 + FILESYSTEM='' + FILESYSTEM="$(getbootparam 'filesystem' 2>>$DEBUG)" + sed -i "s/^FILESYSTEM=.*/FILESYSTEM=$FILESYSTEM/" /etc/grml2hd/config || export GRML2HD_FAIL=1 fi if checkbootparam "partition" ; then - PARTITION='' - PARTITION="$(getbootparam 'partition' 2>>$DEBUG)" - # notice: the following checks whether the given partition is available, if not the skip - # execution of grml2hd as it might result in data loss... - if [ -r $PARTITION ] ; then - sed -i "s#^PARTITION=.*#PARTITION=$PARTITION#" /etc/grml2hd/config || export GRML2HD_FAIL=1 - else - ewarn "Partition $PARTITION does not exist. Skipping execution of grml2hd therefore." ; eend 1 - fi + PARTITION='' + PARTITION="$(getbootparam 'partition' 2>>$DEBUG)" + # notice: the following checks whether the given partition is available, if not the skip + # execution of grml2hd as it might result in data loss... + if [ -r $PARTITION ] ; then + sed -i "s#^PARTITION=.*#PARTITION=$PARTITION#" /etc/grml2hd/config || export GRML2HD_FAIL=1 + else + ewarn "Partition $PARTITION does not exist. Skipping execution of grml2hd therefore." ; eend 1 + fi fi if checkbootparam "mbr" ; then - BOOT_PARTITION='' - BOOT_PARTITION="$(getbootparam 'mbr' 2>>$DEBUG)" - sed -i "s#^BOOT_PARTITION=.*#BOOT_PARTITION=$BOOT_PARTITION#" /etc/grml2hd/config || export GRML2HD_FAIL=1 + BOOT_PARTITION='' + BOOT_PARTITION="$(getbootparam 'mbr' 2>>$DEBUG)" + sed -i "s#^BOOT_PARTITION=.*#BOOT_PARTITION=$BOOT_PARTITION#" /etc/grml2hd/config || export GRML2HD_FAIL=1 fi -if stringinstring "BOOT_IMAGE=grml2hd " "$CMDLINE" ; then - cat>|/usr/bin/grml2hd_noninteractive<|/usr/bin/grml2hd_noninteractive<|/usr/bin/grml-debootstrap_noninteractive<