Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2, 1/2] alsa-utils: fix udev build with pkgconf 1.5.3
@ 2018-12-14 15:54 Fabrice Fontaine
  2018-12-14 15:54 ` [Buildroot] [PATCH v2, 2/2] alsa-utils: fix systemd " Fabrice Fontaine
  2018-12-14 21:37 ` [Buildroot] [PATCH v2, 1/2] alsa-utils: fix udev " Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2018-12-14 15:54 UTC (permalink / raw)
  To: buildroot

Since the bump to 1.5.3, pkgconf prepends the sysroot to all absolute
paths found in the .pc file. This is correct when the paths refer to
something in STAGING_DIR (e.g. libdir, includedir), but not when it
refers to something used for the target.

alsa-utils uses the udevdir variable from udev.pc to decide where to
install things. Since DESTDIR is prepended to the install destination,
this will end up in the wrong location.

Until a better solution is found in pkgconf, pass the udevrulesdir to
use explicitly instead of relying on udev.pc.

Fixes:
 - http://autobuild.buildroot.org/results/d8ad140ae52b4fe8e153de3835f3f17e92b58e53

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2 (after review of Baruch Siach):
 - remove udev build-time dependency

 package/alsa-utils/alsa-utils.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/alsa-utils/alsa-utils.mk b/package/alsa-utils/alsa-utils.mk
index 0bf2b432bd..8b2d335be4 100644
--- a/package/alsa-utils/alsa-utils.mk
+++ b/package/alsa-utils/alsa-utils.mk
@@ -28,6 +28,10 @@ ALSA_UTILS_CONF_OPTS = \
 	--disable-rst2man \
 	--with-curses=$(if $(BR2_PACKAGE_NCURSES_WCHAR),ncursesw,ncurses)
 
+ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+ALSA_UTILS_CONF_OPTS += --with-udev-rules-dir=/usr/lib/udev/rules.d
+endif
+
 ifeq ($(BR2_PACKAGE_ALSA_UTILS_ALSALOOP),y)
 ALSA_UTILS_CONF_OPTS += --enable-alsaloop
 else
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2, 2/2] alsa-utils: fix systemd build with pkgconf 1.5.3
  2018-12-14 15:54 [Buildroot] [PATCH v2, 1/2] alsa-utils: fix udev build with pkgconf 1.5.3 Fabrice Fontaine
@ 2018-12-14 15:54 ` Fabrice Fontaine
  2018-12-14 21:38   ` Thomas Petazzoni
  2018-12-14 21:37 ` [Buildroot] [PATCH v2, 1/2] alsa-utils: fix udev " Thomas Petazzoni
  1 sibling, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2018-12-14 15:54 UTC (permalink / raw)
  To: buildroot

Since the bump to 1.5.3, pkgconf prepends the sysroot to all absolute
paths found in the .pc file. This is correct when the paths refer to
something in STAGING_DIR (e.g. libdir, includedir), but not when it
refers to something used for the target.

alsa-utils uses the systemdsystemunitdir variable from systemd.pc to
decide where to install things. Since DESTDIR is prepended to the
install destination, this will end up in the wrong location.

Until a better solution is found in pkgconf, pass the
systemdsystemunitdir to use explicitly instead of relying on systemd.pc.

Fixes:
 - http://autobuild.buildroot.org/results/d8ad140ae52b4fe8e153de3835f3f17e92b58e53

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/alsa-utils/alsa-utils.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/alsa-utils/alsa-utils.mk b/package/alsa-utils/alsa-utils.mk
index 8b2d335be4..4983283328 100644
--- a/package/alsa-utils/alsa-utils.mk
+++ b/package/alsa-utils/alsa-utils.mk
@@ -88,6 +88,7 @@ endef
 
 ifeq ($(BR2_PACKAGE_ALSA_UTILS_ALSACTL)$(BR2_INIT_SYSTEMD),yy)
 ALSA_UTILS_DEPENDENCIES += systemd
+ALSA_UTILS_CONF_OPTS += --with-systemdsystemunitdir=/usr/lib/systemd/system
 define ALSA_UTILS_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 $(@D)/alsactl/alsa-restore.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2, 1/2] alsa-utils: fix udev build with pkgconf 1.5.3
  2018-12-14 15:54 [Buildroot] [PATCH v2, 1/2] alsa-utils: fix udev build with pkgconf 1.5.3 Fabrice Fontaine
  2018-12-14 15:54 ` [Buildroot] [PATCH v2, 2/2] alsa-utils: fix systemd " Fabrice Fontaine
@ 2018-12-14 21:37 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2018-12-14 21:37 UTC (permalink / raw)
  To: buildroot

Hello Fabrice,

On Fri, 14 Dec 2018 16:54:34 +0100, Fabrice Fontaine wrote:

> +ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
> +ALSA_UTILS_CONF_OPTS += --with-udev-rules-dir=/usr/lib/udev/rules.d
> +endif

I think this is still wrong: we should pass the --with-udev-rules-dir
option unconditionally.

Indeed, the udev files are installed unconditionally by alsa-utils,
regardless of whether udev is present or not.

Currently what happens is that if udev is not installed, the rules are
installed in /lib/udev/rules.d/. If udev is installed, then the udev.pc
file is found, and this is where the issue happens with pkg-config
1.5.3, and which you work-around here.

See:

$ find output/staging/ | grep udev
output/staging/lib/udev
output/staging/lib/udev/rules.d
output/staging/lib/udev/rules.d/89-alsa-ucm.rules
output/staging/lib/udev/rules.d/90-alsa-restore.rules

$ grep UDEV .config
# BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV is not set
# BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV is not set
# BR2_PACKAGE_UDEV is not set
# BR2_PACKAGE_UDEV_RULES_GEN is not set
# BR2_PACKAGE_UDEV_ALL_EXTRAS is not set

Note: the rule files are not installed to TARGET_DIR, because we don't
run "make install" for alsa-utils, but only manually install things to
the target (which is a bit crappy, but that's a separate issue).

Also, I'm not convinced /usr/lib/udev/rules.d is the right
place, /lib/udev/rules.d seems common. But Buildroot is not very
consistent on this:

$ git grep "/lib/udev" | cat
package/bcache-tools/bcache-tools.mk:# expects the /lib/udev/rules.d directory to exist.
package/bcache-tools/bcache-tools.mk:	$(INSTALL) -m 0755 -d $(TARGET_DIR)/lib/udev/rules.d
package/gpsd/gpsd.mk:	chmod u+w $(TARGET_DIR)/lib/udev/rules.d/25-gpsd.rules
package/libgphoto2/libgphoto2.mk:LIBGPHOTO2_CONF_ENV = udevscriptdir=/lib/udev
package/libv4l/libv4l.mk:LIBV4L_CONF_OPTS += --with-udevdir=/usr/lib/udev
package/systemd/Config.in:	  Enables hardware database installation to /usr/lib/udev/hwdb.d
package/tpm2-abrmd/tpm2-abrmd.mk:	--with-udevrulesdir=$(if $(BR2_PACKAGE_HAS_UDEV),/usr/lib/udev/rules.d,no)
package/triggerhappy/triggerhappy.mk:		$(TARGET_DIR)/lib/udev/rules.d/triggerhappy.rules
package/usbmount/usbmount.mk:	$(INSTALL) -m 0644 -D $(@D)/usbmount.rules $(TARGET_DIR)/lib/udev/rules.d/usbmount.rules

Some packages install them in /lib/udev, some in /usr/lib/udev. Not
good. So, for the alsa-utils patch, just unconditionally do:

	--with-udev-rules-dir=/lib/udev/rules.d

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2, 2/2] alsa-utils: fix systemd build with pkgconf 1.5.3
  2018-12-14 15:54 ` [Buildroot] [PATCH v2, 2/2] alsa-utils: fix systemd " Fabrice Fontaine
@ 2018-12-14 21:38   ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2018-12-14 21:38 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 14 Dec 2018 16:54:35 +0100, Fabrice Fontaine wrote:
> Since the bump to 1.5.3, pkgconf prepends the sysroot to all absolute
> paths found in the .pc file. This is correct when the paths refer to
> something in STAGING_DIR (e.g. libdir, includedir), but not when it
> refers to something used for the target.
> 
> alsa-utils uses the systemdsystemunitdir variable from systemd.pc to
> decide where to install things. Since DESTDIR is prepended to the
> install destination, this will end up in the wrong location.
> 
> Until a better solution is found in pkgconf, pass the
> systemdsystemunitdir to use explicitly instead of relying on systemd.pc.
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/d8ad140ae52b4fe8e153de3835f3f17e92b58e53
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/alsa-utils/alsa-utils.mk | 1 +
>  1 file changed, 1 insertion(+)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-14 21:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-14 15:54 [Buildroot] [PATCH v2, 1/2] alsa-utils: fix udev build with pkgconf 1.5.3 Fabrice Fontaine
2018-12-14 15:54 ` [Buildroot] [PATCH v2, 2/2] alsa-utils: fix systemd " Fabrice Fontaine
2018-12-14 21:38   ` Thomas Petazzoni
2018-12-14 21:37 ` [Buildroot] [PATCH v2, 1/2] alsa-utils: fix udev " Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox