Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 490742 - sys-fs/udev-init-scripts trouble detecting udevdir?
Summary: sys-fs/udev-init-scripts trouble detecting udevdir?
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-08 13:35 UTC by XC
Modified: 2013-11-08 20:44 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 XC 2013-11-08 13:35:28 UTC
sys-fs/udev-init-scripts-26 installs net.sh, dev-root-link.sh and the directory rules.d (which contains 90-network.rules) in / instead of in /lib/udev/ as expected in my system (x86).
IMHO, the problem is due to the Makefile shipped in the source package udev-init-scripts-26.tar.bz2
This Makefile invokes (line 5) :" shell pkg-config udev --variable=udevdir " , but /usr/bin/pkg-config (coming from dev-util/pkgconfig-0.28) isn't shell script, so the command fails, giving null string for LIBUDEV instead of the expected "lib/udev/" result.
 If "shell" is suppressed, the command runs ok (tested in terminal) , at least for my version of pkg-config.
 With "/bin/sh pkg-config..." , error message says "unable to launch pkg-config, pkg-config is not a shell script" .
 A simple patch should avoid the problem
 Regards
  XC
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-11-08 14:08:56 UTC
"shell <command>" in makefiles simply executes whatever command is given to it an a shell environment. I does not have to be a shell script. So calling pkg-config is comletely vaild.

Try yourself:

  mkdir test ; cd test
  echo 'all:\n\t/bin/echo "$(shell ls -l)"' > Makefile
  make -s -f Makefile


Now tell me what you get as result.


Please post the output of 

  pkg-config udev --variable=udevdir

to this bug. I suppose the problem is rather there but in the Makefile...
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-11-08 14:11:46 UTC
Ah sorry, had this tested under zsh. In bash you need to do this for testing the Makefile:

  mkdir test ; cd test
  echo -e 'all:\n\t/bin/echo "$(shell ls -l)"' > Makefile
  make -s -f Makefile
Comment 3 XC 2013-11-08 17:29:11 UTC
Hello,

your test is ok: ls -l is correctly executed .

However, if i run (in terminal)
  "/bin/sh pkg-config udev --variable=udevdir"
 i obtain: "/usr/bin/pkg-config: /usr/bin/pkg-config : fichier binaire impossible à lancer"
 --system in french, of course--

Unlikely, the command :
  "pkg-config udev --variable=udevdir"
gives as result : "/lib/udev" 

 It's why in installing udev-init-scripts files go under / directory and not under  
/lib/udev directory (seen recently in my Gentoo system, where /bin/sh refers to /bin/bash)

 What is wrong ?
 Regards
 XC
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-08 17:45:52 UTC
udev-init-scripts properly depends on virtual/pkgconfig, so there should be no reason pkg-config cannot be found...
Comment 5 Mike Gilbert gentoo-dev 2013-11-08 18:14:28 UTC
As poly-c indicates, running "/bin/sh pkg-config udev --variable=udevdir" is NOT the same as calling $(shell pkg-config) from a Makefile.

Please attach a build log.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-08 18:19:59 UTC
"fichier binaire impossible à lancer" = "cannot execute binary file"

This message is usually printed when the binary is incompatible, like a 64-bit binary on a 32-bit system... But sure, it's probably udev-init-scripts' fault.
Comment 7 Mike Gilbert gentoo-dev 2013-11-08 18:26:19 UTC
(In reply to Jeroen Roovers from comment #6)
> "fichier binaire impossible à lancer" = "cannot execute binary file"
> 
> This message is usually printed when the binary is incompatible, like a
> 64-bit binary on a 32-bit system... But sure, it's probably
> udev-init-scripts' fault.

That message is only produced as a result of the invalid test that the reporter is running in his terminal:

> However, if i run (in terminal)
>  "/bin/sh pkg-config udev --variable=udevdir"


I did not assign the bug because the reporter is providing bad/useless information thus far.
Comment 8 XC 2013-11-08 18:41:02 UTC
to Mike Gilbert:

  you're right, i have modified the above test, 
replacing "shell ls -l" by "shell pkg-config udev --variable=udevdir",
and it's working !! I obtain the desired result : /lib/udev

  Nevertheless, emerging udev-init-scripts-26 gave me files in wrong directory,
exactly as if LIBUDEV="". Hence the bug-report

  Strange for me too, will try re-emerging this package and post the results
Comment 9 XC 2013-11-08 19:37:54 UTC
 Reemerging udev-init-scripts works fine !??
 This time repertories are correct, all files in the right place
 I don't understand what happens in previous install, some mysterious sorcery ?
 Seriously, it's probably a momentaneous local problem -misconfiguration ? overload ? what else ?
 Very sorry for the inconvenience, bug can be closed 
  XC
Comment 10 Mike Gilbert gentoo-dev 2013-11-08 20:44:39 UTC
(In reply to XC from comment #9)

Not sure what might have happened. If you come up with a way to reproduce it, feel free to reopen.