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

#slackpkg search mbootpack
#sbopkg -s mbootpack
#sbopkg -i mbootpack

Prepare

cd /boot/
zcat xen.gz > xen
vi /usr/src/dom0/scripts/extract-vmlinux

mktemp /tmp/vmlinux-XXXXXX

/usr/src/dom0/scripts/extract-vmlinux vmlinuz > vmlinux

strings /boot/vmlinuz | grep microcode
readelf --headers /boot/vmlinuz

Ready

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)

file xen
file vmlinux
rm -f bootpack
mbootpack -o bootpack -m vmlinux xen
#mbootpack -o bootpack -m vmlinux -m initrd xen
file bootpack

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

mv -i /etc/lilo.conf /etc/lilo.conf.dist
sed -r '/^[[:space:]]*(#|$)/d' /etc/lilo.conf.dist > /etc/lilo.conf
vi /etc/lilo.conf

lba32
timeout = 50

image = /boot/bootpack
    root = /dev/sda3
    label = XEN
    read-only
    append="loglvl=info pv-linear-pt=true -- root=/dev/sda3 ro ipv6.disable=1"
    #com1=9600,8n1 console=com1 dom0_mem=49152 -- root=/dev/sda3 ro console=ttyS0,9600n8

image = /boot/vmlinuz
  root = /dev/sda3
  label = Linux
  read-only
    append="ipv6.disable=1"
    #initrd = /boot/initrd.gz

note the -- between XEN versus Linux kernel arguments.

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=bootpack
        label=XEN
        read-only
        append="root=/dev/sda3 ro ipv6.disable=1"

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

–> XEN BOOT FAILS about wrong entry-point

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}'

Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml