Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 458156 - sys-apps/openrc-0.11.8 creates /etc/runlevels/sysinit/udev with wrong target when ROOT is not /
Summary: sys-apps/openrc-0.11.8 creates /etc/runlevels/sysinit/udev with wrong target ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-18 18:34 UTC by smkbot
Modified: 2013-03-13 20:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description smkbot 2013-02-18 18:34:17 UTC
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
Comment 1 smkbot 2013-02-18 22:53:01 UTC
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
Comment 2 Samuli Suominen gentoo-dev 2013-03-10 17:46:00 UTC
(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)
Comment 3 William Hubbs gentoo-dev 2013-03-10 21:00:08 UTC
The OpenRc ebuilds are now fixed in the tree as well; thanks for the
report.
Comment 4 smkbot 2013-03-13 20:59:01 UTC
Thanks everyone!