特殊处理外部 grub 引导的机器,例如 cloudcone

This commit is contained in:
bin456789
2024-06-05 22:23:18 +08:00
parent d821d5b541
commit cfd2421462
2 changed files with 58 additions and 1 deletions

View File

@ -157,7 +157,12 @@ d-i partman/early_command string true; \
# debian 10 没有 /target/etc/ssh/sshd_config.d/ 文件夹
# kali ssh 默认关闭
# 另一种方法处理 cloudcone
# if [ "$link_grub_dir" = 1 ]; then mkdir /target/boot/grub2; echo 'chainloader (hd0)+1' >/target/boot/grub2/grub.cfg; fi; \
d-i preseed/late_command string true; \
link_grub_dir="$(grep -o 'extra\.link_grub_dir=[^ ]*' /proc/cmdline | cut -d= -f2)"; \
if [ "$link_grub_dir" = 1 ]; then ln -s grub /target/boot/grub2; fi; \
in-target systemctl enable ssh; \
echo "PermitRootLogin yes" >/target/etc/ssh/sshd_config.d/01-permitrootlogin.conf || \
echo "PermitRootLogin yes" >>/target/etc/ssh/sshd_config