changeset 1529:90da269bc09c

Minor cleanup and remove hardlinking for chroot-splice: it's slower and uses more disk space but doesn't damage external copy if something goes wrong.
author Rob Landley <rob@landley.net>
date Sun, 10 Jun 2012 20:34:04 -0500
parents 112e6fcbfce4
children 2b3c892dc25e
files more/chroot-splice.sh
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/more/chroot-splice.sh	Sun Jun 10 20:32:15 2012 -0500
+++ b/more/chroot-splice.sh	Sun Jun 10 20:34:04 2012 -0500
@@ -28,28 +28,23 @@
 
 # Zap old stuff (if any)
 
-CHROOT="build/chroot-$1"
+[ -z "$CHROOT" ] && CHROOT="build/chroot-$1"
 trap 'more/zapchroot.sh "$CHROOT"' EXIT
 if [ -e "$CHROOT" ]
 then
   more/zapchroot.sh "$CHROOT" || exit 1
-else
-  # Copy root filesystem and splice in control image
-  cp -la "build/root-filesystem-$1" "$CHROOT" || exit 1
 fi
 
 # Copy root filesystem and splice in control image
-cp -la "build/root-filesystem-$1" "$CHROOT" || exit 1
+cp -a "build/root-filesystem-$1" "$CHROOT" || exit 1
 
 if [ -d "$2" ]
 then
-  rm -rf "$CHROOT/mnt" && cp -la "$2" "$CHROOT/mnt" || exit 1
+  rm -rf "$CHROOT/mnt" && cp -a "$2" "$CHROOT/mnt" || exit 1
 else
   mount -o loop "$2" "$CHROOT/mnt" || exit 1
 fi
 
-# Tar it up
-
 # Output some usage hints
 
 CPUS=1 HOST="$1" chroot "$CHROOT" /sbin/init.sh