Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for non-free-firmware for Kali and Debian #63

Merged
merged 3 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions templates/lxc-debian.in
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,14 @@ write_sourceslist()
if [ "$mainonly" = 1 ]; then
non_main=''
else
non_main=' contrib non-free'
case "$release" in
wheezy|jessie|stretch|buster|bullseye)
non_main=' contrib non-free'
;;
*)
non_main=' contrib non-free non-free-firmware'
;;
esac
fi

cat >> "${rootfs}/etc/apt/sources.list" << EOF
Expand Down Expand Up @@ -684,8 +691,8 @@ 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, powerpc. Defaults to host arch.
-r, --release=RELEASE Debian release. Can be one of: wheezy, jessie, stretch, buster, sid.
Defaults to current stable.
-r, --release=RELEASE Debian release. Can be one of: wheezy, jessie, stretch, buster,
bullseye, bookworm, trixie, sid. Defaults to current stable.
--mirror=MIRROR Debian mirror to use during installation. Overrides the MIRROR
environment variable (see below).
--keyring=KEYRING GPG keyring to authenticate the repository against.
Expand All @@ -696,7 +703,7 @@ Options :
--packages=PACKAGE_NAME1,PACKAGE_NAME2,...
List of additional packages to install. Comma separated, without space.
-c, --clean only clean up the cache and terminate
--enable-non-free include also Debian's contrib and non-free repositories.
--enable-non-free include also Debian's contrib, non-free and non-free-firmware repositories.
-I|--interpreter-path=INTERPRETER-PATH
Path of the binfmt interpreter to copy to the rootfs
-F | --flush-cache Flush the debian release cache
Expand Down
16 changes: 11 additions & 5 deletions templates/lxc-kali.in
Original file line number Diff line number Diff line change
Expand Up @@ -224,23 +224,29 @@ write_sourceslist()
if [ "$mainonly" = 1 ]; then
non_main=''
else
non_main=' contrib non-free'
non_main=' contrib non-free non-free-firmware'
fi

cat >> "${rootfs}/etc/apt/sources.list" << EOF
${prefix} $MIRROR ${release} main${non_main}
EOF
}

apt_update_packages(){
local apt_update_args="update"
chroot "${rootfs}" apt-get $apt_update_args
return $?
}

install_packages()
{
local rootfs="$1"; shift
local packages="$*"

chroot "${rootfs}" apt-get update
if [ -n "${packages}" ]; then
chroot "${rootfs}" apt-get install --force-yes -y --no-install-recommends ${packages}
if [ -n "${packages}" ] && apt_update_packages; then
chroot "${rootfs}" apt-get install -y --no-install-recommends ${packages}
elif [ -n "${packages}" ]; then
echo "Apt update failed, not downloading packages"
fi
}

Expand Down Expand Up @@ -638,7 +644,7 @@ Options :
--packages=PACKAGE_NAME1,PACKAGE_NAME2,...
List of additional packages to install. Comma separated, without space.
-c, --clean only clean up the cache and terminate
--enable-non-free include also Kali's contrib and non-free repositories.
--enable-non-free include also Kali's contrib, non-free and non-free-firmware repositories.
-I|--interpreter-path=INTERPRETER-PATH
Path of the binfmt interpreter to copy to the rootfs
-F | --flush-cache Flush the kali release cache
Expand Down
Loading