Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 495086 - sys-fs/udev-init-scripts-26 on boot /lib/udev/dev-root-link.sh not found
Summary: sys-fs/udev-init-scripts-26 on boot /lib/udev/dev-root-link.sh not found
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-23 07:34 UTC by Thomas Rausch
Modified: 2013-12-31 20:45 UTC (History)
1 user (show)

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


Attachments
sed in udevdir in the Makefile (udevdir.patch,1.47 KB, patch)
2013-12-29 00:48 UTC, Mike Gilbert
Details | Diff
0001-Move-code-from-dev-root-link-helper-to-udev-init-scr.patch (0001-Move-code-from-dev-root-link-helper-to-udev-init-scr.patch,2.74 KB, patch)
2013-12-29 04:06 UTC, William Hubbs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Rausch 2013-12-23 07:34:20 UTC
See "equery f sys-fs/udev-init-scripts-26" correction please:

--- /etc/init.d/udev~   2013-12-19 17:07:32.000000000 +0100
+++ /etc/init.d/udev    2013-12-23 08:27:21.000000000 +0100
@@ -97,7 +97,7 @@
 {
        if yesno ${rc_dev_root_symlink:-yes}; then
                ebegin "Generating a rule to create a /dev/root symlink"
-               /lib/udev/dev-root-link.sh
+               /usr/lib/udev/dev-root-link.sh
                eend $?
        fi


Reproducible: Always
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-12-23 07:39:29 UTC
No. udev scripts belong to /lib/udev/ and that's already correct in the ebuild:

# equery f sys-fs/udev-init-scripts-26 | grep dev-root-link.sh
/lib/udev/dev-root-link.sh
Comment 2 Thomas Rausch 2013-12-23 07:50:58 UTC
Question:

My *.sh script is in

# equery f sys-fs/udev-init-scripts-26 | grep dev-root-link.sh
/usr/lib/udev/dev-root-link.sh

And in my /etc/init.d/udev - file:

# grep -n dev-root-link.sh /etc/init.d/udev
100:            /lib/udev/dev-root-link.sh
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-12-23 07:55:40 UTC
Seems like you forgot to etc-update the udev init script after installation of sys-fs/udev-init-scripts-26. Re-install the package, etc-update udev init script and you should have the script pointing to the correct location of dev-root-link.sh.
Comment 4 Thomas Rausch 2013-12-23 08:11:05 UTC
No, because:

# tar jxf /usr/portage/distfiles/udev-init-scripts-26.tar.bz2
# grep -n dev-root-link.sh udev-init-scripts-26/init.d/udev
100:            /lib/udev/dev-root-link.sh


emerge --info | grep 'Timestamp of tree'
Timestamp of tree: Mon, 23 Dec 2013 06:15:01 +0000
Comment 5 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-12-23 08:32:38 UTC
Fair enough. Sorry that I misread comment 2 (it's still a bit early in the morning here).
I suppose you got the udev-init-scripts as dependency of sys-apps/systemd. In that case /lib/udev/ directory is correct and this might be a valid bug. 

I apologize for the circumstances.

Please be a bit more verbose in your bug description next time or else something like this might happen again.
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-12-23 08:35:21 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #5)
> In that case /lib/udev/ directory is correct and this might be a valid bug. 
> 
I mean /usr/lib/udev is correct (*sigh*)
Comment 7 Thomas Rausch 2013-12-23 08:38:19 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #5)

> Please be a bit more verbose in your bug description next time or else
> something like this might happen again.

My english verry bad. Sorry.
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2013-12-23 14:02:09 UTC
right, something like this should be applied and udev-init-scripts-27 released:

--- udev-init-scripts-26/init.d/udev
+++ udev-init-scripts-26/init.d/udev
@@ -97,7 +97,12 @@
 {
 	if yesno ${rc_dev_root_symlink:-yes}; then
 		ebegin "Generating a rule to create a /dev/root symlink"
-		/lib/udev/dev-root-link.sh
+		scripts="/lib/udev/dev-root-link.sh /usr/lib/udev/dev-root-link.sh"
+		for f in ${scripts}; do
+			if [ -x "${f}" ]; then
+				"${f}"
+			fi
+		fi
 		eend $?
 	fi
 
WilliamH, can you handle it?
Comment 9 Mike Gilbert gentoo-dev 2013-12-23 15:14:19 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #6)
> (In reply to Lars Wendler (Polynomial-C) from comment #5)
> > In that case /lib/udev/ directory is correct and this might be a valid bug. 
> > 
> I mean /usr/lib/udev is correct (*sigh*)

Most Gentoo systemd systems have /lib/udev as udevdir. The exceptions would be systems that had systemd before we changed the systemd ebuild to use the get_udevdir function from udev.eclass.

Anyway, Samuli's change looks ok; alternatively, we could sed in udevdir from the Makefile or the ebuild.
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2013-12-23 17:46:14 UTC
(In reply to Mike Gilbert from comment #9)
> (In reply to Lars Wendler (Polynomial-C) from comment #6)
> > (In reply to Lars Wendler (Polynomial-C) from comment #5)
> > > In that case /lib/udev/ directory is correct and this might be a valid bug. 
> > > 
> > I mean /usr/lib/udev is correct (*sigh*)
> 
> Most Gentoo systemd systems have /lib/udev as udevdir. The exceptions would
> be systems that had systemd before we changed the systemd ebuild to use the
> get_udevdir function from udev.eclass.

I'm not aware of such an change. I believe udevdir= value in udev.pc on systemd bases systems points to /usr/lib/udev because systemd is installed into /usr on Gentoo

> Anyway, Samuli's change looks ok; alternatively, we could sed in udevdir
> from the Makefile or the ebuild.

My patch follows the existing format used for udevd binary location in the same init script.
Comment 11 Samuli Suominen (RETIRED) gentoo-dev 2013-12-23 17:48:05 UTC
(In reply to Mike Gilbert from comment #9)
> alternatively, we could sed in udevdir from the Makefile or the ebuild.

plus it's a bad idea anyway, it would make re-emerging udev-init-scripts on the sys-fs/udev <-> sys-apps/systemd change mandatory

making pkg-config a RDEPEND of udev-init-scripts and calling pkg-config --variable=udevdir from it would be a possibility, but considering pkg-config pulls in glib-2 by default, lets just use my patch...
Comment 12 Mike Gilbert gentoo-dev 2013-12-23 18:54:45 UTC
(In reply to Samuli Suominen from comment #10)
> I'm not aware of such an change. I believe udevdir= value in udev.pc on
> systemd bases systems points to /usr/lib/udev because systemd is installed
> into /usr on Gentoo

We do this in the ebuild:

    # Keep using the one where the rules were installed.
    MY_UDEVDIR=$(get_udevdir)
...
    local mymakeopts=(
        udevlibexecdir="${MY_UDEVDIR}"
    )

This has the following effects depending on the system state when building systemd:

If neither udev nor systemd is installed, get_udevdir returns "/lib/udev" and this gets copied into udev.pc.

If either udev or systemd is installed, get_udevdir returns whatever is in /usr/share/pkgconfig/udev.pc. In most cases this is "/lib/udev".

If systemd was previously installed from a long time ago, /usr/share/pkgconfig/udev.pc will contain "/usr/lib/udev".
Comment 13 William Hubbs gentoo-dev 2013-12-28 01:44:22 UTC
This is also related to bug #472792. If systemd were installed as suggested in that bug, this would not be an  issue.
Comment 14 William Hubbs gentoo-dev 2013-12-28 02:12:57 UTC
From where I am sitting, this is not a bug in the udev init scripts, but
it is one more reason for systemd to fix their installation.
Comment 15 Mike Gilbert gentoo-dev 2013-12-28 02:42:22 UTC
(In reply to William Hubbs from comment #13)
> This is also related to bug #472792. If systemd were installed as suggested
> in that bug, this would not be an  issue.

The udev-init-scripts Makefile installs dev-root-link.sh based on pkg-config, yet hard-codes the path as "/lib/udev" in the init script. That is plainly broken.
Comment 16 Mike Gilbert gentoo-dev 2013-12-28 02:58:11 UTC
Thomas: I would recommend you do the following while we argue about this.

1. rm /usr/share/pkgconfig/udev.pc
2. emerge --oneshot sys-apps/systemd
3. emerge --oneshot /usr/lib/udev

The third step will re-install any packages that have installed udev rules/scripts in /usr/lib/udev, moving them to /lib/udev.
Comment 17 William Hubbs gentoo-dev 2013-12-28 05:13:48 UTC
The makefile installs the script in the directory where udev helpers are
to be installed. I hard code the path in the init script because
the helpers directory is not in PATH and it shouldn't be.
I may be able to accomodate this by moving the helper code into the init
script itself. However, speaking as a systemd team member, this is just
another bug that has ben caused by our non-standard systemd
installation. Since this is the root cause, and since we don't really
knowhow many more bugs like this will turn up, I strongly prefer that we
reconsider our systemd installation in /usr and fix it as suggested in
the bug I referred to.
Comment 18 Mike Gilbert gentoo-dev 2013-12-28 06:34:18 UTC
Where did I say anything about touching PATH?

I'm saying that installing the script based on pkg-config, and then hard-coding the path elsewhere is inconsistent and broken by design. Either hard-code it in both places, or use pkg-config (via sed) in both places.

Stop trying to turn this into some proof that the systemd ebuild is broken. It's not.
Comment 19 Mike Gilbert gentoo-dev 2013-12-28 06:36:40 UTC
Also, as I stated in comment 9 and comment 11, the majority of system users already have udev helpers in /lib/udev; only a small minority of long-time system users will have it in /usr/lib/udev.

There is absolutely no need to move all of systemd to solve this stupid little problem.
Comment 20 Thomas Rausch 2013-12-28 08:12:48 UTC
(In reply to Mike Gilbert from comment #16)
> Thomas: I would recommend you do the following while we argue about this.
> 
> 1. rm /usr/share/pkgconfig/udev.pc
> 2. emerge --oneshot sys-apps/systemd
> 3. emerge --oneshot /usr/lib/udev
> 
> The third step will re-install any packages that have installed udev
> rules/scripts in /usr/lib/udev, moving them to /lib/udev.

"emerge -1 sys-apps/systemd" change nothing on /usr/share/pkgconfig/udev.pc.
before: udevdir=/usr/lib/udev
after: udevdir=/usr/lib/udev

But i remove /usr/share/pkgconfig/udev.pc and then "emerge -1 sys-apps/systemd":
before: udevdir=/usr/lib/udev
after: udevdir=/lib/udev

Step 3 builds 25 packages.
Comment 21 Mike Gilbert gentoo-dev 2013-12-29 00:48:22 UTC
Created attachment 366398 [details, diff]
sed in udevdir in the Makefile

Here is a patch that hopefully clarifies what I am trying to express here.

Samuli indicated that he doesn't like this approach, but it is an improvement over than the current situation where some users must manually remove udev.pc and reinstall everything with files in /usr/lib/udev.

Again, I'm fine with either Samuli's patch or mine, since either will resolve the problem without forcing manual intervention by end users.
Comment 22 William Hubbs gentoo-dev 2013-12-29 04:06:55 UTC
Created attachment 366404 [details, diff]
0001-Move-code-from-dev-root-link-helper-to-udev-init-scr.patch

I would prefer this fix.
It deletes the helper script and makes it a function inside the
udev init script since that is the only place it is run.
Comment 23 Mike Gilbert gentoo-dev 2013-12-29 17:13:35 UTC
That's an ok idea.

It does mean that we would have to duplicate code if we ever wanted to implement that for people booting with systemd, but I don't think that is likely to ever happen.
Comment 24 William Hubbs gentoo-dev 2013-12-29 21:24:36 UTC
Technically, software should not rely on the presence of /dev/root, see
bug #438380 for comments on this.

The code is still there because some things haven't been fixed the last
time I checked.
Comment 25 William Hubbs gentoo-dev 2013-12-30 04:09:36 UTC
In other words, I am agreeing with comment #23, and actually
recommending that you not duplicate this code for systemd.

We need to find out what is still not fixed and get that taken care of,
either by fixing it or removing it if it is deprecated.
Comment 26 William Hubbs gentoo-dev 2013-12-31 20:45:06 UTC
This is fixed in commit d2e712f, and will be included in
udev-init-scripts 27.