2005-03-15 20:16:00 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# udev
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-08-11 18:50:49 +02:00
|
|
|
UDEV_VERSION:=114
|
2007-08-16 00:31:25 +02:00
|
|
|
UDEV_VOLUME_ID_CURRENT:=0
|
|
|
|
UDEV_VOLUME_ID_AGE:=79
|
|
|
|
UDEV_VOLUME_ID_REVISION:=0
|
|
|
|
UDEV_VOLUME_ID_VERSION:=$(UDEV_VOLUME_ID_CURRENT).$(UDEV_VOLUME_ID_AGE).$(UDEV_VOLUME_ID_REVISION)
|
2005-03-15 20:16:00 +01:00
|
|
|
UDEV_SOURCE:=udev-$(UDEV_VERSION).tar.bz2
|
2008-03-11 19:54:17 +01:00
|
|
|
UDEV_SITE:=$(BR2_KERNEL_MIRROR)/linux/utils/kernel/hotplug/
|
2009-11-11 23:32:28 +01:00
|
|
|
UDEV_INSTALL_STAGING=YES
|
2005-03-15 20:16:00 +01:00
|
|
|
|
2006-11-29 19:59:43 +01:00
|
|
|
# 094 had _GNU_SOURCE set
|
|
|
|
BR2_UDEV_CFLAGS:= -D_GNU_SOURCE $(TARGET_CFLAGS)
|
|
|
|
ifeq ($(BR2_LARGEFILE),)
|
|
|
|
BR2_UDEV_CFLAGS+=-U_FILE_OFFSET_BITS
|
|
|
|
endif
|
|
|
|
|
2005-06-09 12:09:25 +02:00
|
|
|
# UDEV_ROOT is /dev so we can replace devfs, not /udev for experiments
|
|
|
|
UDEV_ROOT:=/dev
|
|
|
|
|
2009-11-11 23:32:28 +01:00
|
|
|
UDEV_EXTRAS=
|
|
|
|
ifeq ($(BR2_PACKAGE_UDEV_VOLUME_ID),y)
|
|
|
|
UDEV_EXTRAS+=volume_id
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_UDEV_SCSI_ID),y)
|
|
|
|
UDEV_EXTRAS+=scsi_id
|
|
|
|
UDEV_EXTRAS+=usb_id
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_UDEV_PATH_ID),y)
|
|
|
|
UDEV_EXTRAS+=path_id
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_UDEV_FIRMWARE_SH),y)
|
|
|
|
UDEV_EXTRAS+=firmware
|
|
|
|
endif
|
2005-03-15 20:16:00 +01:00
|
|
|
|
2009-11-11 23:32:28 +01:00
|
|
|
UDEV_BUILD_EXTRAS=$(addprefix extras/,$(UDEV_EXTRAS))
|
2005-03-15 20:16:00 +01:00
|
|
|
|
2009-11-11 23:32:28 +01:00
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
define UDEV_BUILD_CMDS
|
2010-07-06 09:27:32 +02:00
|
|
|
$(MAKE) CROSS_COMPILE=$(TARGET_CROSS) CC="$(TARGET_CC)" LD="$(TARGET_CC)"\
|
2006-11-29 19:59:43 +01:00
|
|
|
CFLAGS="$(BR2_UDEV_CFLAGS)" \
|
2005-06-09 12:09:25 +02:00
|
|
|
USE_LOG=false USE_SELINUX=false \
|
2009-11-11 23:32:28 +01:00
|
|
|
udevdir=$(UDEV_ROOT) EXTRAS="$(UDEV_BUILD_EXTRAS)" -C $(@D)
|
|
|
|
endef
|
2005-03-15 20:16:00 +01:00
|
|
|
|
2009-11-11 23:32:28 +01:00
|
|
|
#
|
|
|
|
# Staging installation
|
|
|
|
#
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_UDEV_VOLUME_ID),y)
|
2009-11-11 23:32:28 +01:00
|
|
|
define UDEV_VOLUME_ID_STAGING_INSTALL_CMDS
|
2007-08-12 00:26:56 +02:00
|
|
|
$(INSTALL) -m 0644 -D $(UDEV_DIR)/extras/volume_id/lib/libvolume_id.h $(STAGING_DIR)/usr/include/libvolume_id.h
|
2009-12-16 09:57:13 +01:00
|
|
|
$(INSTALL) -m 0755 -D $(UDEV_DIR)/extras/volume_id/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION) $(STAGING_DIR)/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION)
|
2009-11-11 23:32:28 +01:00
|
|
|
-ln -sf libvolume_id.so.$(UDEV_VOLUME_ID_VERSION) $(STAGING_DIR)/lib/libvolume_id.so.0
|
|
|
|
-ln -sf libvolume_id.so.$(UDEV_VOLUME_ID_VERSION) $(STAGING_DIR)/lib/libvolume_id.so
|
|
|
|
$(INSTALL) -m 0755 -D package/udev/libvolume_id.la.tmpl $(STAGING_DIR)/lib/libvolume_id.la
|
|
|
|
$(SED) 's/REPLACE_CURRENT/$(UDEV_VOLUME_ID_CURRENT)/g' $(STAGING_DIR)/lib/libvolume_id.la
|
|
|
|
$(SED) 's/REPLACE_AGE/$(UDEV_VOLUME_ID_AGE)/g' $(STAGING_DIR)/lib/libvolume_id.la
|
|
|
|
$(SED) 's/REPLACE_REVISION/$(UDEV_VOLUME_ID_REVISION)/g' $(STAGING_DIR)/lib/libvolume_id.la
|
|
|
|
$(SED) 's,REPLACE_LIB_DIR,$(STAGING_DIR)/usr/lib,g' $(STAGING_DIR)/lib/libvolume_id.la
|
|
|
|
endef
|
2007-05-07 06:02:31 +02:00
|
|
|
endif
|
|
|
|
|
2009-11-11 23:32:28 +01:00
|
|
|
define UDEV_INSTALL_STAGING_CMDS
|
|
|
|
$(UDEV_VOLUME_ID_STAGING_INSTALL_CMDS)
|
|
|
|
endef
|
2009-02-13 20:57:59 +01:00
|
|
|
|
2009-11-11 23:32:28 +01:00
|
|
|
#
|
|
|
|
# Target installation
|
|
|
|
#
|
|
|
|
ifneq ($(BR2_PACKAGE_UDEV_UTILS),y)
|
|
|
|
define UDEV_UTILS_REMOVAL
|
|
|
|
rm -f $(TARGET_DIR)/usr/sbin/udevmonitor
|
|
|
|
rm -f $(TARGET_DIR)/usr/bin/udevinfo
|
|
|
|
rm -f $(TARGET_DIR)/usr/bin/udevtest
|
|
|
|
endef
|
2009-02-13 20:57:59 +01:00
|
|
|
endif
|
|
|
|
|
2009-11-11 23:32:28 +01:00
|
|
|
define UDEV_INSTALL_TARGET_CMDS
|
|
|
|
mkdir -p $(TARGET_DIR)/sys
|
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) \
|
|
|
|
DESTDIR=$(TARGET_DIR) \
|
2009-02-13 20:57:59 +01:00
|
|
|
CFLAGS="$(BR2_UDEV_CFLAGS)" \
|
2009-11-11 23:32:28 +01:00
|
|
|
LDFLAGS="-warn-common" \
|
2009-02-13 20:57:59 +01:00
|
|
|
USE_LOG=false USE_SELINUX=false \
|
2009-11-11 23:32:28 +01:00
|
|
|
udevdir=$(UDEV_ROOT) EXTRAS="$(UDEV_BUILD_EXTRAS)" -C $(@D) install
|
|
|
|
$(INSTALL) -m 0755 package/udev/S10udev $(TARGET_DIR)/etc/init.d
|
|
|
|
$(INSTALL) -m 0644 $(@D)/etc/udev/frugalware/* $(TARGET_DIR)/etc/udev/rules.d
|
|
|
|
( grep udev_root $(TARGET_DIR)/etc/udev/udev.conf > /dev/null 2>&1 || echo 'udev_root=/dev' >> $(TARGET_DIR)/etc/udev/udev.conf )
|
|
|
|
install -m 0755 -D $(@D)/udevstart $(TARGET_DIR)/sbin/udevstart
|
|
|
|
for i in $(TARGET_DIR)/sbin/udev* $(TARGET_DIR)/usr/bin/udev* ; do \
|
|
|
|
$(STRIPCMD) $(STRIP_STRIP_ALL) $$i ; \
|
|
|
|
done
|
|
|
|
for i in scsi_id usb_id vol_id ; do \
|
|
|
|
if test -e $(TARGET_DIR)/lib/udev/$$i ; then \
|
|
|
|
$(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/lib/udev/$$i ; \
|
|
|
|
fi \
|
|
|
|
done
|
|
|
|
$(UDEV_UTILS_REMOVAL)
|
|
|
|
endef
|
2009-02-13 20:57:59 +01:00
|
|
|
|
2005-03-15 20:16:00 +01:00
|
|
|
#
|
2009-11-11 23:32:28 +01:00
|
|
|
# Clean
|
2005-03-15 20:16:00 +01:00
|
|
|
#
|
2009-11-11 23:32:28 +01:00
|
|
|
define UDEV_CLEAN_CMDS
|
|
|
|
-$(MAKE) EXTRAS="$(UDEV_BUILD_EXTRAS)" -C $(@D) clean
|
|
|
|
endef
|
2007-05-07 06:02:31 +02:00
|
|
|
|
2009-11-11 23:32:28 +01:00
|
|
|
#
|
|
|
|
# Staging uninstall
|
|
|
|
#
|
|
|
|
define UDEV_UNINSTALL_STAGING_CMDS
|
|
|
|
rm -f $(STAGING_DIR)/usr/include/libvolume_id.h
|
|
|
|
rm -f $(STAGING_DIR)/lib/libvolume_id.so*
|
|
|
|
rm -f $(STAGING_DIR)/lib/libvolume_id.la
|
|
|
|
endef
|
2009-02-13 20:57:59 +01:00
|
|
|
|
2009-11-11 23:32:28 +01:00
|
|
|
#
|
|
|
|
# Target uninstall
|
|
|
|
#
|
|
|
|
define UDEV_UNINSTALL_TARGET_CMDS
|
|
|
|
rm -f $(TARGET_DIR)/etc/init.d/S10udev $(TARGET_DIR)/sbin/udev*
|
|
|
|
rm -f $(TARGET_DIR)/usr/sbin/udevmonitor $(TARGET_DIR)/usr/bin/udev*
|
|
|
|
rm -fr $(TARGET_DIR)/sys
|
|
|
|
rm -f $(TARGET_DIR)/lib/libvolume_id.so.0*
|
|
|
|
rm -rf $(TARGET_DIR)/lib/udev
|
|
|
|
endef
|
2009-02-13 20:57:59 +01:00
|
|
|
|
2009-11-11 23:32:28 +01:00
|
|
|
$(eval $(call GENTARGETS,package,udev))
|