Setting up GRUB2

Install

see grub-install or grub-install-efi

Setup

linux & xen

assuming serial console

grub-file --is-x86-multiboot /xen.gz && echo YES
cat /proc/cmdline
    vi /boot/grub/grub.cfg # new file

serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
# first terminal takes precedence when timeout expires
terminal --timeout=1 serial console
# --silent

set default=2
set timeout=3

# last console takes over /dev/console
menuentry "Linux" {
    insmod ext2
    set root=(hd0,msdos1)
    linux /vmlinuz root=/dev/nvme0n1p1 ro console=tty0 console=ttyS0,115200n8 mitigations=off
}

menuentry "XEN" {
    insmod ext2
    set root=(hd0,msdos1)
    multiboot /xen.gz loglvl=info guest_loglvl=info noreboot=true smt=1 ept=exec-sp com1=115200,8n1 console=com1,vga
    module /vmlinuz root=/dev/nvme0n1p1 ro console=hvc0 earlyprintk=xen mitigations=off
}

menuentry "PVH" {
    insmod ext2
    set root=(hd0,msdos1)
    multiboot /xen.gz dom0=pvh dom0_mem=1024M,max:2048M loglvl=info guest_loglvl=info noreboot=true smt=1 ept=exec-sp com1=115200,8n1 console=com1,vga
    module /vmlinuz root=/dev/nvme0n1p1 ro console=hvc0 earlyprintk=xen mitigations=off
}

more grub arguments

# insmod xfs
# set root=(hd0,gpt1)

more xen arguments

# pv-linear-pt=true

more kernel arguments

# root=/dev/nvme0n1p1
# root=/dev/sda1
# nomodeset
# vt.default_utf8=0
# ipv6.disable=1

netbsd

dos/ext2

menuentry "netbsd -v" {
        insmod ext2
        set root=(hd0,msdos1)
        knetbsd /netbsd -v --root=wd0e
}

gpt/ffs

menuentry "netbsd -v" {
        insmod ufs2
        set root=(hd0,gpt2)
        knetbsd /netbsd -v            
}

Resources

https://www.gnu.org/software/grub/manual/grub/grub.html

xen

https://xenbits.xen.org/docs/unstable/misc/xen-command-line.html

https://github.com/mirage/xen/blob/master/docs/misc/xen-command-line.markdown

https://www.suse.com/support/kb/doc/?id=000016233

https://stackoverflow.com/questions/50833062/use-the-xen-hypervisor-console-io-hypercall

https://01.org/linuxgraphics/gfx-docs/drm/ia64/xen.html

https://wiki.xenproject.org/wiki/Xen_EFI

https://lists.xenproject.org/archives/html/xen-users/2019-03/msg00004.html

https://docs.citrix.com/en-us/xenserver/7-1/install/network-boot.html


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | NU | HTML5
Copyright © 2022 Pierre-Philipp Braun