# Systemd-boot and dracut

**URL:** <https://forum.endeavouros.com/t/systemd-boot-and-dracut/25054>\
**Category:** Applications\
**Created:** [March 15, 2022, 9:01am UTC](https://forum.endeavouros.com/t/systemd-boot-and-dracut/25054 "2022-03-15T09:01:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbod](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/mbod/32/16833_2.png) [@mbod](https://forum.endeavouros.com/u/mbod)\
**Post date:** [March 15, 2022, 9:01am UTC](https://forum.endeavouros.com/t/systemd-boot-and-dracut/25054/1 "2022-03-15T09:01:37Z")

</div>

Over the weekend I switched my PC over to systemd-boot and dracut, replacing grub and mkinicpio.

Thanks to @dalto tutorial ([[Tutorial] Convert to systemd-boot](https://forum.endeavouros.com/t/tutorial-convert-to-systemd-boot/13290)) the migration to systemd-boot was working like a charm.

Everything is working fine. I have hooks implemented for pacman to automatically create initrd and systemd-boot conf files. My hooks make use of `kernel-install` from `systemd`.

Now I am wondering what the best way is to manage the kernel commandline. dracut offers a kernel\_cmdline option. But this is somehow not taken over by `kernel_install` when it creates the \*.conf files for systemd-boot.

So what is the dracut `kernel_cmdline` option good for? Does anybody know?

---

<div class="post-metadata">

**Author:** ![dalto](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/dalto/32/5577_2.png) [@dalto](https://forum.endeavouros.com/u/dalto)\
**Post date:** [March 15, 2022, 11:10am UTC](https://forum.endeavouros.com/t/systemd-boot-and-dracut/25054/2 "2022-03-15T11:10:30Z")

</div>

I haven’t tried dracut on Arch yet but by default kernel-install first looks at `/etc/kernel/cmdline` and if it is not present uses the command line from the running system.

So, you could either just let it use the running commandline and change that when you want changes or you could set your kernel options in `/etc/kernel/cmdline`. I do the latter because that way the kernel options will be correctly generated in a chroot.

---

<div class="post-metadata">

**Author:** ![mbod](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/mbod/32/16833_2.png) [@mbod](https://forum.endeavouros.com/u/mbod)\
**Post date:** [March 15, 2022, 11:35am UTC](https://forum.endeavouros.com/t/systemd-boot-and-dracut/25054/3 "2022-03-15T11:35:57Z")

</div>

> [@dalto](#):
>
> you could set your kernel options in `/etc/kernel/cmdline`

This is how I do it as well. I had no choice because this is how kernel-install with systemd-boot works. But that then means that I do not have to give another kernel commandline with dracut I assume.

---

<div class="post-metadata">

**Author:** ![dalto](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/dalto/32/5577_2.png) [@dalto](https://forum.endeavouros.com/u/dalto)\
**Post date:** [March 15, 2022, 11:41am UTC](https://forum.endeavouros.com/t/systemd-boot-and-dracut/25054/4 "2022-03-15T11:41:18Z")

</div>

> [@mbod](#):
>
> But that then means that I do not have to give another kernel commandline with dracut I assume.

Correct. kernel-install is probably using that to explicitly set the commandline in dracut.

You can see what it is doing exactly by reading the scripts in `/usr/lib/kernel/install.d/`

---

<div class="post-metadata">

**Author:** ![mbod](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/mbod/32/16833_2.png) [@mbod](https://forum.endeavouros.com/u/mbod)\
**Post date:** [March 16, 2022, 7:48am UTC](https://forum.endeavouros.com/t/systemd-boot-and-dracut/25054/5 "2022-03-16T07:48:43Z")

</div>

And, by the way, dracut is coming with plugins for systemd-boot resp. kernel-install:

```auto
# ls /usr/lib/kernel/install.d
50-depmod.install 50-dracut.install 51-dracut-rescue.install 90-loaderentry.install

```

Very nice! It automatically creates the initrd when kernel-install is executed.
