5

EDIT: Just adding my two more cents after this question becomes a "popular" one. I had been a great fan of grub because it was able to boot everything that I used. However, when grub2 came, I really don't like it because it is

  • humongous itself
  • leave loads of junks at my /boot folder that 99.9% are useless to me
  • the "enhanced" syntax is over complicated to me
  • try booting UEFI using grub2 is really a ROYAL PITA
  • I was able to use grub as my CD boot loader, but I don't know if grub2 can do that or not -- I don't care any more, because I found a better alternative.

The syslinux ecosystem (including extlinux) are now booting everything that I use, CD/DVD, FAT, Ext2/3/4, and even Btrfs. Moreover, it handles MBR/PBR relay or GPT without a hitch. It's small, to the point, and maintain a universal syntax across the board. The extlinux (syslinux) is currently my chosen solution to boot anything I use.

Now back to OP.

Anyone knows how to properly boot Linux with extlinux?

I've exhausted my google search but still unable to figure out what's the proper way to setup extlinux to boot Linux. All hits that I found talk about editing the/boot/extlinux/extlinux.conf file directly. However, there is a big warning inside it that discourages me doing so:

## /boot/extlinux/extlinux.conf
##
## IMPORTANT WARNING
##
## The configuration of this file is generated automatically.
## Do not edit this file manually, use: extlinux-update


default l0
prompt 1
timeout 50

include themes/debian/theme.cfg

I've run extlinux-update or extlinux -update in all sorts of ways a gazillion time but the file still remains the same. The problem is, this file won't boot anything!

If I edit it myself, and run extlinux-update again, then BOOM, it gets back to the above boot-nothing version again.

Anyone knows how to properly setup extlinux under Ubuntu to boot it (without directly editing extlinux.conf)?

This is the extlinux from latest Ubuntu Trusty BTW:

% apt-cache policy extlinux
extlinux:
Installed: 3:4.05+dfsg-6+deb8u1
Candidate: 3:4.05+dfsg-6+deb8u1
Version table:
*** 3:4.05+dfsg-6+deb8u1 0
500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
100 /var/lib/dpkg/status
xpt
  • 9,385
  • 44
  • 120
  • 178

3 Answers3

5

Okay, so as you wanted, here are the absolute minimum steps for me to install extlinux:

sudo apt-get install extlinux

sudo extlinux --install /boot/extlinux

And this did it. Couldn't really believe it but that worked. So here is some extra information: My system (uname)

3.13.0-24-generic (Kernel)
#46-Ubuntu SMP .. (Kernel version)
i686 (Processor and machine)

And the

apt-cache policy extlinux
extlinux:
  Installed: 3:4.05+dfsg-6+deb8u1
  Candidate: 3:4.05+dfsg-6+deb8u1
  Version table:
 *** 3:4.05+dfsg-6+deb8u1 0
        500 http://de.archive.ubuntu.com/ubuntu/ trusty/universe i368 Packages
        100 /var/lib/dpkg/status

The /boot/extlinux/extlinux.conf

default l0
prompt 1
timeout 50

include themes/debian/theme.cfg

I think it is the same as yours. And i don't think the debian-theme will vary. So here is my specific linux.cfg:

label l0
    menu label Ubuntu GNU/Linux, kernel 3.13.0-24-generic
    linux /vmlinuz-3.13.0-24-generic
    append initrd=/initrd.img-3.13.0-24-generic root=UUID=61e460f5-878a-4cff-be9c-12239153d59c ro quiet

label l0r
    menu label Ubuntu GNU/Linux, kernel 3.13.0-24-generic (recovery mode)
    linux /vmlinuz-3.13.0-24-generic
    append initrd=/initrd.img-3.13.0-24-generic root=UUID=61e460f5-878a-4cff-be9c-12239153d59c ro single
    text help
    This option boots the system into recovery mode (single-user)
    endtext

Okay, that's it.But here is some other interesting thing i found out about the boot process: I created "myvmlinuz" and "myinitrd.img" as copies of the original files under /boot and edited the extlinux.conf file to the following:

default test
prompt 1
timeout 50

#include themes/debian/theme.cfg
LABEL test
    MENU Test entry
    LINUX /myvmlinuz
    APPEND initrd=/myinitrd.img root=UUID=61e460f5-878a-4cff-be9c-12239153d59c

As far as i understand it, this is the minimum configuration to get a system working. Boots fine for me. Note that / is the root folder of the partition flagged as boot with extlinux on it in these files.

APPEND initrd=/myinitrd.img root=/dev/sda5

did also work. I used different partitions on one disk for / (sda5), /boot (sda1), swap and so on. I created /boot as a primary partition, don't know if that's important. Maybe you can try

cat /usr/lib/extlinux/mbr.bin > /dev/sda

if grub did something bad.

Well, I hope you get it to run, please let me know if it works!

ju.kreber
  • 307
2

This is a breakdown of a standard "manual" installation, for MBR:

Assuming you are installing Extlinux it on disk disk device /dev/sda:

  • Install a standard MBR on the disk. This MBR will look for and try to boot any partition which has the "boot" flag.
    dd /usr/lib/extlinux/mbr.bin of=/dev/sda bs=440 count=1
  • Set the boot flag on the partition which will contain EXTLINUX
  • Copy extlinux files and used modules to a directory (or root) in the boot partition. Let's use /boot/, for the the sake of the example.
  • Install a bootloader on this partition and point it to the syslinux directory.
    extlinux --install /boot/
  • Make sure the configuration is correct.

So when you boot, the MBR will load the bootable partition bootloader, which will launch EXTLINUX which will read extlinux.conf.

Some steps might be redundant, yet I think it is be nice to write out the steps for having an idea of what happens.

I like EXTLINUX. This is how software should be. I can actually know and understand what is happening and I learned something new about computers by using it.

Rolf
  • 347
1

Here is a good tutorial about Configuring extlinux's auto-update on Debian that should be what you are looking for:

A few days ago, I wrote about how to set up and configure extlinux (syslinux) as a bootloader. But on Debian or Ubuntu, if you make changes to files like /boot/extlinux/extlinux.conf directly, they'll be overwritten.

The configuration files are regenerated by a program called extlinux-update, which runs automatically every time you update your kernel. (Specifically, it runs from the postinst script of the linux-base package: you can see it in /var/lib/dpkg/info/linux-base.postinst.)

[...]

tst
  • 211