--- etc/default/lu.orig Sun Dec 14 20:58:04 2008 +++ etc/default/lu Sat Jan 3 22:21:46 2009 @@ -42,6 +42,18 @@ LU_SYNC_FILES=YES export LU_SYNC_FILES +# If this file exists, it contains one regular expression per line to filter +# out those filesystems, which should be ignored by lumount and friends - +# see egrep(1). +# Usually it is used like 'mount -p | /usr/bin/egrep -v -f $LU_FS2IGNORE' or +# 'zfs list | /usr/bin/egrep -v -f $LU_FS2IGNORE'. 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!!! +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/lulib.orig Fri Sep 25 15:01:34 2009 +++ usr/lib/lu/lulib Sun Oct 25 21:11:36 2009 @@ -117,6 +117,7 @@ LU_SYNCLIST="${LU_SYNCLIST:=/etc/lu/synclist}" ; export LU_SYNCLIST LU_SYNC_LOG_FILE="${LU_SYNC_LOG_FILE:=/etc/lu/sync.log}" ; export LU_SYNC_LOG_FILE SYNCKEY="${SYNCKEY:=/etc/lu/.SYNCKEY}" +LU_FS2IGNORE="${LU_FS2IGNORE:=/etc/lu/fs2ignore.regex}" # # variables used for Newboot aka GRUB boot @@ -205,6 +206,24 @@ fi ################################################################################ +# Name: lulib_get_fs2ignore +# Description: Check, whether LU_FS2IGNORE exists. If not, it creates one so +# that it can be used safely. +# Arguments: none +# Returns: +# The filename with one egrep(1) regex per line to be used. +################################################################################ +lulib_get_fs2ignore() { + if [ -s ${LU_FS2IGNORE} ]; then + echo ${LU_FS2IGNORE} + return + fi + RE_TMP=/tmp/.lulib.refsi.$$ + echo '^#' >$RE_TMP + echo $RE_TMP +} + +################################################################################ # This is used to loop over the list of devices in a zpool, using the # output of the 'zpool status' command # ARGS @@ -227,27 +246,29 @@ lgzd_pool="$1" lgzd_first="$2" - blob=`/usr/bin/env LC_ALL=C /sbin/zpool status "$lgzd_pool"` + /usr/bin/env LC_ALL=C /sbin/zpool status "$lgzd_pool" | \ + /bin/nawk -v FIRST="$lgzd_first" '/NAME/ { + FOUND=1 ; getline ; getline + while ( $0 != "" ) { + if ( $1 !~ /^mirror/ ) { + if ( $1 ~ /^c/ ) { + print "/dev/dsk/" $1 + } else { + print $1 + } + if (FIRST == "yes" ) exit 0 + } + getline + } + exit 0 + } + END { if (FOUND != 1) exit 1 }' + if [ "$?" -ne 0 ]; then ${LUPRINTF} -Eelp2 "`gettext 'zpool status command failed for pool <%s>'`" "$lgzd_pool" return 1 fi - start=`echo "$blob" | /usr/bin/grep -n "$lgzd_pool" | head -2 | tail +2 | cut -d: -f1` - start=`expr $start + 1` - echo "$blob" | tail +$start | awk '{print $1}' | while read dev; do - if [ -z "$dev" ]; then - continue; - elif [ "$dev" = "errors:" ]; then - break - elif [ "$dev" != "mirror" ]; then - echo "$dev" | sed 's+^c+/dev/dsk/c+' - if [ "$lgzd_first" = yes ]; then - break - fi - fi - done - return 0 } --- usr/lib/lu/ludefine.orig Thu Nov 13 17:49:34 2008 +++ usr/lib/lu/ludefine Sat Jan 3 22:21:46 2009 @@ -340,7 +340,7 @@ zoneadm -R "$BE_ROOT" list -cp | grep -v :global: | awk -F: '{print $4}' > /tmp/.ludef.excl.$$ # Capture the root zfs file system information. -mount -p | +mount -p | /usr/bin/egrep -v -f `lulib_get_fs2ignore` | /bin/nawk -v R="^$BE_ROOT" '$3 ~ R { if ($4 == "zfs") { print } }' | while read line do --- usr/lib/lu/lumk_iconf.orig Tue Mar 3 14:15:45 2009 +++ usr/lib/lu/lumk_iconf Wed Mar 25 06:30:04 2009 @@ -726,9 +726,8 @@ done >> "$TMP_RESULTS" # Make sure that the ICF file is sorted -sort -u $TMP_RESULTS | - /usr/bin/awk -F: '{print length($2) "\t" $0}' | - /usr/bin/sort -n | /usr/bin/cut -f2- > $TMP_SORTED_RESULTS +/usr/bin/egrep -v -f `lulib_get_fs2ignore` $TMP_RESULTS | sort -u -k 2,2 -t: \ + >$TMP_SORTED_RESULTS # Update the checksums of the ICF file and update the ICF file # ifself if the -F flag was specified. --- usr/lib/lu/luclonefs.orig Tue Mar 3 14:15:44 2009 +++ usr/lib/lu/luclonefs Wed Mar 25 06:32:51 2009 @@ -356,6 +356,7 @@ /sbin/zfs set zpdata:rbe="$ABE_NAME" "$abe_zset" /sbin/zfs set zpdata:zn="$zonename" "$abe_zset" newpath=`/sbin/zfs get -Ho value mountpoint "$abe_zset"` + newpath=`dirname $newpath`/`basename $abe_zset` /sbin/zfs mount "$abe_zset" echo "$ABE_NAME" > "$newpath/lu_moved" if [ -n "$dataset_in_pbe" ]; then