build.sh: --arch can no longer be specified multiple times

Simplify logic in build.sh by dropping support for building multiple
architectures in a single call.
debian-cd
Raphaël Hertzog 6 years ago
parent a6931f0fef
commit c03076b68c

@ -83,7 +83,7 @@ while true; do
case "$1" in case "$1" in
-d|--distribution) KALI_DIST="$2"; shift 2; ;; -d|--distribution) KALI_DIST="$2"; shift 2; ;;
-p|--proposed-updates) OPT_pu="1"; shift 1; ;; -p|--proposed-updates) OPT_pu="1"; shift 1; ;;
-a|--arch) KALI_ARCHES="${KALI_ARCHES:+$KALI_ARCHES } $2"; shift 2; ;; -a|--arch) KALI_ARCH="$2"; shift 2; ;;
-v|--verbose) VERBOSE="1"; shift 1; ;; -v|--verbose) VERBOSE="1"; shift 1; ;;
-s|--salt) shift; ;; -s|--salt) shift; ;;
--variant) KALI_VARIANT="$2"; shift 2; ;; --variant) KALI_VARIANT="$2"; shift 2; ;;
@ -96,25 +96,22 @@ while true; do
done done
# Set default values # Set default values
KALI_ARCHES=${KALI_ARCHES:-$HOST_ARCH} KALI_ARCH=${KALI_ARCH:-$HOST_ARCH}
if [ -z "$KALI_VERSION" ]; then if [ -z "$KALI_VERSION" ]; then
KALI_VERSION="$(default_version $KALI_DIST)" KALI_VERSION="$(default_version $KALI_DIST)"
fi fi
# Check parameters # Check parameters
for arch in $KALI_ARCHES; do if [ "$HOST_ARCH" != "$KALI_ARCH" ]; then
if [ "$arch" = "$HOST_ARCH" ]; then case "$HOST_ARCH/$KALI_ARCH" in
continue
fi
case "$HOST_ARCH/$arch" in
amd64/i386|i386/amd64) amd64/i386|i386/amd64)
;; ;;
*) *)
echo "Can't build $arch image on $HOST_ARCH system." >&2 echo "Can't build $KALI_ARCH image on $HOST_ARCH system." >&2
exit 1 exit 1
;; ;;
esac esac
done fi
if [ ! -d "$(dirname $0)/kali-config/variant-$KALI_VARIANT" ]; then if [ ! -d "$(dirname $0)/kali-config/variant-$KALI_VARIANT" ]; then
echo "ERROR: Unknown variant of Kali configuration: $KALI_VARIANT" >&2 echo "ERROR: Unknown variant of Kali configuration: $KALI_VARIANT" >&2
fi fi
@ -159,16 +156,13 @@ else
fi fi
if [ "$ACTION" = "get-image-path" ]; then if [ "$ACTION" = "get-image-path" ]; then
for KALI_ARCH in $KALI_ARCHES; do
echo $(target_image_name $KALI_ARCH) echo $(target_image_name $KALI_ARCH)
done
exit 0 exit 0
fi fi
cd $(dirname $0) cd $(dirname $0)
mkdir -p $TARGET_DIR/$TARGET_SUBDIR mkdir -p $TARGET_DIR/$TARGET_SUBDIR
for KALI_ARCH in $KALI_ARCHES; do
IMAGE_NAME="$(image_name $KALI_ARCH)" IMAGE_NAME="$(image_name $KALI_ARCH)"
set +e set +e
: > build.log : > build.log
@ -183,4 +177,3 @@ for KALI_ARCH in $KALI_ARCHES; do
set -e set -e
mv -f $IMAGE_NAME $TARGET_DIR/$(target_image_name $KALI_ARCH) mv -f $IMAGE_NAME $TARGET_DIR/$(target_image_name $KALI_ARCH)
mv -f build.log $TARGET_DIR/$(target_build_log $KALI_ARCH) mv -f build.log $TARGET_DIR/$(target_build_log $KALI_ARCH)
done

Loading…
Cancel
Save