--- etc/default/lu.orig Sat Jul 26 05:13:16 2008 +++ etc/default/lu Sun Oct 3 05:59:12 2010 @@ -42,6 +42,28 @@ LU_SYNC_FILES=YES export LU_SYNC_FILES +# LU_FS2IGNORE should point to a file, which contains one regular expression +# per line to filter out those filesystems, which should be ignored by lumount +# and friends. If the given file does not exist, no filtering will be done. +# +# Especially for servers with a lot of filesystems, which have usually no +# meaning for the LiveUpgrade process itself (e.g. /export/home), this speeds +# up LU tremendously. However, if not used with care, it may also prevent LU +# from working properly and may damage the system!!! +# +# ludefine output gets filtered through '/usr/bin/egrep -v "$LU_FS2IGNORE"', +# whereby the output contains all relevant filesystem information in the format: +# $BE_NAME:$mountpoint:$zfsnameORdevice_name:$fstype:$size +# +# To check, whether all required filesystems are available, none relevant fs +# are excluded, one may invoke ludefine manually (i.e. without making any +# changes on the system): +# pfexec /sbin/sh /usr/lib/lu/ludefine -v /etc/vfstab -n tmpBE +# or check an existing ICF file, e.g. +# egrep -v -f "$LU_FS2IGNORE" /etc/lu/ICF.1 +LU_FS2IGNORE=/etc/lu/fs2ignore.regex +export LU_FS2IGNORE + # The LU_DEBUG option sets the debug level for Live Upgrade. If set to 0, # no debug output is produced. If set to a value from 1 to 10, various levels of # debug information is output to standard error. The higher the level, the --- usr/lib/lu/ludefine.orig Wed Jul 14 08:03:26 2010 +++ usr/lib/lu/ludefine Sun Oct 3 08:20:01 2010 @@ -346,7 +346,8 @@ xargs /sbin/zfs get -Ho value canmount < $INC | grep -v noauto > /dev/null 2>&1 if [ $? = 0 ]; then - ${LUPRINTF} -Eelp2 "`gettext 'All datasets within a BE must have the canmount value set to noauto'`" + ${LUPRINTF} -Eelp2 "`gettext 'All datasets within a BE must have the canmount value set to noauto'`: " + ${LUPRINTF} -Eelp2 "`xargs /sbin/zfs get -Ho name,value canmount < $INC | grep -v noauto`" exit 1 fi fi @@ -443,12 +444,21 @@ ) >> $TMPFILE fi fi + +LU_FS2IGNORE="${LU_FS2IGNORE:=/etc/lu/fs2ignore.regex}" + if [ "$oflag" = "0" ] ; then - /usr/bin/sort -u "$TMPFILE" | /usr/bin/awk -F: '{print length($2) "\t" $0}' | - /usr/bin/sort -n | /usr/bin/cut -f2- + if [ -r "$LU_FS2IGNORE" ]; then + /usr/bin/sort -u -k 2,2 -t: "$TMPFILE" | /usr/bin/egrep -v -f "$LU_FS2IGNORE" + else + /usr/bin/sort -u -k 2,2 -t: "$TMPFILE" + fi else - /usr/bin/sort -u "$TMPFILE" | /usr/bin/awk -F: '{print length($2) "\t" $0}' | - /usr/bin/sort -n | /usr/bin/cut -f2- > $OUTPUTFILE + if [ -r "$LU_FS2IGNORE" ]; then + /usr/bin/sort -u -k 2,2 -t: "$TMPFILE" | /usr/bin/egrep -v -f "$LU_FS2IGNORE" > $OUTPUTFILE + else + /usr/bin/sort -u -k 2,2 -t: "$TMPFILE" > $OUTPUTFILE + fi fi /bin/rm -f $TMPFILE exit 0