rootfsinstall: support for multiple additional archives (-a) and for qemu static file as used in other distributions

This commit is contained in:
Silvan Calarco 2017-10-06 17:14:44 +02:00
parent c62ab88a37
commit 3aba21d977

View File

@ -63,6 +63,7 @@ while [ "$1" ]; do
exit 1 exit 1
} }
ADDITIONALARCHIVE=`realpath $2` ADDITIONALARCHIVE=`realpath $2`
ADDITIONALARCHIVES[${#ADDITIONALARCHIVES[*]}]="${ADDITIONALARCHIVE}"
[ -r "$ADDITIONALARCHIVE" ] || { [ -r "$ADDITIONALARCHIVE" ] || {
echo "Error: file $ADDITIONALARCHIVE not found; aborting." echo "Error: file $ADDITIONALARCHIVE not found; aborting."
exit 1 exit 1
@ -329,7 +330,7 @@ fi
mount -o bind /$b $ROOTMP/$b mount -o bind /$b $ROOTMP/$b
done done
if [ "$ADDITIONALARCHIVE" ]; then for ADDITIONALARCHIVE in ${ADDITIONALARCHIVES[*]}; do
echo "Uncompressing $ADDITIONALARCHIVE..." echo "Uncompressing $ADDITIONALARCHIVE..."
echo -n "This can take a while, please wait..." echo -n "This can take a while, please wait..."
tar xf $ADDITIONALARCHIVE || { tar xf $ADDITIONALARCHIVE || {
@ -338,12 +339,17 @@ fi
exit 1 exit 1
} }
echo "DONE" echo "DONE"
fi done
) )
[ $? -eq 0 ] || exit $? [ $? -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 if [ "$ROOTPASSWORD" ]; then
echo "$ROOTPASSWORD" | chroot $ROOTMP passwd root --stdin || { echo "$ROOTPASSWORD" | chroot $ROOTMP passwd root --stdin || {