kali: 还原 netinst.iso 的 simple-cdd 机制

This commit is contained in:
bin456789 2024-05-22 21:39:00 +08:00
parent d2a3673107
commit 41b5ccc3ec
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B
2 changed files with 22 additions and 1 deletions

View File

@ -2,6 +2,7 @@
# https://www.debian.org/releases/stable/amd64/apbs04.zh-cn.html
# https://www.debian.org/releases/stable/example-preseed.txt
# https://preseed.debian.net/debian-preseed/bookworm/amd64-main-full.txt
# 需要留意 kali initrd 自带的 /preseed.cfg
# 下面这行语句无效,因为本行后面有反斜杠,前面有空格(安装器认为不算注释)\
d-i debian-installer/locale string en_US
@ -106,7 +107,13 @@ d-i finish-install/reboot_in_progress note
# d-i network-console/password-again password 123@@@
# B.5.1. 安装过程中运行用户命令
# d-i preseed/early_command string
# 注意所有命令都会合并成一行命令
# 有 /cdrom/simple-cdd 才安装 simple-cdd-profiles
# 不然安装时 control 脚本会报错:
# Loading simple-cdd-profiles failed for unknown reasons
d-i preseed/early_command string true; \
if [ -d /cdrom/simple-cdd ]; then anna-install simple-cdd-profiles; fi
# debian 11 initrd 没有 xargs awk
# debian 12 initrd 没有 xargs

View File

@ -1908,6 +1908,7 @@ build_nextos_cmdline() {
# kali 安装好后网卡是 eth0 这种格式,但安装时不是
if [ "$nextos_distro" = kali ]; then
nextos_cmdline+=" net.ifnames=0"
nextos_cmdline+=" simple-cdd/profiles=kali"
fi
elif is_distro_like_redhat $nextos_distro; then
# redhat
@ -2157,6 +2158,19 @@ EOF
echo 'export DEBCONF_DROP_TRANSLATIONS=1' |
insert_into_file lib/debian-installer/menu before 'exec debconf'
# 还原 kali netinst.iso 的 simple-cdd 机制
# 主要用于调用 kali.postinst 设置 zsh 为默认 shell
# 但 mini.iso 又没有这种机制
# https://gitlab.com/kalilinux/build-scripts/live-build-config/-/raw/master/kali-config/common/includes.installer/kali-finish-install?ref_type=heads
# https://salsa.debian.org/debian/simple-cdd/-/blob/master/debian/14simple-cdd?ref_type=heads
# https://http.kali.org/pool/main/s/simple-cdd/simple-cdd-profiles_0.6.9_all.udeb
if [ "$distro" = kali ]; then
# 但我们没有使用 iso因此没有 kali.postinst需要另外下载
mkdir -p cdrom/simple-cdd
curl -Lo cdrom/simple-cdd/kali.postinst https://gitlab.com/kalilinux/build-scripts/live-build-config/-/raw/master/kali-config/common/includes.installer/kali-finish-install?ref_type=heads
chmod a+x cdrom/simple-cdd/kali.postinst
fi
# 提前下载 fdisk
# 因为 fdisk-udeb 包含 fdisk 和 sfdisk提前下载可减少占用
mkdir_clear $tmp/fdisk