EFI Multi boot setup

Multi boot setup with systemd-boot

The first step is  to create the EFI System Partition (ESP) Example:- /dev/sda1. This should preferably be the first partition and of at least 512MB type efi (Partition code EF00 in gdisk). Then create the /esp directory, mount it and move the vmlinuz-linux, intel-ucode.img and initramfs-linux.img files into the distro specific directory.

#mkdir /esp
#mount /dev/sda1 /esp
#mkdir /esp/archmain
#cd /boot
#mv * /esp/archmain

Bind Mount
This is the critical part. bind the the /boot directory to the distro specific directory so that updates to kernel, ramfs land up in the correct distro directory in the ESP.

#mount –bind /esp/archmain/ /boot
*****corresponding fstab entry
/boot/esp/archmain  /boot none defaults,bind 0 0

Setup systemd-boot
Now install systemd-boot to the ESP and configure the EFI loader

#bootctl –path=/boot install

default archmain
timeout 3

title Arch Main
linux /archmain/vmlinuz-linux
initrd /archmain/intel-ucode.img
initrd /archmain/initramfs-linux.img
options root=/dev/sda2 rw

Adding distros
For each distro use the same ESP. Just create a distro specific directory say archtest within the ESP and follow the same steps as above within the distro.

Author: admin

Indie Android dev

Leave a Reply

Your email address will not be published. Required fields are marked *