diff options
author | Mike Crowe <mac@mcrowe.com> | 2018-05-02 14:38:03 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-05-04 13:28:05 +0100 |
commit | 78b59f3660accaaa1abbc71895c58013b921f3c7 (patch) | |
tree | 625ce77dbb62bfaec893932625d478edb4908f3c /meta | |
parent | 5f699e314d65f5a5bee473baee9d17a4fa60fe60 (diff) | |
download | poky-78b59f3660accaaa1abbc71895c58013b921f3c7.tar.gz |
alsa-utils: Fix error when removing unwanted udev rules
If alsa-utils configure is not passed a --with-udev-rules-dir option then
it defaults to using /lib/udev/rules.d. This meant that the hard-coded use
of ${D}/lib in do_install in 262e69c9c7acf0beb7bb6b96299e3c993c906434
worked correctly to remove the unwanted rules.
Subsequently, 0a4372705a030ca54ed420cdfec33d46ab93499c changed do_install
to use ${nonarch_base_libdir}, claiming to fix this in the usrmerge case.
This means that if udev is not present in PACKAGECONFIG and usrmerge is
present in DISTRO_FEATURES then the alsa-utils build system will install
the rules in ${D}/lib/udev/rules.d but do_install will attempt to remove
${D}/usr/lib, resulting in something like:
rmdir: failed to remove '.../tmp-glibc/work/i586-oe-linux/alsa-utils/1.1.5-r0/image/usr/lib': No such file or directory
To fix this, let's just tell configure to install the rules in a specific
known location when udev is disabled. This location can then easily be
cleaned up in do_install without doing any harm if udev is enabled.
Tested both with and without usrmerge in DISTRO_FEATURES and with and
without udev in PACKAGECONFIG.
(From OE-Core rev: 022b644e6ba2caa0b32ce3323621c07f78166234)
Signed-off-by: Mike Crowe <mac@mcrowe.com>
Cc: Phil Blundell <pb@pbcl.net>
Cc: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-multimedia/alsa/alsa-utils_1.1.5.bb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/meta/recipes-multimedia/alsa/alsa-utils_1.1.5.bb b/meta/recipes-multimedia/alsa/alsa-utils_1.1.5.bb index f2231f34f0..33215bf159 100644 --- a/meta/recipes-multimedia/alsa/alsa-utils_1.1.5.bb +++ b/meta/recipes-multimedia/alsa/alsa-utils_1.1.5.bb | |||
@@ -16,7 +16,7 @@ PACKAGECONFIG ??= "udev" | |||
16 | # or no alsabat at all. | 16 | # or no alsabat at all. |
17 | PACKAGECONFIG[bat] = "--enable-bat,--disable-bat,fftwf" | 17 | PACKAGECONFIG[bat] = "--enable-bat,--disable-bat,fftwf" |
18 | 18 | ||
19 | PACKAGECONFIG[udev] = "--with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d,,udev" | 19 | PACKAGECONFIG[udev] = "--with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d,--with-udev-rules-dir=/unwanted/rules.d,udev" |
20 | PACKAGECONFIG[manpages] = "--enable-xmlto, --disable-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native" | 20 | PACKAGECONFIG[manpages] = "--enable-xmlto, --disable-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native" |
21 | 21 | ||
22 | SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \ | 22 | SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \ |
@@ -101,9 +101,8 @@ do_install() { | |||
101 | rm ${D}${sbindir}/alsa-info.sh | 101 | rm ${D}${sbindir}/alsa-info.sh |
102 | rm -f ${D}${sbindir}/alsabat-test.sh | 102 | rm -f ${D}${sbindir}/alsabat-test.sh |
103 | 103 | ||
104 | if ${@bb.utils.contains('PACKAGECONFIG', 'udev', 'false', 'true', d)}; then | 104 | # If udev is disabled, we told configure to install the rules |
105 | # This is where alsa-utils will install its rules if we don't tell it anything else. | 105 | # in /unwanted, so we can remove them now. If udev is enabled, |
106 | rm -rf ${D}${nonarch_base_libdir}/udev | 106 | # then /unwanted won't exist and this will have no effect. |
107 | rmdir --ignore-fail-on-non-empty ${D}${nonarch_base_libdir} | 107 | rm -rf ${D}/unwanted |
108 | fi | ||
109 | } | 108 | } |