Add comments

merge-requests/18/head
g0t mi1k 3 months ago
parent 4e4382e8c1
commit 5dbdcad8ed

@ -3,8 +3,8 @@
set -e set -e
set -o pipefail # Bashism set -o pipefail # Bashism
# You can put a local mirror here if you want (or you can set # You can put a local mirror here if you want
# it in .mirror) # (or you can set it in .mirror)
if [ -e .mirror ]; then if [ -e .mirror ]; then
kali_mirror=$(cat .mirror) kali_mirror=$(cat .mirror)
else else

@ -16,6 +16,8 @@ VERBOSE=""
DEBUG="" DEBUG=""
HOST_ARCH=$(dpkg --print-architecture) HOST_ARCH=$(dpkg --print-architecture)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
image_name() { image_name() {
case "$KALI_ARCH" in case "$KALI_ARCH" in
i386|amd64|arm64) i386|amd64|arm64)
@ -87,7 +89,7 @@ debug() {
clean() { clean() {
debug "Cleaning" debug "Cleaning"
run_and_log $SUDO lb clean --purge run_and_log $SUDO lb clean --purge # ./auto/clean
#run_and_log $SUDO umount -l $(pwd)/chroot/proc #run_and_log $SUDO umount -l $(pwd)/chroot/proc
#run_and_log $SUDO umount -l $(pwd)/chroot/dev/pts #run_and_log $SUDO umount -l $(pwd)/chroot/dev/pts
#run_and_log $SUDO umount -l $(pwd)/chroot/sys #run_and_log $SUDO umount -l $(pwd)/chroot/sys
@ -124,9 +126,12 @@ require_package() {
debug "$pkg version: $pkg_version" debug "$pkg version: $pkg_version"
} }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Allowed command line options # Allowed command line options
. $(dirname $0)/.getopt.sh . $(dirname $0)/.getopt.sh
# Define log file
BUILD_LOG="$(pwd)/build.log" BUILD_LOG="$(pwd)/build.log"
debug "BUILD_LOG: $BUILD_LOG" debug "BUILD_LOG: $BUILD_LOG"
# Create empty file # Create empty file
@ -236,17 +241,18 @@ if [ "$ACTION" = "clean" ]; then
fi fi
cd $(dirname $0) cd $(dirname $0)
# Create image output location
mkdir -p $TARGET_DIR/$TARGET_SUBDIR mkdir -p $TARGET_DIR/$TARGET_SUBDIR
# Don't quit on any errors now # Don't quit on any errors now
set +e set +e
debug "Stage 1/2 - Config" debug "Stage 1/2 - Config" # ./auto/config
run_and_log lb config -a $KALI_ARCH $KALI_CONFIG_OPTS "$@" run_and_log lb config -a $KALI_ARCH $KALI_CONFIG_OPTS "$@"
[ $? -eq 0 ] || failure [ $? -eq 0 ] || failure
debug "Stage 2/2 - Build" debug "Stage 2/2 - Build"
run_and_log $SUDO lb build run_and_log $SUDO lb build # ./auto/build... but missing for us
if [ $? -ne 0 ] || [ ! -e $IMAGE_NAME ]; then if [ $? -ne 0 ] || [ ! -e $IMAGE_NAME ]; then
failure failure
fi fi

Loading…
Cancel
Save