1
0
mirror of https://github.com/lxc/lxc-templates.git synced 2025-08-21 04:10:55 +00:00

Compare commits

...

6 Commits

Author SHA1 Message Date
zhaixiaojuan@loongson.cn
c3f8874bdb
Merge e0d8f58995d58e4bcd337e80e37ba1ebe29558a2 into 690305afab622f7d8c822062ccf2c632bbb00b97 2024-02-04 09:52:35 +08:00
Stéphane Graber
690305afab
Merge pull request #63 from elboulangero/kali-debian
Support for non-free-firmware for Kali and Debian
2024-02-01 11:06:28 +01:00
Arnaud Rebillout
8d2cb761ab lxc-debian: Also add non-free-firmware when --enable-non-free
Debian has a non-free-firmware component, starting bookworm, cf.
https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.en.html#non-free-split

Signed-off-by: Arnaud Rebillout <arnaudr@kali.org>
2024-02-01 15:55:48 +07:00
Arnaud Rebillout
06268b7ff8 lxc-kali: Also add non-free-firmware when --enable-non-free
Kali Linux just enabled their non-free-firmware component,  cf.
https://www.kali.org/blog/non-free-firmware-transition/

Signed-off-by: Arnaud Rebillout <arnaudr@kali.org>
2024-02-01 15:55:44 +07:00
Arnaud Rebillout
dd044cd9df lxc-kali: Reduce diff with Debian
Another commit, in the spirit of 0862ddf3, that doesn't really change
anything in terms of functionality, but brings the code in lxc-kali.in
closer to the code in lxc-debian.in, making it easier to compare the two
files.

Signed-off-by: Arnaud Rebillout <arnaudr@kali.org>
2024-02-01 15:55:39 +07:00
zhaixiaojuan
e0d8f58995 lxc-debian: support installation of dialog-like program 2023-10-31 15:06:23 +08:00
2 changed files with 30 additions and 10 deletions

View File

@ -238,7 +238,14 @@ write_sourceslist()
if [ "$mainonly" = 1 ]; then if [ "$mainonly" = 1 ]; then
non_main='' non_main=''
else 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 fi
cat >> "${rootfs}/etc/apt/sources.list" << EOF cat >> "${rootfs}/etc/apt/sources.list" << EOF
@ -367,12 +374,19 @@ download_debian()
iproute=iproute2 iproute=iproute2
;; ;;
esac esac
if [ `apt search dialog |grep ^dialog\/ |wc -l` != 0 ]; then
dialoglike="dialog"
elif [ `apt search whiptail |grep ^whiptail\/ |wc -l` != 0 ]; then
dialoglike="whiptail"
elif [ `apt search Xdialog |grep ^Xdialog\/ |wc -l` != 0 ]; then
dialoglike="Xdialog"
fi
packages=\ packages=\
$init,\ $init,\
ifupdown,\ ifupdown,\
locales,\ locales,\
ca-certificates,\ ca-certificates,\
dialog,\ $dialoglike,\
isc-dhcp-client,\ isc-dhcp-client,\
netbase,\ netbase,\
net-tools,\ net-tools,\
@ -684,8 +698,8 @@ Options :
-S, --auth-key=KEYFILE SSH public key to inject into the container as the root user. -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, -a, --arch=ARCH The container architecture. Can be one of: i686, x86_64,
amd64, armhf, armel, powerpc. Defaults to host arch. amd64, armhf, armel, powerpc. Defaults to host arch.
-r, --release=RELEASE Debian release. Can be one of: wheezy, jessie, stretch, buster, sid. -r, --release=RELEASE Debian release. Can be one of: wheezy, jessie, stretch, buster,
Defaults to current stable. bullseye, bookworm, trixie, sid. Defaults to current stable.
--mirror=MIRROR Debian mirror to use during installation. Overrides the MIRROR --mirror=MIRROR Debian mirror to use during installation. Overrides the MIRROR
environment variable (see below). environment variable (see below).
--keyring=KEYRING GPG keyring to authenticate the repository against. --keyring=KEYRING GPG keyring to authenticate the repository against.
@ -696,7 +710,7 @@ Options :
--packages=PACKAGE_NAME1,PACKAGE_NAME2,... --packages=PACKAGE_NAME1,PACKAGE_NAME2,...
List of additional packages to install. Comma separated, without space. List of additional packages to install. Comma separated, without space.
-c, --clean only clean up the cache and terminate -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 -I|--interpreter-path=INTERPRETER-PATH
Path of the binfmt interpreter to copy to the rootfs Path of the binfmt interpreter to copy to the rootfs
-F | --flush-cache Flush the debian release cache -F | --flush-cache Flush the debian release cache

View File

@ -224,13 +224,18 @@ write_sourceslist()
if [ "$mainonly" = 1 ]; then if [ "$mainonly" = 1 ]; then
non_main='' non_main=''
else else
non_main=' contrib non-free' non_main=' contrib non-free non-free-firmware'
fi fi
cat >> "${rootfs}/etc/apt/sources.list" << EOF cat >> "${rootfs}/etc/apt/sources.list" << EOF
${prefix} $MIRROR ${release} main${non_main} ${prefix} $MIRROR ${release} main${non_main}
EOF EOF
}
apt_update_packages(){
local apt_update_args="update"
chroot "${rootfs}" apt-get $apt_update_args
return $?
} }
install_packages() install_packages()
@ -238,9 +243,10 @@ install_packages()
local rootfs="$1"; shift local rootfs="$1"; shift
local packages="$*" local packages="$*"
chroot "${rootfs}" apt-get update if [ -n "${packages}" ] && apt_update_packages; then
if [ -n "${packages}" ]; then chroot "${rootfs}" apt-get install -y --no-install-recommends ${packages}
chroot "${rootfs}" apt-get install --force-yes -y --no-install-recommends ${packages} elif [ -n "${packages}" ]; then
echo "Apt update failed, not downloading packages"
fi fi
} }
@ -638,7 +644,7 @@ Options :
--packages=PACKAGE_NAME1,PACKAGE_NAME2,... --packages=PACKAGE_NAME1,PACKAGE_NAME2,...
List of additional packages to install. Comma separated, without space. List of additional packages to install. Comma separated, without space.
-c, --clean only clean up the cache and terminate -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 -I|--interpreter-path=INTERPRETER-PATH
Path of the binfmt interpreter to copy to the rootfs Path of the binfmt interpreter to copy to the rootfs
-F | --flush-cache Flush the kali release cache -F | --flush-cache Flush the kali release cache