From 3aba21d977e933e819e2a8d57dd485ab6dd419a9 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 6 Oct 2017 17:14:44 +0200 Subject: [PATCH] rootfsinstall: support for multiple additional archives (-a) and for qemu static file as used in other distributions --- src/rootfsinstall.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/rootfsinstall.sh b/src/rootfsinstall.sh index f522f6e..1cd31c5 100755 --- a/src/rootfsinstall.sh +++ b/src/rootfsinstall.sh @@ -63,6 +63,7 @@ while [ "$1" ]; do exit 1 } ADDITIONALARCHIVE=`realpath $2` + ADDITIONALARCHIVES[${#ADDITIONALARCHIVES[*]}]="${ADDITIONALARCHIVE}" [ -r "$ADDITIONALARCHIVE" ] || { echo "Error: file $ADDITIONALARCHIVE not found; aborting." exit 1 @@ -329,7 +330,7 @@ fi mount -o bind /$b $ROOTMP/$b done - if [ "$ADDITIONALARCHIVE" ]; then + for ADDITIONALARCHIVE in ${ADDITIONALARCHIVES[*]}; do echo "Uncompressing $ADDITIONALARCHIVE..." echo -n "This can take a while, please wait..." tar xf $ADDITIONALARCHIVE || { @@ -338,12 +339,17 @@ fi exit 1 } echo "DONE" - fi + done ) [ $? -eq 0 ] || exit $? -[ -e /usr/bin/qemu-${TARGET_ARCH}.static ] && cp /usr/bin/qemu-${TARGET_ARCH}.static $ROOTMP/usr/bin/qemu-${TARGET_ARCH} +for f in qemu-${TARGET_ARCH}.static qemu-${TARGET_ARCH}-static; do + if [ -e /usr/bin/${f} ]; then + cp /usr/bin/${f} $ROOTMP/usr/bin/qemu-${TARGET_ARCH} + break + fi +done if [ "$ROOTPASSWORD" ]; then echo "$ROOTPASSWORD" | chroot $ROOTMP passwd root --stdin || {