Support building kali-dev live images

debian-cd
Raphaël Hertzog 12 years ago
parent a5e29d3e9b
commit e8206f3530

@ -6,21 +6,14 @@ kalisec_mirror=http://archive.kali.org/kali-security
### DO NOT EDIT THE REST OF THIS FILE ### ### DO NOT EDIT THE REST OF THIS FILE ###
# live-build doesn't work if --parent-debian-distribution is unknown of
# debian-cd => we have to put a symlink so that it deals with kali like wheezy
if [ ! -e /usr/share/live/build/data/debian-cd/kali ]; then
echo "ERROR: Run this first"
echo "ln -sf wheezy /usr/share/live/build/data/debian-cd/kali"
exit 1
fi
public_kali_mirror=http://http.kali.org/kali public_kali_mirror=http://http.kali.org/kali
public_kalisec_mirror=http://security.kali.org/kali-security public_kalisec_mirror=http://security.kali.org/kali-security
# Detect target architecture and filter args # Detect target architecture and filter args
temp="" temp=""
arch=$(dpkg --print-architecture) arch=$(dpkg --print-architecture)
dist="kali"
lb_opts=""
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
arg="$1" arg="$1"
case "$arg" in case "$arg" in
@ -33,6 +26,11 @@ while [ $# -gt 0 ]; do
--proposed-updates) --proposed-updates)
enable_pu="1" enable_pu="1"
;; ;;
--kali-dev)
dist="kali-dev"
# No security repo
lb_opts="--security false"
;;
*) *)
temp="$temp "'"'"$arg"'"' temp="$temp "'"'"$arg"'"'
;; ;;
@ -41,19 +39,26 @@ while [ $# -gt 0 ]; do
done done
eval set -- "$temp" eval set -- "$temp"
# live-build doesn't work if --parent-debian-distribution is unknown of
# debian-cd => we have to put a symlink so that it deals with kali like wheezy
if [ ! -e /usr/share/live/build/data/debian-cd/$dist ]; then
echo "ERROR: Run this first"
echo "ln -sf wheezy /usr/share/live/build/data/debian-cd/$dist"
exit 1
fi
case "$arch" in case "$arch" in
amd64) amd64)
lb_opts="--debian-installer live" lb_opts="$lb_opts --debian-installer live"
;; ;;
i386) i386)
lb_opts="--debian-installer live --linux-flavours 686-pae" lb_opts="$lb_opts --debian-installer live --linux-flavours 686-pae"
;; ;;
armel|armhf) armel|armhf)
lb_opts="--binary-images hdd --binary-filesystem ext4 --chroot-filesystem none" lb_opts="$lb_opts --binary-images hdd --binary-filesystem ext4 --chroot-filesystem none"
;; ;;
*) *)
echo "WARNING: configuration not tested on arch $arch" >&2 echo "WARNING: configuration not tested on arch $arch" >&2
lb_opts=""
;; ;;
esac esac
@ -67,8 +72,8 @@ if [ -n "$enable_pu" ]; then
fi fi
lb config noauto \ lb config noauto \
--distribution "kali" \ --distribution "$dist" \
--debian-installer-distribution "kali" \ --debian-installer-distribution "$dist" \
--archive-areas "main contrib non-free" \ --archive-areas "main contrib non-free" \
--bootstrap cdebootstrap \ --bootstrap cdebootstrap \
--cdebootstrap-options "--keyring=/usr/share/keyrings/kali-archive-keyring.gpg --suite-config=wheezy" \ --cdebootstrap-options "--keyring=/usr/share/keyrings/kali-archive-keyring.gpg --suite-config=wheezy" \
@ -78,11 +83,11 @@ lb config noauto \
--source false \ --source false \
--firmware-binary true \ --firmware-binary true \
--firmware-chroot true \ --firmware-chroot true \
--mirror-bootstrap $kali_mirror \ --mirror-bootstrap "$kali_mirror" \
--mirror-debian-installer $kali_mirror \ --mirror-debian-installer "$kali_mirror" \
--mirror-chroot-security $kalisec_mirror \ --mirror-chroot-security "$kalisec_mirror" \
--mirror-binary $public_kali_mirror \ --mirror-binary "$public_kali_mirror" \
--mirror-binary-security $public_kalisec_mirror \ --mirror-binary-security "$public_kalisec_mirror" \
--iso-application "Kali Linux" \ --iso-application "Kali Linux" \
--iso-publisher "Kali" \ --iso-publisher "Kali" \
--iso-volume "Kali Live" \ --iso-volume "Kali Live" \

@ -22,12 +22,13 @@ case "$HOST_ARCH" in
esac esac
# Parsing command line options # Parsing command line options
temp=$(getopt -o sp -l single,proposed-updates -- "$@") temp=$(getopt -o spd -l single,proposed-updates,kali-dev -- "$@")
eval set -- "$temp" eval set -- "$temp"
while true; do while true; do
case "$1" in case "$1" in
-s|--single) OPT_single="1"; shift 1; ;; -s|--single) OPT_single="1"; shift 1; ;;
-p|--proposed-updates) OPT_pu="1"; shift 1; ;; -p|--proposed-updates) OPT_pu="1"; shift 1; ;;
-d|--kali-dev) OPT_kali_dev="1"; shift 1; ;;
--) shift; break; ;; --) shift; break; ;;
*) echo "ERROR: Invalid command-line option: $1" >&2; exit 1; ;; *) echo "ERROR: Invalid command-line option: $1" >&2; exit 1; ;;
esac esac
@ -38,9 +39,17 @@ if [ -n "$OPT_single" ]; then
KALI_ARCHES="$HOST_ARCH" KALI_ARCHES="$HOST_ARCH"
fi fi
KALI_CONFIG_OPTS="--"
if [ -n "$OPT_kali_dev" ]; then
echo "Using kali-dev as the base distribution"
KALI_CONFIG_OPTS="$KALI_CONFIG_OPTS --kali-dev"
if [ "$KALI_VERSION" = "daily" ]; then
KALI_VERSION="dev"
fi
fi
if [ -n "$OPT_pu" ]; then if [ -n "$OPT_pu" ]; then
echo "Integrating proposed-updates in the image" echo "Integrating proposed-updates in the image"
KALI_CONFIG_OPTS="-- --proposed-updates" KALI_CONFIG_OPTS="$KALI_CONFIG_OPTS --proposed-updates"
fi fi
# Set sane PATH (cron seems to lack /sbin/ dirs) # Set sane PATH (cron seems to lack /sbin/ dirs)

Loading…
Cancel
Save