我需要知道如何通过 di early/command 或 di preseed/run 将其添加到 preseed 中,以便preseed.cfg
从/proc/cmdline
参数中设置我的镜像。
如果我做:
d-i preseed/run string ws/ubuntu.sh
#!/bin/sh
for x in `cat /proc/cmdline`; do
case $x in RPHOST*)
eval $x
d-i mirror/http/hostname string ${RPHOST}
d-i mirror/http/mirror string ${RPHOST}
d-i apt-setup/security_host string ${RPHOST}
;;
esac;
done
Run Code Online (Sandbox Code Playgroud)
它失败。
它在 CentOS 启动%pre
部分运行良好,但我不知道如何通过 debian/ubuntu 预置来实现。