make PLATFORM/root and PLATFORM/hooks optional
This commit is contained in:
parent
36073d0c9a
commit
21c949870d
1 changed files with 8 additions and 6 deletions
12
polystrap.sh
12
polystrap.sh
|
@ -55,8 +55,6 @@ PLATFORM="$1"
|
||||||
|
|
||||||
[ ! -r "$PLATFORM" ] && { echo "cannot find target directory: $PLATFORM"; exit; }
|
[ ! -r "$PLATFORM" ] && { echo "cannot find target directory: $PLATFORM"; exit; }
|
||||||
[ ! -r "$PLATFORM/multistrap.conf" ] && { echo "cannot read multistrap config: $PLATFORM/multistrap.conf"; 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
|
# source default options
|
||||||
. "default/config"
|
. "default/config"
|
||||||
|
@ -108,7 +106,9 @@ mv $ROOTDIR/sbin/ldconfig $ROOTDIR/sbin/ldconfig.REAL
|
||||||
mv $ROOTDIR/usr/bin/ldd $ROOTDIR/usr/bin/ldd.REAL
|
mv $ROOTDIR/usr/bin/ldd $ROOTDIR/usr/bin/ldd.REAL
|
||||||
|
|
||||||
# copy initial directory tree - dereference symlinks
|
# 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
|
# copy qemu usermode binary
|
||||||
if [ $ARCH != "`dpkg --print-architecture`" ]; then
|
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
|
fakechroot chroot $ROOTDIR /usr/bin/dpkg --configure -a || fakechroot chroot $ROOTDIR /usr/bin/dpkg --configure -a
|
||||||
|
|
||||||
# source hooks
|
# source hooks
|
||||||
for f in $PLATFORM/hooks/*; do
|
if [ -r "$PLATFORM/hooks" ]; then
|
||||||
|
for f in $PLATFORM/hooks/*; do
|
||||||
. $f
|
. $f
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
#cleanup
|
#cleanup
|
||||||
rm $ROOTDIR/sbin/ldconfig $ROOTDIR/usr/bin/ldd
|
rm $ROOTDIR/sbin/ldconfig $ROOTDIR/usr/bin/ldd
|
||||||
|
|
Loading…
Reference in a new issue