I wiped my /dev directory, and am populating it on bootup using (busybox) "mdev -s" (using the attached /init script). Apparently some device nodes are missing for /sbin/rc, which makes it segfault. The output is: rc[729] segfault at 0 ip 400b65a sp 7fff8dc68430 error 4 in rc[400000+19000] (I guess most of this line is quite useless to you, but maybe one of those numbers contains a hint for you, which I may not spot.) While I admit that having /dev nearly empty is quite a crazy action, I would like openrc to output an error message like "unable to open /dev/important, aborting boot". Reproducible: Always
Created attachment 180313 [details] /init script
PS: I just tested: Even when /dev is not unmounted before switching root, I assume that the /dev directory is not accessible by /sbin/rc after switching root. So openrc is probably always left with an entirely empty /dev when using my script. I now wonder why it is not populated using udev, or similar.
What you have is a shell-script part of an initramfs. It does switch root at the end. So /dev will be empty in this root, as you do not copy over /dev from the tmpfs. So your final system should call any dev manager (e.g. udev or mdev) or will have no device nodes. So you should make sure you have udev added to sysfs runlevel. About that segfault you should create a backtrace, but no idea how to easily do it. But I guess you should at least compile openrc with debug information. Maybe someone can at least tell you how to find out the source line from the ip value. Or if $root is rw, maybe you can force the kernel to write a core-dump.
I'll need a backtrace to fix this
or just create a qemu vhost ...