Files
buildroot/package/eudev/eudev.mk
Fiona Klute 699d4cfd7f package/eudev: fix install with BR2_ROOTFS_MERGED_BIN=y
Eudev install creates a symlink from $(sbindir)/udevadm to
$(bindir)/udevadm if sbindir and bindir are different [1].
Unfortunately the check considers only the configured values as
strings and does not resolve symlinks. This means that in a merged-bin
setup with sbindir=/sbin (symlink to /usr/sbin, which is a symlink to
/usr/bin) and bindir=/usr/bin the /usr/bin/udevadm binary gets
overwritten with a link to itself.

Set sbindir according to the merge setup to avoid the problem, bindir
defaults to /usr/bin in any case.

[1] 9e7c4e744b/src/udev/Makefile.am (L139-L140)

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu>
(cherry picked from commit a063c89dc2)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
2026-05-15 16:20:22 +02:00

96 lines
2.3 KiB
Makefile

################################################################################
#
# eudev
#
################################################################################
EUDEV_VERSION = 3.2.14
EUDEV_SITE = https://github.com/eudev-project/eudev/releases/download/v$(EUDEV_VERSION)
EUDEV_LICENSE = GPL-2.0+ (programs), LGPL-2.1+ (libraries)
EUDEV_LICENSE_FILES = COPYING
EUDEV_INSTALL_STAGING = YES
EUDEV_CONF_OPTS = \
--disable-manpages \
--libexecdir=/lib \
--enable-kmod \
--enable-blkid
# eudev requires only the util-linux libraries at build time
EUDEV_DEPENDENCIES = host-gperf host-pkgconf util-linux-libs
EUDEV_PROVIDES = udev
ifeq ($(BR2_ROOTFS_MERGED_USR),y)
ifeq ($(BR2_ROOTFS_MERGED_BIN),y)
EUDEV_CONF_OPTS += --sbindir=/usr/bin
else
EUDEV_CONF_OPTS += --sbindir=/usr/sbin
endif
else
EUDEV_CONF_OPTS += --sbindir=/sbin --with-rootlibdir=/lib --enable-split-usr
endif
ifeq ($(BR2_PACKAGE_EUDEV_MODULE_LOADING),y)
EUDEV_CONF_OPTS += --enable-kmod
EUDEV_DEPENDENCIES += kmod
else
EUDEV_CONF_OPTS += --disable-kmod
endif
ifeq ($(BR2_PACKAGE_EUDEV_RULES_GEN),y)
EUDEV_CONF_OPTS += --enable-rule-generator
else
EUDEV_CONF_OPTS += --disable-rule-generator
endif
ifeq ($(BR2_PACKAGE_EUDEV_ENABLE_HWDB),y)
EUDEV_CONF_OPTS += --enable-hwdb
else
EUDEV_CONF_OPTS += --disable-hwdb
endif
ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
EUDEV_CONF_OPTS += --enable-selinux
EUDEV_DEPENDENCIES += libselinux
else
EUDEV_CONF_OPTS += --disable-selinux
endif
define EUDEV_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/eudev/S10udevd $(TARGET_DIR)/etc/init.d/S10udevd
endef
# Avoid installing S10udevd with openrc, as the service is started by a unit
# from the udev-gentoo-scripts package.
define EUDEV_INSTALL_INIT_OPENRC
@:
endef
HOST_EUDEV_DEPENDENCIES = host-gperf host-pkgconf
HOST_EUDEV_CONF_OPTS = \
--prefix=/usr \
--sbindir=/sbin \
--libexecdir=/lib \
--with-rootlibdir=/lib \
--sysconfdir=/etc \
--disable-blkid \
--disable-kmod \
--disable-manpages \
--disable-rule-generator \
--disable-selinux \
--enable-hwdb
define HOST_EUDEV_INSTALL_CMDS
$(INSTALL) -D -m 0755 $(@D)/src/udev/udevadm \
$(HOST_DIR)/bin/udevadm
endef
define HOST_EUDEV_BUILD_HWDB
$(HOST_DIR)/bin/udevadm hwdb --update --usr --root $(TARGET_DIR)
endef
HOST_EUDEV_TARGET_FINALIZE_HOOKS += HOST_EUDEV_BUILD_HWDB
$(eval $(autotools-package))
$(eval $(host-autotools-package))