[systemd-devel] systemd initrd

Mantas Mikulėnas grawity at gmail.com
Wed Jun 28 17:38:38 UTC 2017


On Wed, Jun 28, 2017 at 5:00 PM, Michael Di Domenico <mdidomenico4 at gmail.com
> wrote:

> can anyone point me towards some howto's or documentation that shows
> how one might replace an existing busybox based initrd with a systemd
> one?
>
> obviously this is a bit of a loaded question as you have no idea what
> i'm doing in the initrd, but i'm not sure where to get started.  to
> break it down simply;
>
> with busybox, i can compile a kernel, compile busybox, add my junk to
> the init script and then make an initrd image that the kernel loads.
> at the end of the initrd if all "my junk" worked, I then switchroot to
> boot up a linux o/s
>
> i want to basically do the same thing with systemd, take a kernel,
> hand off to an initrd where systemd would start a shell if needed
> (like busybox does) or switchroot to boot up the o/s
>

It seems that you just need to use "initrd.target" as the default, and
stock systemd units will take care of the rest, falling back to
emergency.target as regular boot does.

This is the systemd module for Arch's mkinitcpio (although we still default
to busybox there):
https://aur.archlinux.org/cgit/aur.git/tree/initcpio-install-systemd?h=systemd-git#n103


-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170628/b1828c91/attachment.html>


More information about the systemd-devel mailing list