3.7 Appendix: clean up the discussion of SYSLINUX for legacy boot mode

This commit is contained in:
John McQuah 2022-08-08 21:47:51 -04:00
parent 5b71e4e5de
commit 3486eab4dd
1 changed files with 20 additions and 21 deletions

View File

@ -101,30 +101,31 @@ the newer GPT (GUID) partition table is supported by
partition table looks like. An identification of the exact partition type (DOS
or GPT) will appear next to ''Disklabel type:'' in the fdisk output.
-> Also inspect the @@fdisk -l@@ output to make sure that the boot flag is
enabled on the partition where you save %fn%ldlinux.c32%% in the commands
below. This partition must be flagged as bootable in order for the binary
blob to proceed with loading the syslinux code.
Once you determine the binary blob that will work with your partition table, run
the commands that will copy that binary blob into the master boot record.
'''Remember to replace ''sda'' with your actual device.'''
'''Remember to replace ''sda'' with your actual device. The first command sets
''INSTALLDIR'' as the path to a directory on a vfat or ext2/3/4 filesystem
('''which must be flagged as bootable in the partition table'''). In this
example we use a path that minimizes the hassle when toggling your BIOS between
UEFI and legacy boot methods. A less confusing option is commented out, for
BIOSes that truly have no UEFI capability.'''
$ INSTALLDIR=/boot/efi/EFI/BOOT # or /boot/syslinux
$ PTYPE=$(fdisk -l /dev/sda | grep "^Disklabel type" | cut -d " " -f3)
$ [ "$PTYPE" = "gpt" ] && BINBLOB=gptmbr.bin || BINBLOB=mbr.bin
$ mkdir -p /boot/efi/BOOT
$ cd /boot/efi/BOOT
$ mkdir -p $INSTALLDIR
$ cd $INSTALLDIR
$ cp /usr/share/syslinux/ldlinux.c32 .
$ extlinux --install /boot/efi/BOOT/
$ extlinux --install $INSTALLDIR
$ dd bs=440 count=1 conv=notrunc if=/usr/share/syslinux/$BINBLOB of=/dev/sda
$ vi syslinux.cfg
-> The @@extlinux@@ command takes a ''directory of the mounted EFI system
partition'' as its argument, rather than a device node. Upstream documentation
begins with an example of calling the @@syslinux@@ command with the ''device
node'' as its argument, which assumes that the EFI system partition is not
mounted. Because you're already creating files on this partition, we demonstrate
the command that won't require you to unmount the partition before running it.
-> The @@extlinux@@ command takes a ''directory under a mounted partition'' as
its argument, rather than a device node. Upstream documentation begins with an
example of calling the @@syslinux@@ command with the ''device node'' as its
argument, which assumes that the partition is not mounted. Because you're
already creating files on this partition, we demonstrate the command that won't
require you to unmount the partition before running it.
The @@extlinux@@ command is also smart enough to set its argument (the ''install
target'') as the directory to be searched for configuration files, so you can
proceed to launch the editor on %fn%syslinux.cfg%% (see the next section for a
@ -148,12 +149,10 @@ label CRUX-3.7
@]
When giving the location of a kernel image, relative paths are interpreted in
reference to the %fn%syslinux.cfg%% file. In the example above, where
@@extlinux@@ assigned %fn%/boot/efi/BOOT/%% as the preferred location for
reference to the %fn%syslinux.cfg%% file. In the example above, if
@@extlinux@@ assigned %fn%/boot/efi/EFI/BOOT/%% as the preferred location for
%fn%syslinux.cfg%%, the kernel would have to be copied to
%fn%/boot/efi/BOOT/vmlinuz-5.15.55%%. Saving kernels here (in the BOOT
subdirectory of the EFI system partition) is a common practice when using the
kernel itself as a bootloader; see the next section for more details.
%fn%/boot/efi/EFI/BOOT/vmlinuz-5.15.55%%.
[[#EFI-stub-install]]
!! EFI Stub installation notes
@ -186,7 +185,7 @@ you leave the boot options empty during kernel configuration, and the BIOS does
not honor your appended options, you might have to boot from a rescue disk to
get back into your system and fix things.
* Copy your built kernel to the BOOT subdirectory of the EFI system partition
* Copy your built kernel to a subdirectory of the EFI system partition
(mounted at %fn%/boot/efi%%). For maximum compatibility, save it with the
extension %fn%.efi%%.