Assuing the kernel has anything required to start up built in (i.e.,
no modules are required to boot, mount the root, switch root, or 
mount any volumes described in /etc/fstab, access any resources
used for anything started via openrc or systemd), lvm.conf includes
"use_lvmetad = 1" in both the initrd and vg00/root.

I've tried tracing the logic produced by dracut to see why it failed,
but at over 1000 lines I do not have time to verify its logic and see
where it failed; ditto genkernel: there is too much logic to ignore 
checking modules that don't exist because they are in the kernel.

Looking at:

    <https://wiki.gentoo.org/wiki/Systemd>

I've verified that the options are set (including choosing systemd
as the init), /run is there, /mtab is what is should be, GRUB is
updated. 

The example below works perfectly with openrc, fails with systemd
(along with dracut results).

Q: What are the minimum steps/configuration required to set up and
   switch_root to systemd?

thanks

#!/bin/busybox sh

root='/mnt/root';
init='/sbin/init';

/bin/busybox --install -s;

mount /sys;
mount /proc;

lvm vgscan   -v;
lvm vgchange -v -a y;

mount /dev/vg00/root $root;

for i in $root/$init $root/usr $root/usr/bin
do
    # drop to shell if the root filesystem is botched.

    [ -e $i ] || exec /bin/busybox sh;
done

# seems bootable: init is there and /usr is mounted.

exec switch_root $root $init;

-- 
Steven Lembark                                           3646 Flora Pl
Workhorse Computing                                 St Louis, MO 63110
lemb...@wrkhors.com                                    +1 888 359 3508

Reply via email to