Booting Linux or XEN with EXTLINUX

tested on Devuan/ascii, Ubuntu/artful and Slackware/14.2

Preliminary Note

If using MBR, make sure the needed partition has the bootable flag, for the mbr.bin bootcode to work,

fdisk -l /dev/sda

Also assuming you do NOT have a separate partition for /boot. I have / only as ext4, which EXTLINUX is able to read. Very recent versions of EXTLINUX are also capable to read XFS partitions – see the Building latest EXTLINUX section.

If you have XFS instead of EXT4 on Slackware Linux, see the From Scratch section below, as XFS support is only available since v5.01. Ubuntu has v6.03 but slackware has v4.07.

Install // Packages

Ubuntu artful,

apt install syslinux-utils extlinux

Avoiding Slackware 14.2’s obsolete v4.07,

#slackpkg install syslinux

Install // From Scratch

Fetch the latest stable or testing or current SYSLINUX,

#tar xzf syslinux-6.03.tar.gz 
#cd syslinux-6.03

#tar xzf syslinux-6.04-pre1.tar.gz 
#cd syslinux-6.04-pre1

git clone --recursive git://
cd syslinux

which nasm
#sbopkg -i ucl
slackpkg install ucl
#sbopkg -i upx
slackpkg install upx
ls -lhF /usr/include/uuid/uuid.h
time make -j24 > make.log 2> make.err.log && echo done
removepkg syslinux
make -j16 install

which extlinux
ls -lhF `which extlinux`
extlinux -v

Write the bootcode

fdisk -l /dev/sda | grep ^Disklabel

In case you are using mbr.bin, you will have to MAKE THE PARTITION BOOTABLE,

cfdisk /dev/sda

Ubuntu GPT,

dd if=/usr/lib/SYSLINUX/gptmbr.bin of=/dev/sda

Ubuntu MBR,

ls -lhF /usr/lib/SYSLINUX/mbr.bin
dd if=/usr/lib/SYSLINUX/mbr.bin of=/dev/sda

Debian GPT,

dd if=/usr/lib/EXTLINUX/gptmbr.bin of=/dev/sda

Debian MBR,

dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/sda

From source GPT,

dd if=/usr/share/syslinux/gptmbr.bin of=/dev/sda

From source MBR,

ls -lF /usr/share/syslinux/mbr.bin
dd if=/usr/share/syslinux/mbr.bin of=/dev/sda
#cat /usr/share/syslinux/mbr.bin > /dev/sda

Configure EXTLINUX

extlinux -i /

when the mount command does not show the tru device patch, force it e.g.,

#extlinux -i / --device /dev/sda1

ls -lhF /ldlinux.c32
ls -lhF /ldlinux.sys

#with multiboot/xen
cp -f /usr/share/syslinux/libcom32.c32 /
cp -f /usr/share/syslinux/mboot.c32 /
#cp /usr/lib/syslinux/modules/bios/libcom32.c32 /
#cp /usr/lib/syslinux/modules/bios/mboot.c32 /

#with menu
cp -f /usr/share/syslinux/libutil.c32 /
cp -f /usr/share/syslinux/menu.c32 /
#cp /usr/lib/syslinux/modules/bios/libutil.c32 /
#cp /usr/lib/syslinux/modules/bios/menu.c32 /

vi /extlinux.conf

default XEN
prompt 1
timeout 30

#default menu.c32
#prompt 0
#menu title EXTLINUX

label Linux
    linux vmlinuz
    append root=/dev/sda1 ro ipv6.disable=1

label XEN
    kernel mboot.c32
    append xen.gz loglvl=info pv-linear-pt=true --- vmlinuz console=tty0 root=/dev/sda1 ro ipv6.disable=1
#--- initrd.img
#8192M 10240M 12288M

ls -lhF /*.{conf,sys,c32}
ls -lhF /xen.gz /vmlinuz

Ready to check

shutdown -r now


On Ubuntu artful,

apt purge lilo
dpkg -l | grep grub
apt purge ...grub...

On Slackware 14.2,

#no need to remove lilo, nothing is automated anyways
#and there is no grub

Improved Layout

cp /slackware/usr/share/syslinux/menu.c32 /

ui menu.c32
prompt 0
menu title SYS
timeout 100
default XEN


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