Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 509454 - sys-apps/systemd MY_UDEVDIR variable is lost in subshell in multilib_src_configure
Summary: sys-apps/systemd MY_UDEVDIR variable is lost in subshell in multilib_src_conf...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
: 509482 509492 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-05-03 12:07 UTC by Hans Vercammen
Modified: 2014-05-04 05:00 UTC (History)
7 users (show)

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


Attachments
build-amd64.log.gz (build-amd64.log.gz,72.29 KB, application/gzip)
2014-05-03 12:10 UTC, Hans Vercammen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Vercammen 2014-05-03 12:07:51 UTC
The udev tools and rules.d are no longer installed under /lib/udev causing errors during boot like:

May 03 10:45:58 orion systemd-udevd[253]: failed to execute '/ata_id' 'ata_id --export /dev/sda': No such file or directory
May 03 10:45:58 orion systemd-udevd[254]: failed to execute '/ata_id' 'ata_id --export /dev/sdb': No such file or directory
May 03 10:45:58 orion systemd-udevd[255]: failed to execute '/scsi_id' 'scsi_id --export --whitelisted -d /dev/sda': No such file or directory
May 03 10:45:58 orion systemd-udevd[256]: failed to execute '/ata_id' 'ata_id --export /dev/sdc': No such file or directory
May 03 10:45:58 orion systemd-udevd[257]: failed to execute '/scsi_id' 'scsi_id --export --whitelisted -d /dev/sdb': No such file or directory
May 03 10:45:58 orion systemd-udevd[258]: failed to execute '/scsi_id' 'scsi_id --export --whitelisted -d /dev/sdc': No such file or directory

The udev.pc has an empty path, causing other packages like udisks to install udev rules into /

orion ~ # cat /usr/share/pkgconfig/udev.pc 
Name: udev
Description: udev
Version: 212

udevdir=

Removing udev.pc and reemerging has no effect.

It seems ${MY_UDEVDIR} in the ebuild gets cleared between phases.
Comment 1 Hans Vercammen 2014-05-03 12:08:18 UTC
Portage 2.2.10 (default/linux/amd64/13.0/no-multilib, gcc-4.8.2, glibc-2.19, 3.14.2-gentoo x86_64)
=================================================================
System uname: Linux-3.14.2-gentoo-x86_64-Intel-R-_Core-TM-_i7_CPU_950_@_3.07GHz-with-gentoo-2.2
KiB Mem:     6114036 total,   3132860 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Sat, 03 May 2014 11:00:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.2_p47
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.6-r1, 3.3.5, 3.4.0
dev-util/cmake:           2.8.12.2
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.12.6, 1.13.4, 1.14.1
sys-devel/binutils:       2.24-r2
sys-devel/gcc:            4.8.2-r1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.14 (virtual/os-headers)
sys-libs/glibc:           2.19
Repositories: gentoo qt local-overlay
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA PUEL dlj-1.1 Oracle-BCLA-JavaSE AdobeFlash-10.3 AdobeFlash-11.x"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=corei7 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=corei7 -O2 -pipe"
DISTDIR="/gentoo/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n --complete-graph=n --with-bdeps=n --autounmask=n --ignore-built-slot-operator-deps=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles keeptemp merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo http://de-mirror.org/distro/gentoo http://mirror.switch.ch/ftp/mirror/gentoo http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://gentoo.tiscali.nl http://ds.thn.htu.se/linux/gentoo http://mirror.ovh.net/gentoo-distfiles http://mirrors.ludost.net/gentoo http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo http://mirrors.rit.edu/gentoo/ http://gentoo.lagis.at/ http://mirrors.linuxant.fr/distfiles.gentoo.org/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j8"
PKGDIR="/gentoo/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/gentoo/portage"
PORTDIR_OVERLAY="/gentoo/layman/qt /gentoo/portage-overlay"
USE="amd64 bzip2 cli cracklib crypt cxx dri mmx ncurses nptl openmp pam pcre readline session sse sse2 sse3 sse4 sse4_1 sse4a ssl ssse3 unicode zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="crypt systemd" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="intel i965 nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.3"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC
Comment 2 Hans Vercammen 2014-05-03 12:10:59 UTC
Created attachment 376274 [details]
build-amd64.log.gz
Comment 3 Alexander Tsoy 2014-05-03 14:06:05 UTC
Confirming this

$ pkg-config --variable=udevdir udev
<empty string>

So all udev rules get installed in /rules.d/
Comment 4 Alexander Tsoy 2014-05-03 14:59:49 UTC
Hardcoding MY_UDEVDIR in ebuild does not help. This variable is not preserved between phases. Not sure how this worked in the past. To fix this issue I need to hardcode udevlibexecdir variable in multilib_src_compile() and multilib_src_install()
Comment 5 Alexander Tsoy 2014-05-03 15:42:20 UTC
I get it! Reverting the following commit fixes this bug:

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/multilib-minimal.eclass?r1=1.8&r2=1.9
Comment 6 Mike Gilbert gentoo-dev 2014-05-03 15:57:59 UTC
(In reply to Alexander Tsoy from comment #5)
> I get it! Reverting the following commit fixes this bug:
> 
> http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/multilib-
> minimal.eclass?r1=1.8&r2=1.9

Good catch; multilib_parallel_foreach_abi introduces a subshell so any variables set in multilib_src_configure get lost.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-03 15:58:25 UTC
Good news is I'm going to commit a fix in a new minutes. I just have to do a test run to make sure it works.

Bad news is that I can't fix all systems properly. Following the least damage path, the auto-fix will set udevdir=/lib for people who got empty value. People who want udevdir=/usr/lib will either need to manually edit the .pc before rebuilding, or rebuild everything that installed rules to /usr/lib after rebuilding.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-03 15:59:10 UTC
+  03 May 2014; Michał Górny <mgorny@gentoo.org> systemd-208-r2.ebuild,
+  systemd-208-r3.ebuild, systemd-208.277.ebuild, systemd-208.9999.ebuild,
+  systemd-212-r3.ebuild, systemd-9999.ebuild:
+  Fix not respecting MY_UDEVDIR, bug #509454.
Comment 9 Alexander Tsoy 2014-05-03 16:31:23 UTC
(In reply to Michał Górny from comment #7)
> Bad news is that I can't fix all systems properly. Following the least
> damage path, the auto-fix will set udevdir=/lib for people who got empty
> value. People who want udevdir=/usr/lib will either need to manually edit
> the .pc before rebuilding, or rebuild everything that installed rules to
> /usr/lib after rebuilding.

> [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib

I think this should be "MY_UDEVDIR=/lib/udev"
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2014-05-03 17:15:26 UTC
*** Bug 509482 has been marked as a duplicate of this bug. ***
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-03 17:35:48 UTC
(In reply to Alexander Tsoy from comment #9)
> > [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib
> 
> I think this should be "MY_UDEVDIR=/lib/udev"

Indeed. Fixed now.
Comment 12 Andrius Štikonas 2014-05-04 00:03:29 UTC
*** Bug 509492 has been marked as a duplicate of this bug. ***