Setting up SYSLINUX

tested on Devuan/ascii, Ubuntu/artful, 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.

Installation

see syslinux and check

which extlinux
ls -lF /sbin/extlinux
extlinux -v
ls -lF /usr/share/syslinux/mbr.bin
ls -lF /usr/share/syslinux/efi64/syslinux.efi

Secondary Bootcode

extlinux --install /
#--device /dev/sda1
ls -lF /ldlinux.c32 /ldlinux.sys

From source

#multiboot
cp -f /usr/share/syslinux/libcom32.c32 /
cp -f /usr/share/syslinux/mboot.c32 /
#menu
#cp -f /usr/share/syslinux/libutil.c32 /
#cp -f /usr/share/syslinux/menu.c32 /

Debian/Ubuntu

#multiboot
cp -f /usr/lib/syslinux/modules/bios/libcom32.c32 /
cp -f /usr/lib/syslinux/modules/bios/mboot.c32 /
#menu
#cp -f /usr/lib/syslinux/modules/bios/libutil.c32 /
#cp -f /usr/lib/syslinux/modules/bios/menu.c32 /

Primary 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

From source

ls -lF /usr/share/syslinux/*.bin
dd if=/usr/share/syslinux/mbr.bin of=/dev/sda conv=notrunc
#dd if=/usr/share/syslinux/gptmbr.bin of=/dev/sda conv=notrunc

Ubuntu

ls -lF /usr/lib/SYSLINUX/*.bin
dd if=/usr/lib/SYSLINUX/mbr.bin of=/dev/sda
#dd if=/usr/lib/SYSLINUX/gptmbr.bin of=/dev/sda

Debian

ls -lF /usr/lib/EXTLINUX/*.bin
dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/sda
#dd if=/usr/lib/EXTLINUX/gptmbr.bin of=/dev/sda

Setup

vi /extlinux.conf

default XEN
prompt 1
timeout 50

label Linux
    linux /boot/vmlinuz
    append root=/dev/sda1 ro ipv6.disable=1
    #initrd=initrd.img

label XEN
    kernel mboot.c32
    append /boot/xen.gz loglvl=info pv-linear-pt=true --- vmlinuz root=/dev/sda1 ro ipv6.disable=1
    #console=tty0
    #--- initrd.img
    #noreboot=true
    #loglvl=all
    #dom0_mem=4096M,max:4096M
    #https://xenbits.xen.org/docs/4.11-testing/misc/xen-command-line.html
    #8192M 10240M 12288M
    #crashkernel=128M
    #crashkernel=128M@16M
    #crashkernel=auto
    #crashkernel=X@Y
    #crashkernel=0M-2G:128M,2G-6G:256M,6G-8G:512M,8G-:768M

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

Clean-up

Ubuntu

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

Slackware – no need to remove lilo, nothing is automated anyways, and there is no grub.

DRAFT ON GPT

bootloader is on gpt3

#sgdisk /dev/sda --attributes=3:set:2
#sgdisk /dev/sda --attributes=3:show

MULTIBOOT/NetBSD (FAILS)

cp -i /usr/lib/syslinux/modules/bios/libcom32.c32 /var/lib/tftpboot/
cp -i /usr/lib/syslinux/modules/bios/mboot.c32 /var/lib/tftpboot/

vi /var/lib/tftpboot/pxelinux.cfg/default

label NetBSD multiboot
com32 mboot.c32
append netbsd7/amd64/binary/kernel/netbsd-INSTALL.gz

but this is what I get so far

Invalid Multiboot image: neither ELF header nor a.out kludge found

Resources

EXTLINUX https://wiki.syslinux.org/wiki/index.php?title=EXTLINUX

Mboot.c32 http://www.syslinux.org/wiki/index.php?title=Mboot.c32

Installing Slackware Using GPT with a BIOS motherboard https://docs.slackware.com/howtos:slackware_admin:installing_with_gpt_without_uefi

How to install extlinux (syslinux) as a bootloader http://shallowsky.com/linux/extlinux.html

How to boot Linux with extlinux https://superuser.com/questions/743802/how-to-boot-linux-with-extlinux

Syslinux https://wiki.archlinux.org/index.php/syslinux

multiboot

msc-thesis/dfly-multiboot.md https://github.com/erszcz/msc-thesis/blob/master/dfly-multiboot.md

Mboot.c32 http://www.syslinux.org/wiki/index.php/Mboot.c32


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