diff --git a/auto/config b/auto/config index ce6cb6a..2dda8a0 100755 --- a/auto/config +++ b/auto/config @@ -15,20 +15,30 @@ if [ ! -e /usr/share/live/build/data/debian-cd/kali ]; then exit 1 fi -# Detect target architecture -find_arch() { - while [ -n "$1" ]; do - case "$1" in - -a|--arch|--architecture|--architectures) - echo "$2" - return - ;; - esac - shift - done - dpkg --print-architecture -} -arch=$(find_arch "$@") +public_kali_mirror=http://http.kali.org/kali +public_kalisec_mirror=http://security.kali.org/kali-security + +# Detect target architecture and filter args +temp="" +while [ $# -gt 0 ]; do + arg="$1" + case "$arg" in + -a|--arch|--architecture|--architectures) + arch="$2" + temp="$temp "'"'"$arg"'"' + temp="$temp "'"'"$2"'"' + shift + ;; + --proposed-updates) + enable_pu="1" + ;; + *) + temp="$temp "'"'"$arg"'"' + ;; + esac + shift +done +eval set -- "$temp" case "$arch" in amd64) @@ -46,8 +56,14 @@ case "$arch" in ;; esac -public_kali_mirror=http://http.kali.org/kali -public_kalisec_mirror=http://security.kali.org/kali-security +rm -f config/archives/kali-proposed-updates.list.* +if [ -n "$enable_pu" ]; then + mkdir -p config/archives + echo "deb $kali_mirror kali-proposed-updates main contrib non-free" \ + > config/archives/kali-proposed-updates.list.chroot + echo "deb $kali_public_mirror kali-proposed-updates main contrib non-free" \ + > config/archives/kali-proposed-updates.list.binary +fi lb config noauto \ --distribution "kali" \ diff --git a/build_all.sh b/build_all.sh index 8976065..7767aa4 100755 --- a/build_all.sh +++ b/build_all.sh @@ -22,11 +22,12 @@ case "$HOST_ARCH" in esac # Parsing command line options -temp=$(getopt -o s -l single -- "$@") +temp=$(getopt -o sp -l single,proposed-updates -- "$@") eval set -- "$temp" while true; do case "$1" in -s|--single) OPT_single="1"; shift 1; ;; + -p|--proposed-updates) OPT_pu="1"; shift 1; ;; --) shift; break; ;; *) echo "ERROR: Invalid command-line option: $1" >&2; exit 1; ;; esac @@ -37,6 +38,11 @@ if [ -n "$OPT_single" ]; then KALI_ARCHES="$HOST_ARCH" fi +if [ -n "$OPT_pu" ]; then + echo "Integrating proposed-updates in the image" + KALI_CONFIG_OPTS="-- --proposed-updates" +fi + # Set sane PATH (cron seems to lack /sbin/ dirs) export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" @@ -55,7 +61,7 @@ mkdir -p $TARGET_DIR for KALI_ARCH in $KALI_ARCHES; do lb clean --purge >prepare.log 2>&1 - lb config -a $KALI_ARCH >>prepare.log 2>&1 + lb config -a $KALI_ARCH $KALI_CONFIG_OPTS >>prepare.log 2>&1 lb build >/dev/null if [ $? -ne 0 ] || [ ! -e $IMAGE_NAME ]; then echo "Build of $KALI_ARCH live image failed" >&2