X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=6909dccd90dfc78db59e452b1126763a262effb8;hp=cf78d9dcda184c0143814f8b575f902b89374e84;hb=a2e2000fcd69f229f7cd832bcffa83992e5c75a8;hpb=826d06efd0e5eb03da7d5d321e995aa54dffd6e2 diff --git a/autoconfig.functions b/autoconfig.functions index cf78d9d..6909dcc 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: Sam Mai 12 00:46:15 CEST 2007 [mika] ################################################################################ # {{{ path, variables, signals, umask, zsh @@ -1046,8 +1046,12 @@ if [ -z "$INSTALLED" ] ; then if grep -q $p /proc/swaps ; then ewarn "Not using swap partition ${WHITE}${p}${NORMAL} as it is already in use." ; eend 0 else + if [ -b "$p" ] ; then einfo "Using swap partition ${WHITE}${p}${NORMAL}." swapon $p 2>>$DEBUG ; eend $? + else + ewarn "$p is not a valid block device - not using it therefore." ; eend 0 + fi fi ;; esac # dd-check @@ -1065,17 +1069,19 @@ 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 + mount -o "$MOUNTOPTS" -t $f $p $m 2>>$DEBUG && MOUNTED=1 || continue # Activate swapfile, if exists SWAPFILE="$(/bin/ls -1d $m/[Gg][Rr][Mm][Ll].[Ss][Ww][Pp] 2>/dev/null)" fi if [ -z "$NOSWAP" -a -n "$SWAPFILE" -a -f "$SWAPFILE" ]; then mount -o remount,rw $m && MOUNTED=1 if swapon "$SWAPFILE" 2>>$DEBUG ; then - einfo "Using GRML swapfile ${SWAPFILE}." + eindent + einfo "Using GRML swapfile ${WHITE}${SWAPFILE}${NORMAL}." + eoutdent fnew="$SWAPFILE swap swap defaults 0 0" stringinfile "$fnew" "/etc/fstab" || echo "$fnew" >> /etc/fstab GRML_SWP="$GRML_SWP $SWAPFILE" @@ -1083,7 +1089,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 +1104,10 @@ if [ -z "$INSTALLED" ] ; then fi fi eend 0 - + # Umount, if not in use [ -n "$MOUNTED" ] && umount -r $m 2>/dev/null - + done <|/usr/bin/grml2hd_noninteractive<|/usr/bin/grml2hd_noninteractive<|/usr/bin/grml-debootstrap_noninteractive<