When ROOT is set to a location other than /, OpenRC creates /etc/runlevels/sysinit/udev and /etc/runlevels/sysinit/udev-mount with the wrong link targets. The targets are set to /different-root/etc/init.d/udev instead of /etc/init.d/udev for example. This means that when building a system in a chroot (/different-root), the system will not boot when /different-root becomes / because /different-root/etc/init.d/udev will not exist. In openrc-0.11.8.ebuild's add_boot_init(), the solution is the following: diff --git a/sys-apps/openrc/openrc-0.11.8.ebuild b/sys-apps/openrc/openrc-0.11.8.ebuild index 7f99d91..17de17e 100644 --- a/sys-apps/openrc/openrc-0.11.8.ebuild +++ b/sys-apps/openrc/openrc-0.11.8.ebuild @@ -159,7 +159,7 @@ add_boot_init() { fi elog "Auto-adding '${initd}' service to your ${runlevel} runlevel" - ln -snf "${EROOT}"etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd} + ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd} } add_boot_init_mit_config() { local config=$1 initd=$2 Reproducible: Always Steps to Reproduce: 1. Make sure openrc is not already installed in ROOT=/somewhere (udev init links are only created if it's not already installed) 2. ROOT=/somewhere emerge openrc Actual Results: neutronium ~ # ls -l /somewhere/etc/runlevels/sysinit/udev{,-mount} lrwxrwxrwx 1 root root 25 Feb 18 07:01 /somewhere/etc/runlevels/sysinit/udev -> /somewhere/etc/init.d/udev lrwxrwxrwx 1 root root 31 Feb 18 07:01 /somewhere/etc/runlevels/sysinit/udev-mount -> /somewhere/etc/init.d/udev-mount Expected Results: neutronium ~ # ls -l /somewhere/etc/runlevels/sysinit/udev{,-mount} lrwxrwxrwx 1 root root 25 Feb 18 07:01 /somewhere/etc/runlevels/sysinit/udev -> /etc/init.d/udev lrwxrwxrwx 1 root root 31 Feb 18 07:01 /somewhere/etc/runlevels/sysinit/udev-mount -> /etc/init.d/udev-mount
Update: it appears that sys-fs/udev-init-scripts-23 is doing the same thing. Similar fix: diff --git a/sys-fs/udev-init-scripts/udev-init-scripts-23.ebuild b/sys-fs/udev-init-scripts/udev-init-scripts-23.ebuild index ca85f64..ba93830 100644 --- a/sys-fs/udev-init-scripts/udev-init-scripts-23.ebuild +++ b/sys-fs/udev-init-scripts/udev-init-scripts-23.ebuild @@ -44,12 +44,12 @@ pkg_postinst() if [[ -x "${ROOT}"etc/init.d/udev \ && -d "${ROOT}"etc/runlevels/sysinit ]] then - ln -s "${ROOT}"etc/init.d/udev "${ROOT}"/etc/runlevels/sysinit/udev + ln -s /etc/init.d/udev "${ROOT}"/etc/runlevels/sysinit/udev fi if [[ -x "${ROOT}"etc/init.d/udev-mount \ && -d "${ROOT}"etc/runlevels/sysinit ]] then - ln -s "${ROOT}"etc/init.d/udev-mount \ + ln -s /etc/init.d/udev-mount \ "${ROOT}"etc/runlevels/sysinit/udev-mount fi fi
(In reply to comment #1) > Update: it appears that sys-fs/udev-init-scripts-23 is doing the same thing. > Similar fix: udev-init-scripts fixed in tree, leaving this bug open for Comment #0 (openrc)
The OpenRc ebuilds are now fixed in the tree as well; thanks for the report.
Thanks everyone!