From da7b8e8bf3cc161f9b5b1727e9b97aa7bd6a19c3 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Tue, 18 Oct 2022 10:20:12 +0700 Subject: [PATCH 1/3] lxc-kali: Update usage message for Kali --release was not documented, --security-mirror is not supported. Signed-off-by: Arnaud Rebillout --- templates/lxc-kali.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/lxc-kali.in b/templates/lxc-kali.in index e1db119..e467988 100644 --- a/templates/lxc-kali.in +++ b/templates/lxc-kali.in @@ -613,7 +613,7 @@ Template specific options can be passed to lxc-create after a '--' like this: lxc-create --name=NAME [-lxc-create-options] -- [-template-options] Usage: $1 -h|--help -p|--path= [-c|--clean] [-a|--arch=] [-r|--release=] - [--mirror=] [--security-mirror=] + [--mirror=] [--package=] [-I|--interpreter-path=] [-F | --flush-cache] [-S|--auth-key=] @@ -625,11 +625,10 @@ Options : -S, --auth-key=KEYFILE SSH public key to inject into the container as the root user. -a, --arch=ARCH The container architecture. Can be one of: i686, x86_64, amd64, armhf, armel. Defaults to host arch. + -r, --release=RELEASE Kali release. Can be one of: kali-dev, kali-rolling. + Defaults to kali-rolling. --mirror=MIRROR Kali mirror to use during installation. Overrides the MIRROR environment variable (see below). - --security-mirror=SECURITY_MIRROR - Kali mirror to use for security updates. Overrides the - SECURITY_MIRROR environment variable (see below). --packages=PACKAGE_NAME1,PACKAGE_NAME2,... List of additional packages to install. Comma separated, without space. -c, --clean only clean up the cache and terminate @@ -644,6 +643,7 @@ Environment variables: Defaults to '$MIRROR' DOWNLOAD_KEYRING Sets whether to download keyring when missing or ignore keyring checks Defaults to 1 + EOF return 0 } From 70ae901bddfbf53c6d6f913f74edb6887a076697 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Tue, 18 Oct 2022 10:25:18 +0700 Subject: [PATCH 2/3] lxc-kali: Fix incorrect use of basename instead of dirname cf. ae96852bbbf8bf4673a14085acfd6c0a74c48e37 Signed-off-by: Arnaud Rebillout --- templates/lxc-kali.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/lxc-kali.in b/templates/lxc-kali.in index e467988..3439a58 100644 --- a/templates/lxc-kali.in +++ b/templates/lxc-kali.in @@ -394,7 +394,7 @@ apt-transport-https echo "Failed to download the rootfs, aborting." return 1 fi - mkdir -p "$(basename "$cache/partial-$release-$arch/$interpreter_path")" + mkdir -p "$(dirname "$cache/partial-$release-$arch/$interpreter_path")" cp "$interpreter" "$cache/partial-$release-$arch/$interpreter_path" if [ $? -ne 0 ]; then echo "failed to copy $interpreter to $cache/partial-$release-$arch/$interpreter_path" From 0862ddf36d9550ba7ba9604eb0c7ad96beb3ba6a Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Tue, 18 Oct 2022 10:28:24 +0700 Subject: [PATCH 3/3] lxc-kali: Reduce diff with Debian These bits were missing for no reason. Signed-off-by: Arnaud Rebillout --- templates/lxc-kali.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/lxc-kali.in b/templates/lxc-kali.in index 3439a58..8ba89e8 100644 --- a/templates/lxc-kali.in +++ b/templates/lxc-kali.in @@ -155,6 +155,12 @@ EOF chroot "$rootfs" update-locale LANG="$LANG" fi + # remove pointless services in a container + chroot "$rootfs" /usr/sbin/update-rc.d -f checkroot.sh disable + chroot "$rootfs" /usr/sbin/update-rc.d -f umountfs disable + chroot "$rootfs" /usr/sbin/update-rc.d -f hwclock.sh disable + chroot "$rootfs" /usr/sbin/update-rc.d -f hwclockfirst.sh disable + # generate new SSH keys if [ -x "$rootfs/var/lib/dpkg/info/openssh-server.postinst" ]; then cat > "$rootfs/usr/sbin/policy-rc.d" << EOF @@ -668,6 +674,7 @@ elif [ "$arch" = "aarch64" ]; then arch="arm64" fi hostarch=$arch +packages= mainonly=1 flushcache=0