core: 安装模式添加 tty cmdline

This commit is contained in:
bin456789
2023-08-08 23:21:28 +08:00
parent 9be306830e
commit 1f12589f47
5 changed files with 61 additions and 9 deletions

View File

@ -10,7 +10,7 @@ reboot
# 分区
ignoredisk --only-use="sda|hda|xda|vda|xvda|nvme0n1"
bootloader # 甲骨文x86输出到控制台添加 --append="console=ttyS0,9600"
%include /tmp/include-bootloader
clearpart --all --initlabel
reqpart # 如果需要,自动创建 efi 或 biosboot 分区
part / --fstype=xfs --grow
@ -44,6 +44,25 @@ for var in $(grep -o "\b$prefix\.[^ ]*" /proc/cmdline | xargs); do
eval "$(echo $var | sed -E "s/$prefix\.([^=]*)=(.*)/\1='\2'/")"
done
# 设置 tty
include=/tmp/include-bootloader
str=
for tty in tty0 ttyS0 ttyAMA0; do
dev_tty=/dev/$tty
if [ -e $dev_tty ] && echo >$dev_tty 2>/dev/null; then
if [ -z "$str" ]; then
str="console=$tty"
else
str="$str console=$tty"
fi
fi
done
if [ -n "$str" ]; then
echo "bootloader --append=\"$str\"" >$include
else
echo "bootloader" >$include
fi
# 有 installer 分区,表示用了两步安装
include=/tmp/include-packages-for-resize
touch $include