if you add realinitpath="<path1> <path2>" to dracut.conf, then it will
be written to $initdir/etc/cmdline.d/distroinit.conf with
"rd.distroinit=<path1> rd.distroinit=<path2>" and evaluated by
99base/init, when it searches for init.
add_dracutmodules+=" rpmversion "
stdloglvl=3
prefix=/run/initramfs
+realinitpath="/usr/lib/systemd/systemd"
# By the time we get here, the root filesystem should be mounted.
# Try to find init.
-for i in "$(getarg real_init=)" "$(getarg init=)" /sbin/init /etc/init /init /bin/sh; do
+for i in "$(getarg real_init=)" "$(getarg init=)" $(getargs rd.distroinit=) /sbin/init; do
[ -n "$i" ] || continue
__p=$(readlink -f "${NEWROOT}/${i}")
inst_hook cmdline 10 "$moddir/parse-root-opts.sh"
mkdir -p "${initdir}/var"
[ -x /lib/systemd/systemd-timestamp ] && inst /lib/systemd/systemd-timestamp
+ if [[ $realinitpath ]]; then
+ for i in $realinitpath; do
+ echo "rd.distroinit=$i"
+ done > "${initdir}/etc/cmdline.d/distroinit.conf"
+ fi
+
}