From 21c949870d2f60582cd18351db77f9ca5a827b28 Mon Sep 17 00:00:00 2001 From: josch Date: Wed, 22 Jun 2011 10:38:04 +0200 Subject: [PATCH] make PLATFORM/root and PLATFORM/hooks optional --- polystrap.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/polystrap.sh b/polystrap.sh index 774804b..5ccee59 100755 --- a/polystrap.sh +++ b/polystrap.sh @@ -55,8 +55,6 @@ PLATFORM="$1" [ ! -r "$PLATFORM" ] && { echo "cannot find target directory: $PLATFORM"; exit; } [ ! -r "$PLATFORM/multistrap.conf" ] && { echo "cannot read multistrap config: $PLATFORM/multistrap.conf"; exit; } -[ ! -r "$PLATFORM/hooks" ] && { echo "cannot read hooks directory: $PLATFORM/hooks"; exit; } -[ ! -r "$PLATFORM/root" ] && { echo "cannot read root directory: $PLATFORM/root"; exit; } # source default options . "default/config" @@ -108,7 +106,9 @@ mv $ROOTDIR/sbin/ldconfig $ROOTDIR/sbin/ldconfig.REAL mv $ROOTDIR/usr/bin/ldd $ROOTDIR/usr/bin/ldd.REAL # copy initial directory tree - dereference symlinks -cp --recursive --dereference $PLATFORM/root/* $ROOTDIR/ +if [ -r "$PLATFORM/root" ]; then + cp --recursive --dereference $PLATFORM/root/* $ROOTDIR/ +fi # copy qemu usermode binary if [ $ARCH != "`dpkg --print-architecture`" ]; then @@ -140,9 +140,11 @@ done fakechroot chroot $ROOTDIR /usr/bin/dpkg --configure -a || fakechroot chroot $ROOTDIR /usr/bin/dpkg --configure -a # source hooks -for f in $PLATFORM/hooks/*; do - . $f -done +if [ -r "$PLATFORM/hooks" ]; then + for f in $PLATFORM/hooks/*; do + . $f + done +fi #cleanup rm $ROOTDIR/sbin/ldconfig $ROOTDIR/usr/bin/ldd