Booting with Mbootpack

Install

from source

git clone https://github.com/timdeegan/mbootpack.git
cd mbootpack/
nice make -j$j
cp mbootpack /usr/local/bin/

from SBO

#sbopkg -s mbootpack
#sbopkg -i mbootpack

slackpkg install mbootpack

Prepare

cd /boot/
zcat xen.gz > /xen
#vi /usr/src/dom0/scripts/extract-vmlinux
#
#mktemp /tmp/vmlinux-XXXXXX
/usr/src/linux-5.7.9/scripts/extract-vmlinux vmlinuz > /vmlinux
strings /vmlinux | grep microcode
readelf --headers /vmlinux

in case you also need a RAMDISK

#mkinitrd -c -o initrd.gz -k 4.4.88 -r /dev/sda1
#zcat initrd.gz > initrd

mkinitrd also works from the installer while chrooting into the system (possibly even w/o chrooting into it)

Ready to go

cd /
file xen
file vmlinux
rm -f xenux
mbootpack -o xenux -m vmlinux xen
#-m vmlinux -m initrd xen
file xenux

LILO/MBR Setup (possibly w/ GPT table) – WORKS

vi /etc/lilo.conf

root = /dev/sda1
default = XEN-PVH

image = /xenux
    label = "XEN-PVH"
    append = "dom0=pvh dom0_mem=1024M,max:10240M loglvl=info noreboot=true -- root=/dev/sda1 ro vt.default_utf8=0 mitigations=off"
    read-only

image = /xenux
    label = "XEN-PV"
    append = "loglvl=info noreboot=true -- root=/dev/sda1 ro vt.default_utf8=0 mitigations=off"
    read-only

other options

    #loglvl=all pv-linear-pt=true
    #com1=9600,8n1 console=com1 dom0_mem=49152
    #-- ipv6.disable=1
    #-- root=/dev/sda3 ro console=ttyS0,9600n8

Note the TWO DASHES -- INSTEAD OF THREE between XEN versus Linux kernel arguments. Also it’s mandatory to redefine root and ro there, otherwise you get a kernel panic not finding vm-block.

lilo

LILO/EFI Setup – FAILS

eliloconfig
efibootmgr
efibootmgr --bootnum 0003 --delete-bootnum
efibootmgr --bootnum 0000 --active
efibootmgr -o 0000,COPY/PASTE

cp -f /boot/bootpack /boot/efi/EFI/Slackware/
cp -f /boot/vmlinuz /boot/efi/EFI/Slackware/
vi /boot/efi/EFI/Slackware/elilo.conf

chooser=simple
delay=1
timeout=1
default=XEN

image=xenux
        label=XEN
        read-only
        append="root=/dev/sda3 ro ipv6.disable=1"

image=vmlinuz
        label=Linux
        read-only
        append="root=/dev/sda3 vga=normal ro"

Acceptance

xl info | grep commandline
cat /proc/cmdline

Troubles

XEN BOOT FAILS about wrong entry-point? –> solved donno how

Resources

timdeegan/mbootpack https://github.com/timdeegan/mbootpack

Running Xen with LILO http://wpkg.org/Running_Xen_with_LILO

Fragments of old code http://www.tjd.phlegethon.org/software/

Efibootmgr https://wiki.gentoo.org/wiki/Efibootmgr

troubles

Extract vmlinux from vmlinuz or bzImage https://stackoverflow.com/questions/12002315/extract-vmlinux-from-vmlinuz-or-bzimage

timdeegan/mbootpack https://github.com/timdeegan/mbootpack

Extract vmlinux with the power of the command line http://jeffbastian.blogspot.com/2012/11/extract-vmlinux-with-power-of-command.html

Trash

#grep -a -b -o -m 1 -e $'\x1f\x8b\x08\x00' vmlinuz | cut -d: -f 1
#grep -a -b -o -m 1 -P '\x1f\x8b\x08\x00' vmlinuz | cut -d: -f 1
#grep -abo -m1  $'\037\213\010\000' vmlinuz | awk -F: '{print $1+1}'

HOME | GUIDES | BENCHMARKS | html