Setting up GRUB2

Install

see grub-install or grub-install-efi

GNU/Linux & dom0 setup

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/pv" {
    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 "xen/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 & dom0 setup

dos/ext2

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

gpt/ffs

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

gpt/ffs for XEN dom0

assuming serial console

THAT IS A DRAFT - UNTESTED

menuentry "XEN" {
    insmod ufs2
    set root=(hd0,gpt2)
    multiboot /xen.gz loglvl=info guest_loglvl=info noreboot=true smt=1 ept=exec-sp com1=115200,8n1 console=com1,vga
    module /netbsd bootdev=... ro console=...
}

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

netbet/xen0

https://wiki.netbsd.org/ports/xen/howto-grub/

malabar

https://unix.stackexchange.com/questions/156719/ext2-filesystem-for-boot-partition

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


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun