Skip to content

Instantly share code, notes, and snippets.

@jirib
Last active June 7, 2021 04:03
Show Gist options
  • Save jirib/7970eed8431013983a8cf1c947041c2a to your computer and use it in GitHub Desktop.
Save jirib/7970eed8431013983a8cf1c947041c2a to your computer and use it in GitHub Desktop.
openSUSE USB installation media with serial console

For BIOS boot, IMO UEFI works differently (GRUB).

fdisk /dev/sda # create partition and set it active
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt
bsdtar -xvf <iso> -C /mnt/
grub2-install --target=i386-pc --recheck --debug --boot-directory=/mnt/boot /dev/sda
cat > /mnt/boot/grub2/grub.cfg <<EOF
serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1
set timeout=60
default=0
menuentry 'Installation' --class opensuse --class gnu-linux --class gnu --class os {
  echo 'Loading kernel ...'
  linux /boot/x86_64/loader/linux textmode=1 console=ttyS0,115200n81
  echo 'Loading initial ramdisk ...'
  initrd /boot/x86_64/loader/initrd
}
EOF
umount /mnt

And you can test via QEMU.

qemu-system-x86_64 -m 1024 -smp 2 -drive file=/dev/sdb,format=raw -vga none \
  -nographic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment