OpenRC now has a proper sysinit runlevel with full dependencies. This now requires an init script for udevd, devfsd and mdevd. New init scripts have been created to mount the other knobs - sysfs, devfs and procfs has been modified. The cold/hotplugging has now been moved into one variable - rc_hotplug which is now a list of services to pass to fnmatch(3) using ! to negate as usual. If udev wants to have coldplugging separately ... well that's now up to udev. The upside is that the Linux init.sh now just mounts enough to get /lib/rc/init.d/ mounted as a ramdisk, which is just mounting /proc. So any changes in Linux like say new dev managers or bits they use can now be added without affecting OpenRC in the slightest.
Created attachment 167852 [details] udev init script Proposed udev init script. It provides dev so things can depend on it, like say lvm.
Created attachment 168486 [details, diff] udev-cosmetics.patch I propose this additional patch (only cosmetics), to be applied on top of Roy's script.
Created attachment 168490 [details, diff] openrc-9999.ebuild.patch This patch is also probably needed, otherwise OpenRC will complain about a non-existent 'sysinit' runlevel after rebooting (at least it did on my box). Should be applied on current sys-apps/openrc-9999 ebuild.
(In reply to comment #3) > Created an attachment (id=168490) [edit] > openrc-9999.ebuild.patch > > This patch is also probably needed, otherwise OpenRC will complain about a > non-existent 'sysinit' runlevel after rebooting (at least it did on my box). > Should be applied on current sys-apps/openrc-9999 ebuild. > I also proposed something similar to Cardoe, but this seems better. Should the ebuild also create a "shutdown" runlevel?
(In reply to comment #4) > Should the ebuild also create a "shutdown" runlevel? Not yet. We may have a runlevel in the future depending on the outcome of bug #224537
Created attachment 168694 [details] udev init script - update2 This init-script should be able to show the cold/hotplugged services, as the coldplug concept got deleted from openrc. Next todo-point: The udev-ebuild needs to add the udev-init-script to sysinit runlevel. This needs to be done, even if openrc is not new enough, else it will make sys unbootable after openrc update. Annoying issue: just copying this init-script into /etc/init.d, openrc whines about the needed sysfs service not existing. This could be solved by changing the if-condition of the depend to something like if [ -f /etc/init.d/sysfs ];
> [...] > local svc= services= bname > [...] bname seems unused...
(In reply to comment #6) > Annoying issue: just copying this init-script into /etc/init.d, openrc whines > about the needed sysfs service not existing. This could be solved by changing > the if-condition of the depend to something like if [ -f /etc/init.d/sysfs ]; udev does need sysfs - it should have been installed by OpenRC for you. Obviously it's not there for older versions, so it would need to be if-blocked then.
(In reply to comment #8) > > udev does need sysfs - it should have been installed by OpenRC for you. > Obviously it's not there for older versions, so it would need to be if-blocked > then. > Yes, this is what I wanted to add to the init-script: depend() { if [ -e /lib/librc.so -a -f /etc/init.d/sysfs ]; then # on baselayout-1 this causes # dependency-cycles with checkroot (before *) # require new enough baselayout-2 provide dev need sysfs before checkfs fsck fi } Second point: How should the openrc-ebuild know it need to add the sysinit-runlevel (which it does not yet do). The udev-ebuild also need to check if udev is currently enabled in openrc-config (the old one) and add udev init-script to sysinit runlevel in this case. (Using code like the magic add_boot_init from openrc.ebuild. BUT: This will make the propsed change to openrc-9999.ebuild/newer to be created openrc-ebuilds (0.4?) invalid. The check: if [ ! -d /etc/runlevels/sysinit ]; then cp -r sysinit /etc/runlevels/sysinit fi will not work if udev-ebuild does add services to this runlevel before. Don't tell me this wont happen, as it will definitly if I add the init-script to udev NOW, and users update before they get new openrc release. So openrc-ebuild may need more exact checking like this: if [ ! -e /etc/runlevels/sysinit/sysfs ]; then cp -r sysinit /etc/runlevels/sysinit fi Getting openrc-update before udev-update should be stopped by blockers to not allow reboot with too old udev (without init-script).
(In reply to comment #9) > Second point: > How should the openrc-ebuild know it need to add the sysinit-runlevel (which it > does not yet do). Why should it? As it's a need it gets pulled in by udev. If nothing needs it then nothing pulls it in, so it's not used by default. If the user wants it, he/she adds it to the desired runlevel. > The udev-ebuild also need to check if udev is currently enabled in > openrc-config (the old one) and add udev init-script to sysinit runlevel in > this case. (Using code like the magic add_boot_init from openrc.ebuild. I dislike this. No ebuild should automagically add an init script to the runlevel. Why should udev be an exception? All Gentoo stage tarballs ship with a static dev with enough nodes to get nearly everything running if the user doesn't add udev to the sysinit runlevel.
@vapier: Maybe you want to adjust the openrc-9999.ebuild for the new sysinit runlevel. If no other ebuild touches sysinit runlevel it is enough to add code like: if [[ ! -d ${ROOT}/etc/runlevels/sysinit ]]; then cp /usr/share/openrc/runlevels/sysinit ${ROOT}/etc/runlevels/sysinit fi If others touch the runlevel too, the condition may need to be changed to [[ ! -e ${ROOT}/etc/runlevels/sysinit/sysfs ]]
(In reply to comment #11) > If others touch the runlevel too, the condition may need to be changed to > [[ ! -e ${ROOT}/etc/runlevels/sysinit/sysfs ]] Make the condition check for Linux-2.6 kernels as it's only valid for that platform. sysfs won't work on say Linux-2.4 or FreeBSD.
I added almost this script to (for now masked) udev-130-r2 ebuild.
OK sweet :) Now nothing in OpenRC itself uses the *addon functions so I'm *very* tempted to remove them or at least get them to ewarn when they are used. Extending OpenRC should now be done via init scripts OR C plugins.
This won't happen in an ~arch version of OpenRC until there's a new release of OpenRC.
(In reply to comment #5) > (In reply to comment #4) > > Should the ebuild also create a "shutdown" runlevel? > > Not yet. > We may have a runlevel in the future depending on the outcome of bug #224537 > Since openrc from git now has a "shutdown" runlevel, too, I think someone should commit a patch similar to the one I proposed to copy the new runlevels (sysinit and shutdown) to /etc/runlevels/, at least for openrc-9999.ebuild. Please note that there's a typo in my patch: cp -RPp "${runlevel}" "${ROOT}"/etc should be: cp -RPp "${runlevel}" "${ROOT}"/etc/runlevels
What is the changes between the init-scripts in 130-r2 and 132? Afaiks they where the same, but is there any reason behind keeping 130-r2 and keeping it masked?
(In reply to comment #17) > What is the changes between the init-scripts in 130-r2 and 132? > Afaiks they where the same, but is there any reason behind keeping 130-r2 and > keeping it masked? > The init-scripts are identical and work (ignoring the thrown warnings with newest openrc). There is no reason to keep this masked, besides I have not done it yet due to time constraints. There will be more init-script changes in either udev-133 (when it is around, else some 132-rX version).
udev-133.ebuild now parses the config-files of baselayout or openrc and adds udev to runlevel sysinit if it was enabled in the parsed config-files. Please test if this works.
As udev-133 has an init-script and the ebuilds tries to add it to to sysinit runlevel this no longer is a blocker. So newer openrc ebuilds just need to add RDEPEND="!<sys-fs/udev-133"
Created attachment 174416 [details, diff] Let openrc-9999 install new runlevels sysinit and shutdown This patch lets openrc-9999 install the new runlevels sysinit and shutdown. Additionally it adds blocks against too old udev and sysvinit. @Vapier: Is it ok if I commit this?
(In reply to comment #21) > Created an attachment (id=174416) [edit] > Let openrc-9999 install new runlevels sysinit and shutdown > > This patch lets openrc-9999 install the new runlevels sysinit and shutdown. > Additionally it adds blocks against too old udev and sysvinit. > > @Vapier: > Is it ok if I commit this? > This patch has been committed. Anything else to be done here?
I've committed it but I haven't gone around closing bugs yet.