mirror of
https://github.com/bin456789/reinstall.git
synced 2025-12-10 07:28:56 +08:00
core: 安装模式添加 tty cmdline
This commit is contained in:
21
redhat.cfg
21
redhat.cfg
@ -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
|
||||
|
||||
Reference in New Issue
Block a user