22

August
2012

Bootloader

Slax always used Syslinux bootloader (for USB drives) and isolinux bootloader for CDs. Due to that, Slax always had to reside in two directories: 'boot' and 'slax'. Names explain themselves.

I'm now considering options to either update to the latest isolinux/syslinux version, or use something else (maybe better). I would prefer if Slax release consists of a single directory, 'slax' only, thus people can store other useful data on their Flash drives without worrying about the 'boot' directory. I guess I should spend some time learning new syslinux options or even patching its code.

As always, your thoughts are welcome. Thank you.

User comments
dimitrij 2012-08-22 16:15

Have you considered UEFI support for slax, or the brain-dead secure-boot [non]functionality.

I think the plan for slackware is to wait and see, which I'm fine with. But for a live system this could mean a bad experience in the future, when the evil will be enforcing this boot-up stupidity.

On the other hand, do you really want to buy a key from M$, like ubuntu did?

Anyway, nice to see you back working on this masterpiece

Tomas M 2012-08-23 00:23

I'm afraid that there are only two real options at the moment:
- explain to users how to turn off UEFI on their computer
or
- buy a key from M$, it's for $99, that's not much.

Both the options have drawbacks, unfortunately. This is not decided yet

Job VP 2012-08-23 07:16

Please, the usb option is a real usefull.
and is nice to see you back
Thanks

Naman 2012-08-23 10:43

I've an idea. Just put everything in /boot. Slax can reside in /boot/slax. Just an idea, waiting for Slax 7 :)

CC 2012-08-23 11:34

Do not break the compatibility - there is no good reason to change that. It was easy to find a distinguish what is boot and what is really a slax.

Lê Hoàng Long-hoanglong1712@yahoo.com 2012-08-23 13:06

I agree with CC but I hate to change anything on my windows 7 in order to install slax

jm 2012-08-23 16:25

Currently I am using plop boot manager and syslinux at the same time. I like the features and menu based setup in plop, but it has it's own licensing and I am not sure if it is OK for live distro like Slax.

Easy booting from NTFS,ext3,etc, by not modifying boot records and just dropping slax and boot folders on any HDD/SSD (with the filesystems mentioned above) and using as boot device USB/CD etc, will be a good thing, IMO, if possible/appropriate. But syslinux is a classic, so I'd like to have the option at download/boot setup time,to choose which bootloader to use.

Sajeeth Philip 2012-08-23 19:44

1. I think the USB boot option is one of the finest features of slax. It makes me completely portable.
2. Having everything under slax is the best option. I have done it for the slax-atma variant of the original slax without any serious modification in the code for both USB and hard disk installations. For CD, I do not think that having two folders is a big issue, though it is much neat to see it under a single folder.

Lightning 2012-08-23 23:56

@dimitrij:
uefi/secureboot wouldn't be a problem as long as slax is not installed directly to a local hdd. uefi has to be boot-compatible to bios for removable storage (otherwise it would break any kind of setup-cd (linux, windows, ...) and would make installs impossible) or bring a signed uefi-bootloader that allows booting the default cd/dvd/usb/... bootloaders.
for a local install i just would recommend to not support uefi/secureboot. imho this dump idea of m$ wouldn't be a widespread thing as MANY people just wouldn't buy such ridiciously crippled hardware. i also think that m$ would draw back their "for windows 8 logo this hardware is forced to load only signed uefi-loaders" behaviour. they'll sure keep it for dedicated embedded windows hardware such as tablets, thinclients, etc., but they would cut themselves when forcing EVERYBODY to buy new hardware just to be able to use win8. people would just keep xp, vista and win7.

@topic:
why changing the old behaviour? imho the /boot doesn't hurt anyone that much ... :)


Lightning

Tomas M 2012-08-24 00:09

Actually I wasn't sure if UEFI/secureboot applies only to hard drive installations. If there is no need for such crap for USB boot then the argument is correct, we can just ignore it! :)

Heikki 2012-08-24 04:36

I would use slax, if it would be easier install to hd. Just download from internet and install to hd, without any ghange to hd. Old slax was best because that old versions could install wery easy to fat system, without any change

Tomas M 2012-08-24 04:46

If you INSTALL Slax then you actually CHANGE the hd ... :)

cyv 2012-08-24 11:20

having slax in one directory only will be good but persistence should be saved in a .dat file (porteus) or some sort of container (puppy) to prevent corruption as in the old release.

jm 2012-08-24 11:48

@cyv
Slax has the option to save changes in dat file, just have to unzip slaxsave.zip and choose file size suitable for intended changes. Or you may choose to create appropriate slaxsave.dat yourself ofcourse. rename it, add it to boot parameters, etc. readme in slaxsave.zip explains it better.

Booting in default, change-saving mode, without slaxsave.dat was unpleasant surprise for me too, once or twice, with changes trying to save them selves in fat on my usb flash drive.But solution was already there, requiring just some reading on my side.

aitap 2012-08-26 02:28

Just an idea: SYSLINUX can be installed with -d option to search for its config anywhere (for example, I have an isolinux-based boot CD which can be installed to a USB drive by copying everything to the root of file system and running `syslinux -d isolinux /dev/sdXXX`). There is no easy option for ISOLINUX, but it should re easy to patch its sources.

By the way, GRUB2 can be installed in an arbitrary directory via number of ways. One of them is playing with grub-install --root-directory=... --boot-directory=..., another is writing own config file to embed in core.img (generated with grub-mkimage). An advantage of GRUB2 is ability to write one config file for all boot methods, including ElTorito, BIOS USB/harddrive and UEFI.

P.S.
@Tomas
> explain to users how to turn off UEFI on their computer
Please don't confuse UEFI and secure boot. The first is a modern replacement for BIOS with its pros and cons; the second is a tool used by some corporations to restrict the running operating systems. There are many UEFI PCs which are still BIOS-compatible; there are manu UEFI PCs without Secure Boot too.

Tomas M 2012-08-26 06:44

@aitap:
thank you. I thought that UEFI = secure boot. Seems it's not equal.

BTW: I almost forgot that I sponsored the -d parameter for syslinux myself! ;) However it seems there is a problem with this, it was not designed to load the config file from that directory so it still requires '/boot/'

aitap 2012-08-27 02:20

@Tomas
> However it seems there is a problem with this, it was not designed to load the config file from that directory so it still requires '/boot/'
I'm sorry, do I miss something? These commands are enough to boot syslinux from USB stick with config in /isolinux/syslinux.cfg (atleast for me with syslinux-4.05):
syslinux -d isolinux -i /dev/usbstick
cp -Lr /media/bootable-iso-image-mountpoint/* /media/usbstick
rm -f /media/usbstick/isolinux/isolinux.bin
mv /media/usbstick/isolinux/isolinux.cfg /media/usbstick/isolinux/syslinux.cfg
(Of course, not all ISO images can be used this way, but some can).

Tomas M 2012-08-27 06:57

Yes you're missing big time :) you're missing the point that I do not want to have ANY directory like /isolinux/ etc on the root filesystem of the USB drive.

Isolinux is hardcoded to look for its config in
/boot/isolinux/
/isolinux
/syslinux
etc

I want the USB drive to have only one single directory: /slax/ and everything inside it.

Ady 2012-08-27 11:38

With Syslinux 4.05 (current stable) you could potentially get rid of "/isolinux", since "syslinux" is now a generic term. Booting with isolinux.bin 4.05, the cfg file can be "syslinux.cfg" (if no "isolinux" path and cfg file is used).

Regarding the path of the cfg file, you could just use "/syslinux.cfg" and both isolinux.bin and ldlinux.sys should successfully find the cfg file. Or better yet, use:

syslinux -i -d /slax/ /dev/sdXn

and then IIRC you should be able to use
"/slax/syslinux.cfg".
The method for isolinux.bin is not _that_ different using the correct path for isolinux.bin in mkisofs.

Tomas M 2012-08-27 19:34

I've actually tried this (-d /slax/) few days ago and it didn't work. I have syslinux.cfg in /slax/syslinux.cfg, /slax/boot/syslinux.cfg, /slax/boot/syslinux/syslinux.cfg, but still, but it does't work this way. Syslinux bootloader is installed, it boots, but is unable to find the config file unless I put it in root directory (which is not acceptable) or in /boot or /syslinux directory (which is not acceptable either).

bolid 2012-08-29 18:20

Bifore star slax I change linuxrc (xfs_repair for slaxsave.dat)
.........
if [ "$(basename "$CHANGESMNT" .dat)" != "$CHANGESMNT" ]; then
/bin/xfs_repair -f -L "$CHANGESMNT"
fi
mount_device "$CHANGESMNT" $MEMORY # removes $MEMORY if CHANGESMNT is wrong
/bin/xfs_fsr -v
............

Pan Daz 2020-12-15 12:51

# --- dual boot with XP:
apt install syslinux* vim
vi /media/sda3/slax/boot/syslinux.cfg

LABEL Windows
MENU LABEL Windows
KERNEL chain.c32
APPEND hd0 1

# --- chain.c32 - chainload MBRs, partition boot sectors, Windows bootloaders
* copy all files from /usr/lib/syslinux/modules/bios (from u20.04) to /media/sda4/slax/boot