mirror of
https://github.com/Dasharo/preseeds.git
synced 2026-06-13 10:16:39 -07:00
fedora/ks.cfg: serial console
Signed-off-by: Wiktor Mowinski <wiktor.mowinski@3mdeb.com>
This commit is contained in:
+22
-9
@@ -37,23 +37,36 @@ systemctl enable sshd
|
||||
# Change the hostname
|
||||
hostnamectl set-hostname --static 3mdeb
|
||||
|
||||
# Tweak GRUB config
|
||||
sed -i 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=5/' /etc/default/grub
|
||||
sed -i 's/^GRUB_TIMEOUT_STYLE=.*/GRUB_TIMEOUT_STYLE=menu/' /etc/default/grub
|
||||
sed -i 's/^#GRUB_TERMINAL=.*/GRUB_TERMINAL="serial gfxterm"/' /etc/default/grub
|
||||
sed -i 's/\(^GRUB_CMDLINE_LINUX=".*\)"/\1 console=tty0 console=ttyS0 console=ttyUSB0,115200"/' /etc/default/grub
|
||||
|
||||
# Kernel message suppression
|
||||
echo "kernel.printk = 0 4 1 7" > /etc/sysctl.d/10-console-messages.conf
|
||||
# FULL GRUB CONFIG FOR SERIAL SUPPORT
|
||||
cat > /etc/default/grub << 'EOF'
|
||||
GRUB_TIMEOUT=5
|
||||
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
|
||||
GRUB_DEFAULT=saved
|
||||
GRUB_DISABLE_SUBMENU=true
|
||||
GRUB_TERMINAL_OUTPUT="console"
|
||||
GRUB_CMDLINE_LINUX="rhgb quiet console=tty0 console=ttyS0 console=ttyUSB0,115200n8"
|
||||
GRUB_DISABLE_RECOVERY="true"
|
||||
GRUB_ENABLE_BLSCFG=true
|
||||
GRUB_TERMINAL="serial console"
|
||||
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
|
||||
EOF
|
||||
|
||||
# Apply GRUB changes
|
||||
grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||
|
||||
# Kernel message suppression
|
||||
echo "kernel.printk = 0 4 1 7" > /etc/sysctl.d/10-console-messages.conf
|
||||
|
||||
#Enable serial console service
|
||||
systemctl enable serial-getty@ttyUSB0.service
|
||||
systemctl start serial-getty@ttyUSB0.service
|
||||
|
||||
# Set SELinux to permissive
|
||||
sed -i 's/^SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
|
||||
|
||||
# Disable Gnome logout prompt (if GNOME is installed)
|
||||
gsettings set org.gnome.SessionManager logout-prompt false || true
|
||||
|
||||
%end
|
||||
|
||||
reboot
|
||||
reboot
|
||||
Reference in New Issue
Block a user