From 269ea83c30e08ac2f82cea67b5d6ac065a67cbef Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 23 Sep 2007 14:46:26 +0200 Subject: Adding casper 1.77+debian-1. --- bin/casper-preseed | 6 ++++-- bin/casper-snapshot | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/casper-preseed b/bin/casper-preseed index 6967fe2..c0c76eb 100755 --- a/bin/casper-preseed +++ b/bin/casper-preseed @@ -5,12 +5,14 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin root="$1" question="$2" value="$3" +seen="$4" +[ "$seen" ] || seen=true -if ! (echo "SET $question $value"; echo "FSET $question seen true") | chroot "$1" debconf-communicate -fnoninteractive casper >/dev/null; then +if ! (echo "SET $question $value"; echo "FSET $question seen $seen") | chroot "$1" debconf-communicate -fnoninteractive casper >/dev/null; then chroot "$1" debconf-communicate -fnoninteractive casper >/dev/null < /tmp/exclude_list + ( cd "${COW}" && find . -name '*.wh.*' >> /tmp/exclude_list ) + mksquashfs "${COW}" "${DEST}" -ef /tmp/exclude_list || exit 1 + rm /tmp/exclude_list ;; cpio) - (cd "${COW}" && find . | cpio --quiet -o -H newc | gzip -9 > "${DEST}") || exit 1 + ( cd "${COW}" && find . -path '*.wh.*' -prune -o -print0 | cpio --quiet -o0 -H newc | gzip -9c > "${DEST}" ) || exit 1 ;; ext2) DU_DIM="`du -ks ${COW} | cut -f1`" @@ -157,7 +160,8 @@ Is_same_mount () Parse_args () { # Parse command line - ARGUMENTS="`getopt --longoptions cow:,destination:,output:,type:,help,usage,version --name=${PROGRAM} --options c:d:o:t:,h,u,v --shell sh -- ${@}`" + ARGS="${1}" + ARGUMENTS="`getopt --longoptions cow:,destination:,output:,type:,help,usage,version --name=${PROGRAM} --options c:d:o:t:,h,u,v --shell sh -- ${ARGS}`" if [ "${?}" != "0" ]; then echo "Terminating." >&2 @@ -201,7 +205,7 @@ Defaults () COW="${SNAP_COW}" fi if [ ! -d "${COW}" ]; then - Usage "Error: ${COW} is not a directory\nMaybe you booted with \"hide-cow\" as kernel parameter?" + Usage "Error: ${COW} is not a directory" fi case "${SNAP_TYPE}" in @@ -214,6 +218,10 @@ Defaults () Usage "Error: unrecognized snapshot type" ;; esac + + #if [ -d + #if Is_same_mount + } Main () -- cgit v1.2.3