On Sat, 30 Nov 2019, Ankele zhang wrote:
> Hello All:
>     How to execute shell before rootfs mounted on CentOS7.
>     On CentOS6, we can modify init shell in initramfs.img to do something
> we need. But on CentOS7 my beloved init has be changed to systemd and
> systemd has no shell script.

CentOS 7 uses Dracut [1] for its initramfs. With Dracut, you can use 
`rd.break=mount` to the kernel command-line to instruct Dracut to launch a 
shell just before it mounts the new root filesystem.

See the dracut.cmdline(7) manpage [2] for further details.

[1] https://dracut.wiki.kernel.org/
[2] http://man7.org/linux/man-pages/man7/dracut.cmdline.7.html
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to