目前,我正试图建立一个或多或少的动态预置。这意味着我正在创建自定义模板/问题,并根据需要设置特定的"d-i“选项的答案。我的环境是使用debian安装程序的ubuntu/debian。
使用以下命令执行这些命令:d-i preseed/early_command string wget -qO preseed_early_command.sh http://myurl/preseed/server/bionic/preseed_early_command.sh && sh preseed_early_command.sh
根据语言选择的不同,我试图使用debconf-set设置特定选项,看起来它们被识别了,但在early_command完成后,我仍然得到语言对话框(所有设置的值都按照问题正确设置)。
if [ "$(debconf-get language-select/select)" = "German" ]; then
debconf-set debian-installer/language "de"
debconf-set debian-installer/country "DE"
debconf-set debian-installer/locale "de_DE.UTF-8"
debconf-set console-setup/ask_detect false
debconf-set keyboard-configuration/layoutcode "de"
debconf-set keyboard-configuration/variantcode "nodeadkeys"
fiHow我可以阻止安装程序再次问我问题,尽管设置了吗?是否有可能以我正在尝试的方式操纵预种皮?
根据机器类型选择(即桌面/无头),我希望设置tasksel/pkgsel选项。但是无论我是直接运行还是使用debconf-set,这些都会失败。
if [ "$(debconf-get machine-type/select)" = "Ubuntu Desktop" ]; then
debconf-set tasksel/first multiselect ubuntu-desktop
debconf-set pkgsel/include openssh-server build-essential nano vim hardinfo htop remmina bash-completion dkms dialog
elif [ "$(debconf-get machine-type/select)" = "Ubuntu Headless" ]; then
debconf-set tasksel/first multiselect standard
debconf-set pkgsel/include "openssh-server nano vim htop bash-completion ntp"
fiHow是否正在执行/评估"pkgsel/tasksel“选项?在这个阶段,Tasksel似乎没有用,因为busybox抛出了 not found**.**
发布于 2020-02-01 22:57:31
这一回答只是试图回答所提出的两个问题中的第一个问题。
debian debconf-set中有一个简短的short脚本,它仅仅是源忏悔模块(3)并调用db_set $1 $2。更有用的命令是debconf-set-selections,它可以从debconf集-选择(1)中理解,它以与预置文件相同格式的文件作为参数。据说它也应该接受stdin上的数据,但是我在debian环境中没有成功。
例如:
VALUES=`mktemp`
cat > "${VALUES}" << END_OF_DEBCONF
d-i time/zone string Antarctica/Troll
END_OF_DEBCONF
debconf-get-selections "${VALUES}"还有。只使用带有脚本的preseed/run可能比使用preseed/early_command重构相同的功能更简单。
https://unix.stackexchange.com/questions/547236
复制相似问题