Discussion:
systemd initrd
Add Reply
Michael Di Domenico
2017-06-28 14:00:53 UTC
Reply
Permalink
Raw Message
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

i know systemd doesn't provide all the little utils that busybox does,
but that's okay, i can just pull them into the initrd

i've spun myself in google circles at this point and need some
straightening out and the system switch-root/initrd pages are a little
to terse
Zbigniew Jędrzejewski-Szmek
2017-06-28 14:43:52 UTC
Reply
Permalink
Raw Message
Post by Michael Di Domenico
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?
See dracut(8).

Zbyszek
Post by Michael Di Domenico
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
i know systemd doesn't provide all the little utils that busybox does,
but that's okay, i can just pull them into the initrd
i've spun myself in google circles at this point and need some
straightening out and the system switch-root/initrd pages are a little
to terse
Mantas Mikulėnas
2017-06-28 17:38:38 UTC
Reply
Permalink
Raw Message
Post by Michael Di Domenico
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 <***@gmail.com>
Loading...