__          __             __
\ \_________\ \____________\ \___
 \  _ \  _\ _  \  _\ __ \ __\   /
  \___/\__/\__/ \_\ \___/\__/\_\_\
                      Bedrock Linux

Bedrock Linux 1.0beta2 Nyla


© Bedrock Linux 2012-2024
Linux® is a registered
trademark of Linus Torvalds

Syslinux Installation

Bedrock Linux itself is largely agnostic of which bootloader you choose to use. Syslinux installation is documented here rather than another bootloader primarily due to the fact it is relatively simple and easy to set up by hand. If you would prefer a different bootloader, such as GRUB or LILO, and you are confident you are able to set it up (with documentation from another source), you are welcome to use another bootloader. If you are dual booting with another operating system which has its own bootloader and you know how to add Bedrock Linux to the other operating system's bootloader, you are welcome to do that as well. If you are able to setup the system without a bootloader (e.g. leveraging EFI), that too is fine.

Syslinux is both the name of a project which contains multiple bootloaders and the name of one of the bootloaders within the project. If you are using ext2, ext3, ext4 or BTRFS as your filesystem, the "extlinux" bootloader from Syslinux should suffice. If you are using another filesystem, you can either look at another member of the Syslinux family which supports your filesystem or find a completely different bootloader. If you do choose to use a different syslinux bootloader, the steps should be largely the same, replacing "extlinux" with the bootloader of choice.

Download Syslinux from the official syslinux website. Be sure to read the specific pages for the given release in case there are any known issues. You should probably at least skim the contents of the doc/ directory in the tarball as well. If you are using BTRFS, you need at least version 4.0.

Note: These instructions were written for Syslinux 6.01. 6.02 has been found to have issues chain.c32. 6.03 has been released since this document was written, but it has not yet been tested.

Unpackage syslinux and change directories into the extlinux subdirectory in it:

Next, compile as a non-root user. If you are making this for non-EFI systems run:

If you are making it for 32-bit EFI systems, run:

Or, if you are making it for 64-bit EFI systems, run:

Remember which choice you made here, as you will need that information later.

You may receive an error about lacking nasm or uuid-dev or some other packages. If so, install those packages and try again.

You should now have an extlinux executable somewhere.

Once it has successfully compiled, switch to a root user and set a new variable indicating the location of the unpackaged source:

If you do not have a $ROOTFS variable pointing to the Bedrock Linux mount point from the installation instructions, make one:

Make a directory to install extlinux into:

Find the extlinux executable:

As root with the ROOTFS variable set, cd to the directory containing the extlinux executable and then install it into Bedrock Linux:

Although syslinux is installed on the partition, it still needs to be properly set up on the harddrive itself. Find the corresponding device file for device you made bootable when you partitioned/formatted earlier. Note that here we aren't looking for the partition device file - /dev/sdXN - but rather the device's file - /dev/sdX. There should be no 0-9 digit in the filename. As root:

Find the mbr.bin

If there are multiple results - one for each bios, efi32 and efi64 - use the one corresponding to which system you are using.

cd into the directory containing mbr.bin. Copy it over the desired drive's master boot record. Be very careful here.

Syslinux will need additional support files. You may read syslinux's documentation for what each of these do; however, unless you are short on disk space, it may be easiest to simply grab all of them. Again, like with mbr.bin, if there are multiple groups of results we want those corresponding to to your earlier choice of bios vs efi32 vs efi64. First, find the bios directory:

Next, copy all of the files ending in .c32 in this directory into the extlinux install directory.

Now you should create the configuration file for syslinux. Unlike GRUB, syslinux must be configured by hand. Assuming you want a graphical menu, run the following to get a basic menu in syslinux:

cat > $ROOTFS/boot/extlinux/extlinux.conf << EOF
UI menu.c32
MENU TITLE Syslinux Bootloader
DEFAULT bedrock
PROMPT 0
TIMEOUT 50

LABEL bedrock
    MENU LABEL Bedrock Linux 1.0beta2 Nyla
    LINUX ../vmlinuz-KERNEL-VERSION
    APPEND root=/dev/sdXN quiet rw init=/bedrock/sbin/brn
    INITRD ../initrd.img-VERSION
EOF

Consider changing the following:

If you would like to dual-boot with another operating system such as Windows, append the following:

cat >> /mnt/bedrock/boot/extlinux/extlinux.conf << EOF
LABEL LABEL NAME
    MENU LABEL Operating System Name
    COM32 chain.c32
    APPEND hdN N
EOF

Consider changing the following from this addition:

You should now have the syslinux bootloader installed. If it does not seem to work, consider installing a different syslinux release or trying out another bootloader.