[systemd-devel] how to run a shell in my systemd initramfs before pivot root

Andrei Borzenkov arvidjaar at gmail.com
Tue Dec 27 11:08:06 UTC 2022


On 26.12.2022 22:56, marty leisner wrote:
> I'd like to be able to run a shell before completing the pivot (I'm running
> ubuntu core 20).
> 
> I'm well versed in systemV init, but not systemd.
> 
> How do I simulate the initramfs debugging methodology of "break=init" or
> "break=mount" using systemd (i.e. dropping into a
> shell)?
> 

You could have generator that creates service if specific parameter is 
present on kernel command line. The practical problem is that there is 
really no defined point "before the pivot" (or *before* any other 
target), i.e. you cannot order your service "after everything Before 
given target has completed".


More information about the systemd-devel mailing list