Skip to content
Snippets Groups Projects
Verified Commit 2eee50f1 authored by Vladimír Štill's avatar Vladimír Štill
Browse files

debootstrap: Make serial port dependent on computer

parent a6bc5aa7
No related branches found
No related tags found
No related merge requests found
set -ex set -ex
SERIAL_SPEED=9600 SERIAL_SPEED=9600
grep -q pontos /etc/hostname && SERIAL_SPEED=115200 SERIAL_DEV=ttyS1
if grep -q pontos /etc/hostname; then
SERIAL_SPEED=115200
SERIAL_DEV=ttyS0
fi
export LANG=C.UTF-8 export LANG=C.UTF-8
...@@ -52,7 +56,7 @@ else ...@@ -52,7 +56,7 @@ else
apt install -yy grub-pc apt install -yy grub-pc
fi fi
if ! grep -q 'console serial' /etc/default/grub; then if ! grep -q 'console serial' /etc/default/grub; then
sed -i /etc/default/grub -e "s/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\"/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet console=tty0 console=ttyS0,$SERIAL_SPEED console=ttyS1,$SERIAL_SPEED\"/" sed -i /etc/default/grub -e "s/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\"/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet console=tty0 console=${SERIAL_DEV},$SERIAL_SPEED\"/"
cat >> /etc/default/grub <<EOF cat >> /etc/default/grub <<EOF
# Preload both GPT and MBR modules so that they are not missed # Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos lvm" GRUB_PRELOAD_MODULES="part_gpt part_msdos lvm"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment