[syslinux] Can almost boot on UEFI win8.1 laptop

Ady ady-sf at hotmail.com
Wed Nov 5 07:11:49 PST 2014


> I have used syslinux 4.0x and earlier for many years, with Puppy Linux
> and more recently Quirky Linux. Though, my knowledge of all the
> capabilities of syslinux remains rudimentary.
> 
> I am new to UEFI. I recently got my hands on a win8.1 laptop, 64-bit
> system, and decided to tackle booting Quirky on it, from a USB stick.
> 
> I turned off Secure Boot.
> 
> I wrote /usr/share/syslinux/gptmbr.bin to the flash drive (/dev/sdc) with dd.
> 
> I setup the Flash stick with GPT, a 512MB FAT32 EFI System partition,
> and the rest of the drive a second partition with f2fs filesystem.
> 
> I installed syslinux 6.03 in the normal way:
> 
> # syslinux --install /dev/sdc1
 
Remember (just in case) that the filesystem should be unmounted 
before executing the syslinux installer command, or use the extlinux 
installer instead.

To reduce some potential problems, I would suggest using a 
subdirectory instead of the root of the filesystem, e.g.:

0_ mount the filesystem;
1_ create the "/syslinux/" subdirectory on it;
2_ unmount the filesystem;
3_ syslinux --directory syslinux --install /dev/sdc1

If you want to avoid having to unmount the filesystem just to execute 
this particular command (e.g. if you need to perform additional 
operations on the filesystem later), you could use the extlinux 
installer (which supports FAT too), e.g.
0_ mount the filesystem;
1_ create the "/syslinux/" subdirectory;
2_ extlinux  --install <mount_point_of_the_filesystem>/syslinux

Instead of "/syslinux/", you could use "/boot/syslinux/". Either 
locations are also valid for ISOLINUX.

Remember that all the above steps are for BIOS booting, or for a UEFI 
system configured to boot in CSM, but not for UEFI boot.
 
> 
> I have the usual files in the root directory of the first partition,
> this is them:
> 
> boot.msg help.msg ldlinux.c32 ldlinux.sys logo.16 syslinux.cfg vmlinuz
> 
> Content of syslinux.cfg:
> 
> default quirky
> display boot.msg
> prompt 1
> timeout 50
> 
> F1 boot.msg
> F2 help.msg
> 
> label quirky
> kernel vmlinuz
> append root=PARTUUID=4FBE68B4-0245-4263-A740-4BB4DBD5514B rootwait rw loglevel=7
> 
> ...where that PARTUUID is the GUID unique ID of the second partition.
> Quirky does not use a initrd/initramfs, we go straight to the Quirky
> filesystem.
> 
> File 'boot.msg' displays a simple message:
> 
> Just wait 5 seconds for normal startup!
> For help press the <F2> key.
> 
> ...the LSS16 image is also supposed to display, but doesn't.
 
And we already expected this issue, as per recent emails in this 
Syslinux Mailing List.
 
> 
> So far so good, but now comes the UEFI part...
> 
> This is where I become a bit confused. In the first partition, I
> created /EFI/BOOT directories, and copied these from
> /usr/share/syslinx/efi64:
> ldlinux.e64 linux.c32 syslinux.c32 syslinux.efi
 
You don't seem to be needing syslinux.c32. Strictly speaking, you 
also don't seem to need linux.c32 (from efi64).
 
> 
> I then copied syslinux.efi to BOOTX64.EFI
> 
> However, I read that syslinux.efi expects to find syslinux.cfg in the
> same directory, so I copied *everything* from the / root directory
> into /EFI/BOOT, even vmlinuz.
 
Why did you originally copy the Syslinux-efi64-related files to the 
root? Such original action _could_ cause some problems, generally 
speaking, considering that you also originally used the root of the 
filesystem for BIOS files too. Except for the bootloader and the 
"ldlinux.*" modules, you should not forget that the c32 modules and 
the syslinux.cfg file use the same file name whether for BIOS or for 
EFI32 or for EFI64, so the risk of inadvertently overwriting a file 
would be higher. That's why I would suggest using respective relevant 
subdirectories, instead of the root of the filesystem.
 
> 
> Lots of redundancy here!
 
Sure, because you copied "everything", and you don't need 
"everything" copied. In fact, some of those files are not really 
needed at all.

Additionally, if the content of syslinux.cfg is the same for BIOS as 
for UEFI, you "could" potentially (in some cases) use it from the 
root of the filesystem. I don't recommend it as a general rule, but 
you "could". There are other possibilities too (e.g. CONFIG and/or 
INCLUDE directives, absolute and/or relative paths,...).

In particular, why would you need to copy the kernel and/or initrd 
files when you already have them in the root of the filesystem? There 
other alternatives, of course. And ldlinux.c32? And ldlinux.sys?
 
> Any advice on what should go where, and what files aren't actually
> needed, is most welcome.
> 
> Plugged it into my win8 laptop, and hey, it boots, or rather, started to:
> 
> Just wait 5 seconds for normal startup!
> For help press the <F2> key.
> Boot:
> Loading vmlinuz... ok
 
Seeing that message being displayed on the screen would suggest that 
you can successfully boot with Syslinux, but from the information you 
posted we don't really know whether you are booting in CSM or in UEFI 
mode. For a test, you might want to slightly change the boot message 
(or use several SAY directives in syslinux.cfg _instead_ of the 
DISPLAY boot message), as it would be an easy way to identify the 
boot mode.
 
> 
> My Quirky is 32-bit, so syslinux is handing over to the 32-bit kernel
> ok, I think.
 
But you are using Syslinux UEFI x86_64. Is the hardware UEFI x86_64 
or IA32? Some architecture / firmware / bootloader combinations are 
possible, and some not (yet).


The Syslinux Library modules wiki page 
http://www.syslinux.org/wiki/index.php/Library_modules won't answer 
each and every question, but it might slightly help.

I am also assuming that you are using official upstream binaries, 
version 6.03 final, downloaded from kernel.org. Other Syslinux 
binaries (from distros' packages, or re-built) are, generally 
speaking, not recommended for troubleshooting because they might make 
it harder for others to replicate the reported problems. To be clear, 
I am not saying that alternative binary files / versions will 
necessarily behave differently, but they might.
 
> 
> However, after that, nothing. I have to do a hard power-off by holding
> down the power button.
> 
> Why isn't my kernel outputting anything to the screen?
> 
> On a normal BIOS PC, kernel output is to a 80x25 text-mode screen, and
> a switch to a graphics mode happens later. I wonder if that is the
> reason?
> 
> But even if that were the cause of the problem, I should start seeing
> something after the switch to a graphics mode. Unless the kernel hangs
> before then.
> 
> Anyway, I was wondering if anyone reading this has any experience that
> might suggest why I have the hanging after the "ok".
> 
> Oh, I suppose for completeness, I should show the config of the kernel:
> 
> CONFIG_EFI_PARTITION=y
> CONFIG_EFI=y
> # CONFIG_EFI_STUB is not set
> # CONFIG_FB_EFI is not set
> CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
> # EFI (Extensible Firmware Interface) Support
> CONFIG_EFI_VARS=m
> # CONFIG_EFIVAR_FS is not set
> # CONFIG_EARLY_PRINTK_EFI is not set
> 
> ...hmm, is that last one the cause of the problem?
 
Regarding the configuration of the kernel, I am not sure / don't 
know. I would suggest first finding out which specific architecture 
you are actually using / booting (UEFI x86_64, UEFI IA32, or CSM). 
Other participants of this Syslinux Mailing List might have helpful 
information about this.
 
> 
> When I do get this working, I shall write it up, step by step, as
> guide to others.
> 
> Regards,
> Barry
> _______________________________________________
> Syslinux mailing list
> Submissions to Syslinux at zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux
> 

Regards,
Ady.


More information about the Syslinux mailing list