[Tutorial] Convert to systemd-boot

must be ef00 not msftdata efi

@dalto
The second last step didn’t run either. Are you suppose to run it from the current place you are in after the makepkg -i

Or am i supposed to do that from the normal open terminal user

It doesn’t matter where you run it from. What do you mean it “didn’t run”, what specific error did you get?

Also, did you fix all the earlier stuff? If anything doesn’t work the subsequent steps will also not work.

[ricklinux@eos-xfce ~]$ sudo #!/usr/bin/env bash

# Find the configured esp
esp=$(bootctl -p)

# Prepare the efi partition for kernel-install
machineid=$(cat /etc/machine-id)
if [[ ${machineid} ]]; then
    mkdir ${esp}/${machineid}
else
    echo "Failed to get the machine ID"
fi

# Run kernel install for all the installed kernels
while read -r kernel; do
    kernelversion=$(basename "${kernel%/vmlinuz}")
    echo "Installing kernel ${kernelversion}"
    kernel-install add ${kernelversion} ${kernel}
done < <(find /usr/lib/modules -maxdepth 2 -type f -name vmlinuz)
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
            [command]
usage: sudo [-AbEHknPS] [-C num] [-D directory] [-g group] [-h host] [-p
            prompt] [-R directory] [-T timeout] [-u user] [VAR=value] [-i|-s]
            [<command>]
usage: sudo -e [-AknS] [-C num] [-D directory] [-g group] [-h host] [-p prompt]
            [-R directory] [-T timeout] [-u user] file ...
mkdir: cannot create directory ‘/efi/2d4b045e204a44ef944ef9836c283074’: Permission denied
Installing kernel 5.11.11-arch1-1
depmod: ERROR: openat(/lib/modules/5.11.11-arch1-1, modules.dep.3592.227065.1617466559, 301, 644): Permission denied
depmod: ERROR: openat(/lib/modules/5.11.11-arch1-1, modules.dep.bin.3592.227065.1617466559, 301, 644): Permission denied
depmod: ERROR: openat(/lib/modules/5.11.11-arch1-1, modules.alias.3592.227065.1617466559, 301, 644): Permission denied
depmod: ERROR: openat(/lib/modules/5.11.11-arch1-1, modules.alias.bin.3592.227065.1617466559, 301, 644): Permission denied
depmod: ERROR: openat(/lib/modules/5.11.11-arch1-1, modules.softdep.3592.227065.1617466559, 301, 644): Permission denied
depmod: ERROR: openat(/lib/modules/5.11.11-arch1-1, modules.symbols.3592.227065.1617466559, 301, 644): Permission denied
depmod: ERROR: openat(/lib/modules/5.11.11-arch1-1, modules.symbols.bin.3592.227065.1617466559, 301, 644): Permission denied
depmod: ERROR: openat(/lib/modules/5.11.11-arch1-1, modules.builtin.bin.3592.227065.1617466559, 301, 644): Permission denied
depmod: ERROR: openat(/lib/modules/5.11.11-arch1-1, modules.builtin.alias.bin.3592.227065.1617466559, 301, 644): Permission denied
depmod: ERROR: openat(/lib/modules/5.11.11-arch1-1, modules.devname.3592.227065.1617466559, 301, 644): Permission denied
==> ERROR: Unable to write to path: `/efi/2d4b045e204a44ef944ef9836c283074/5.11.11-arch1-1/initrd'
==> ERROR: Unable to write to path: `/efi/2d4b045e204a44ef944ef9836c283074/5.11.11-arch1-1/initrd-fallback'
[ricklinux@eos-xfce ~]$ 

sudo doesn’t work like that.

Save it as a script, convert.sh. Then run sudo bash ./convert.sh

Can you explain that. I’m bash illiterate!
Are you saying that i use wget to download the script and then i have to run it from terminal as.

sudo ./ xxxxxx

Sure.

That is a script.

  • Open an editor.
  • Copy and paste the contents into the editor.
  • Save the file as convert.sh
  • From the terminal, cd to the location where you saved the file
  • Type sudo bash ./convert.sh
5 Likes

Do i have to chmod the file? It won’t run.
Edit: Sorry I labeled the file wrong? :man_facepalming:

Okay i got it working. The fall back entry is first in the menu but it works. The only issue I’m having is it won’t size v-box properly but that’s a v-box thing.

@dalto
Thanks … I learned a few more things.

2 Likes

@dalto
Are you going to put this in Discovery as a wiki?

1 Like

@dalto
I’m running this v-box on Arch. I get this when run updates in v-box of EndeavourOS that i tried systemd boot.

[ricklinux@eos-xfce ~]$ yay
[sudo] password for ricklinux: 
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
 endeavouros is up to date
:: Starting full system upgrade...
 there is nothing to do
:: Searching databases for updates...
:: Searching AUR for updates...
 -> Missing AUR Packages:  eos-systemd-boot
 there is nothing to do
[ricklinux@eos-xfce ~]$ 

Edit: Is that because your github package isn’t in the repo?

Yes, that is what AUR helpers do when you install a package that isn’t in the repos or AUR.

1 Like

An excellent tutorial, detailed, easy to follow. Now, I don’t have any intention to convert to systemd-boot just yet, but if did, I would be very grateful for such a wonderful tutorial! :slight_smile:

4 Likes

Purely out of interest, I always use systemd-boot and I always use /boot as my esp.

Yes it is an excellent tutorial and i just wanted to try it. I don’t have a lot of bash knowledge so i like to try different things that i know little about. That’s the way i learn. I really want to learn more bash skills. This is one of the reasons i find the Arch wiki so annoying because they assume everyone knows what they are talking about when they leave most of the critical how to out of the equation and just give you the technical info. That’s the way i see it any how. Stuff that i know is easy. Well most of the time. Sometimes i forget because i never write things down. :frowning:

3 Likes

<off-topic>
You’ll learn bash by doing. And reading tutorials help too.

Easiest may be to start your own small bash projects, e.g. writing some useful functions into your ~/.bashrc.
</off-topic>

5 Likes

This is the only real issue I have with systemd-boot.

Grub2 allows all kernels and grub config to reside inside a luks encrypted partition, systemd-boot forces these files to be in the unencrypted esp partition.

The only system unencrypted file, ideally, should be the efi stub.

Good tutorial though.

2 Likes

Yes. For me, it is isn’t a problem because all I care about encrypting is my data. However, if you have a need/want to protect more than that, I can see why you would prefer grub for that use case. For example, if you were trying to hide what OS you are running.

More about protecting crucial parts of the OS, kernels and bootloader config, than hiding the specific Linux variant being run.