[Tutorial] Convert to systemd-boot

@dalto :pray: this very interesting thread … if get time+will maybe write a wiki page on subject.

different options is what make linux great.

( i no alway agree you but what you give to community is true wonderful)

so Thank you …

9 Likes

@dalto I was trying to test getting Wayland working in GDM for another user by seeing if adding Force early load (KMS) [from EndeavourOS wiki] but when I edited the file and went to rebuild via sudo mkinitcpio -P I got errors thrown out (I have linux, linux-lts, & linux-zen installed) and I got an error saying my EFI is full. Before attempting this my EFI size was about 48% full. So now my EFI is 100% full and I’m not sure what to do.

How do I clear or clean out my EFI so that I can rebuild mkinitcpio or do I need to do something else I wonder? Thanks for any help

[scott@EndeavourOS ~]$ sudo nano /etc/mkinitcpio.conf
[scott@EndeavourOS ~]$ sudo mkinitcpio -P
==> Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: 'default'
  -> -k /efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/linux -c /etc/mkinitcpio.conf -g /efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/initrd
==> Starting build: 5.15.65-1-lts
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: xhci_pci
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: /efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/initrd
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: 'fallback'
  -> -k /efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/linux -c /etc/mkinitcpio.conf -g /efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/initrd-fallback -S autodetect
==> Starting build: 5.15.65-1-lts
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: aic94xx
==> WARNING: Possibly missing firmware for module: bfa
==> WARNING: Possibly missing firmware for module: qed
==> WARNING: Possibly missing firmware for module: qla1280
==> WARNING: Possibly missing firmware for module: qla2xxx
==> WARNING: Possibly missing firmware for module: wd719x
==> WARNING: Possibly missing firmware for module: xhci_pci
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: /efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/initrd-fallback
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/linux -c /etc/mkinitcpio.conf -g /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/initrd
==> Starting build: 5.19.7-arch1-1
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: xhci_pci
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/initrd
zstd: error 25 : Write error : No space left on device (cannot write compressed block) 
bsdtar: Write error
bsdtar: Write error
==> ERROR: Image generation FAILED: bsdtar (step 1) reported an error
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
  -> -k /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/linux -c /etc/mkinitcpio.conf -g /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/initrd-fallback -S autodetect
==> Starting build: 5.19.7-arch1-1
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: aic94xx
==> WARNING: Possibly missing firmware for module: bfa
==> WARNING: Possibly missing firmware for module: qed
==> WARNING: Possibly missing firmware for module: qla1280
==> WARNING: Possibly missing firmware for module: qla2xxx
==> WARNING: Possibly missing firmware for module: wd719x
==> WARNING: Possibly missing firmware for module: xhci_pci
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/initrd-fallback
zstd: error 25 : Write error : No space left on device (cannot write compressed block) 
bsdtar: Write error
bsdtar: Write error
==> ERROR: Image generation FAILED: bsdtar (step 1) reported an error
==> Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: 'default'
  -> -k /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/linux -c /etc/mkinitcpio.conf -g /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/initrd
==> Starting build: 5.19.7-zen2-1-zen
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: xhci_pci
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/initrd
zstd: error 25 : Write error : No space left on device (cannot write compressed block) 
bsdtar: Write error
bsdtar: Write error
==> ERROR: Image generation FAILED: bsdtar (step 1) reported an error
==> Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: 'fallback'
  -> -k /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/linux -c /etc/mkinitcpio.conf -g /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/initrd-fallback -S autodetect
==> Starting build: 5.19.7-zen2-1-zen
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: aic94xx
==> WARNING: Possibly missing firmware for module: bfa
==> WARNING: Possibly missing firmware for module: qed
==> WARNING: Possibly missing firmware for module: qla1280
==> WARNING: Possibly missing firmware for module: qla2xxx
==> WARNING: Possibly missing firmware for module: wd719x
==> WARNING: Possibly missing firmware for module: xhci_pci
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/initrd-fallback
zstd: error 25 : Write error : No space left on device (cannot write compressed block) 
bsdtar: Write error
bsdtar: Write error
==> ERROR: Image generation FAILED: bsdtar (step 1) reported an error
[scott@EndeavourOS ~]$

Err…something is wrong there.

Rebuilding should overwrite the existing ones.

Can you share a couple of things.

sudo find /efi
ls /usr/lib/modules
[scott@EndeavourOS ~]$ sudo find /efi
[sudo] password for scott: 
/efi
/efi/EFI
/efi/EFI/boot
/efi/EFI/boot/bootx64.efi
/efi/EFI/systemd
/efi/EFI/systemd/systemd-bootx64.efi
/efi/EFI/Linux
/efi/loader
/efi/loader/entries
/efi/loader/entries/5f36d8c0aa64460e9be33539d6a364bd-5.15.65-1-lts.conf
/efi/loader/entries/5f36d8c0aa64460e9be33539d6a364bd-5.15.65-1-lts-fallback.conf
/efi/loader/entries/5f36d8c0aa64460e9be33539d6a364bd-5.19.7-arch1-1.conf
/efi/loader/entries/5f36d8c0aa64460e9be33539d6a364bd-5.19.7-arch1-1-fallback.conf
/efi/loader/entries/5f36d8c0aa64460e9be33539d6a364bd-5.19.7-zen2-1-zen.conf
/efi/loader/entries/5f36d8c0aa64460e9be33539d6a364bd-5.19.7-zen2-1-zen-fallback.conf
/efi/loader/loader.conf
/efi/loader/random-seed
/efi/loader/entries.srel
/efi/5f36d8c0aa64460e9be33539d6a364bd
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/initrd
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/initrd-fallback
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/linux
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/intel-ucode.img
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/initrd
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/initrd-fallback
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/linux
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/intel-ucode.img
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/initrd
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/initrd-fallback
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/linux
/efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/intel-ucode.img
[scott@EndeavourOS ~]$ ls /usr/lib/modules
5.15.65-1-lts  5.19.4-arch1-1  5.19.5-arch1-1  5.19.6-arch1-1  5.19.7-arch1-1  5.19.7-zen2-1-zen

Err…

df -h
find /efi/5f36d8c0aa64460e9be33539d6a364bd -type f -exec ls -lh {} \; 
[scott@EndeavourOS ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
dev             7.8G     0  7.8G   0% /dev
run             7.8G  1.7M  7.8G   1% /run
/dev/sda2       230G  148G   80G  66% /
tmpfs           7.8G   97M  7.7G   2% /dev/shm
tmpfs           7.8G   12M  7.8G   1% /tmp
/dev/sda2       230G  148G   80G  66% /home
/dev/sda2       230G  148G   80G  66% /var/log
/dev/sda2       230G  148G   80G  66% /var/cache
/dev/sda1       300M  300M     0 100% /efi
tmpfs           1.6G   80K  1.6G   1% /run/user/1000
[scott@EndeavourOS ~]$ find /efi/5f36d8c0aa64460e9be33539d6a364bd -type f -exec ls -lh {} \;
-rwxr-xr-x 1 root root 65M Sep  6 14:27 /efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/initrd
-rwxr-xr-x 1 root root 89M Sep  6 14:27 /efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/initrd-fallback
-rwxr-xr-x 1 root root 11M Sep  6 14:09 /efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/linux
-rwxr-xr-x 1 root root 5.0M Sep  6 14:09 /efi/5f36d8c0aa64460e9be33539d6a364bd/5.15.65-1-lts/intel-ucode.img
-rwxr-xr-x 1 root root 22M Sep  6 14:27 /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/initrd
-rwxr-xr-x 1 root root 35M Sep  6 14:27 /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/initrd-fallback
-rwxr-xr-x 1 root root 11M Sep  6 14:09 /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/linux
-rwxr-xr-x 1 root root 5.0M Sep  6 14:09 /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-arch1-1/intel-ucode.img
-rwxr-xr-x 1 root root 8.8M Sep  6 14:27 /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/initrd
-rwxr-xr-x 1 root root 36M Sep  6 14:27 /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/initrd-fallback
-rwxr-xr-x 1 root root 12M Sep  6 14:09 /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/linux
-rwxr-xr-x 1 root root 5.0M Sep  6 14:09 /efi/5f36d8c0aa64460e9be33539d6a364bd/5.19.7-zen2-1-zen/intel-ucode.img

It looks like the changes you made to mkinitcpio.conf made your initrams much bigger. You are probably including more in them now. I mean the LTS kernel alone is taking up 170MB now.

From here here you have some choices:

  • Revert those changes
  • Make you EFI partition bigger
  • Add an XBOOTLDR partition
  • Don’t build fallback initrds
  • Install only one kernel
  • Pull apart the initramfs and try to see why it got so big(probably your entire gpu driver is now inside it)

So if I just undo the mkinitcpio changes I did, which was adding MODULES="crc32c-intel nvidia nvidia_modeset nvidia_uvm nvidia_drm" and revert it to just MODULES="crc32c-intel" like it was before and rebuild mkinitcipo again or?

Yes, revert that change and then run sudo mkinitcpio -P

As a side note, if you are just helping someone test, after you get it all fixed again, you could run mkinitcpio -p on just one of your kernels for testing purposes.

1 Like
[scott@EndeavourOS ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
dev             7.8G     0  7.8G   0% /dev
run             7.8G  1.7M  7.8G   1% /run
/dev/sda2       230G  148G   80G  66% /
tmpfs           7.8G   86M  7.7G   2% /dev/shm
tmpfs           7.8G   12M  7.8G   1% /tmp
/dev/sda2       230G  148G   80G  66% /home
/dev/sda2       230G  148G   80G  66% /var/log
/dev/sda2       230G  148G   80G  66% /var/cache
/dev/sda1       300M  174M  126M  59% /efi
tmpfs           1.6G   92K  1.6G   1% /run/user/1000

Okay, reverting and rebuilding brought my EFI back down to 59% which is what it was at before, so looks like I’m good now. Man, I’m really bad at dealing with systemd-boot stuff. But yeah you’re right I’ll try to give it a go on just one of the kernels and see. Been debating since this grub to systemd-boot switch if I truly even need 3 kernels, contemplating giving the zen one the chopping block, but we shall see. Thanks again for the super quick help to get me back up to speed!

Okay I think I’ll just remove the linux-zen is it enough to do sudo pacman -Rs linux-zen or does it make much of a difference if I use -Rc? More importantly though, do I need to rebuild anything after removing a kernel or does your kernel-install-mkinitcpio package take care of that in any way? I know earlier in this post I had edited some loader configs in order for it to always default to booting to the linux kernel which I am still keeping of course. Appreciate your patience, I think this is the last question I’ll have for a while here :wink:

They remove dependencies in different directions. -Rc removes packages that depend on linux-zen. -Rs removes dependencies of linux-zen

It should take care of everything for you.

1 Like

I have a similar question, AMD/Nvidia GPU related. I have AMDGPU and Nvidia 3060 in my laptop. Since i changed from grub to systemd-boot i can only boot in hybrid GPU mode. Booting to Nvidia mode only provides me a black screen.

When i was still on Grub everything was working perfectly, it only started when i went systemd-boot. I presume it’s some settings somewhere but after now 6-7 days i can’t seem to find what to change and where. It’s not a big deal for me but i’d like to use the bloody Nvidia card also.

Hope someone could give me good advice here on what to do.

Thanks

Are you using mkinitcpio or dracut?

mkinitcpio

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES="crc32c

That is quite interesting. In that case, your initrams would be the same as before. I am not sure what could have changed. I suppose your kernel params could be different but they shouldn’t be because it starts with the current params.

I must mention this, i installed a fresh EOS (offline install) and then converted to systemd-boot.

So my ā€œoldā€ mkinitcpio was gone for sure.

Hey idea!! I still have a second laptop with Grub and EOS installed, i’ll have a peep in that one also.

edit: the other system has a old intel i3-2330M installed. mkinitcpio shows MODULES=ā€œcrc32c-intelā€
My new system has an AMD cpu and MODULES=ā€œcrc32cā€, i wonder it that should not be crc32c-amd (if that exists of course)

Maybe you setup early kms loading for Nvidia before?

Need to check as to be honest i’ll need to read on what this exactly means what you’re referring to.

Edit: I’ll keep reading further and hopefully can provide feedback to you on the solution. Thanks @dalto

Not an expert on this topic, but when I switched I had nvidia-drm.modeset=1 in my /etc/default/grub and when I switched to systemd-boot (which did this for me automatically I believe), that nvidia code got put into somewhere else I believe, but I can’t remember where I’ll have to re-read all these comments above and see if I can find it, but that might be an area to look into to get nvidia GPU booting properly maybe.