[systemd-commits] 2 commits - configure.ac Makefile.am rules/50-firmware.rules rules/50-udev-default.rules shell-completion/bash src/udev
Kay Sievers
kay at kemper.freedesktop.org
Mon Mar 18 07:24:39 PDT 2013
Makefile.am | 16 ++++++++++++----
configure.ac | 7 ++++---
rules/50-firmware.rules | 3 +++
rules/50-udev-default.rules | 1 -
shell-completion/bash/udevadm | 2 +-
src/udev/udev-builtin.c | 2 ++
src/udev/udev.h | 4 ++++
src/udev/udevd.c | 6 ++++++
8 files changed, 32 insertions(+), 9 deletions(-)
New commits:
commit 61e536e1b7f3a7448428a05bafe1ea64d7e51938
Author: Kay Sievers <kay at vrfy.org>
Date: Mon Mar 18 15:22:32 2013 +0100
udev: ifdef all firmware special handling
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 0a3ab68..834c7d9 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -98,7 +98,9 @@ struct event {
dev_t devnum;
int ifindex;
bool is_block;
+#ifdef ENABLE_FIRMWARE
bool nodelay;
+#endif
};
static inline struct event *node_to_event(struct udev_list_node *node)
@@ -442,8 +444,10 @@ static int event_queue_insert(struct udev_device *dev)
event->devnum = udev_device_get_devnum(dev);
event->is_block = streq("block", udev_device_get_subsystem(dev));
event->ifindex = udev_device_get_ifindex(dev);
+#ifdef ENABLE_FIRMWARE
if (streq(udev_device_get_subsystem(dev), "firmware"))
event->nodelay = true;
+#endif
udev_queue_export_device_queued(udev_queue_export, dev);
log_debug("seq %llu queued, '%s' '%s'\n", udev_device_get_seqnum(dev),
@@ -523,9 +527,11 @@ static bool is_devpath_busy(struct event *event)
return true;
}
+#ifdef ENABLE_FIRMWARE
/* allow to bypass the dependency tracking */
if (event->nodelay)
continue;
+#endif
/* parent device event found */
if (event->devpath[common] == '/') {
commit a3bd8447be4ea2ce230eb8ae0e815c04d85fa15a
Author: Tom Gundersen <teg at jklm.no>
Date: Mon Mar 18 15:12:18 2013 +0100
udev: make firmware loading optional and disable by default
Distros that whish to support old kernels should set
--with-firmware-dirs="/usr/lib/firmware/updates:/usr/lib/firmware"
to retain the old behaviour.
diff --git a/Makefile.am b/Makefile.am
index 7e9cdfd..37eeb01 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1352,12 +1352,10 @@ rootlibexec_PROGRAMS += \
nodist_systemunit_DATA += \
units/systemd-modules-load.service
+
SYSINIT_TARGET_WANTS += \
systemd-modules-load.service
-dist_udevrules_DATA += \
- rules/80-drivers.rules
-
endif
EXTRA_DIST += \
@@ -1809,7 +1807,6 @@ libudev_core_la_SOURCES = \
src/udev/udev-ctrl.c \
src/udev/udev-builtin.c \
src/udev/udev-builtin-btrfs.c \
- src/udev/udev-builtin-firmware.c \
src/udev/udev-builtin-hwdb.c \
src/udev/udev-builtin-input_id.c \
src/udev/udev-builtin-net_id.c \
@@ -1833,9 +1830,20 @@ libudev_core_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DFIRMWARE_PATH="$(FIRMWARE_PATH)"
+if ENABLE_FIRMWARE
+libudev_core_la_SOURCES += \
+ src/udev/udev-builtin-firmware.c
+
+dist_udevrules_DATA += \
+ rules/50-firmware.rules
+endif
+
if HAVE_KMOD
libudev_core_la_SOURCES += \
src/udev/udev-builtin-kmod.c
+
+dist_udevrules_DATA += \
+ rules/80-drivers.rules
endif
if HAVE_BLKID
diff --git a/configure.ac b/configure.ac
index 28d7286..14411e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -705,8 +705,8 @@ AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
# ------------------------------------------------------------------------------
AC_ARG_WITH(firmware-path,
AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
- [Firmware search path (default=ROOTPREFIX/lib/firmware/updates:ROOTPREFIX/lib/firmware)]),
- [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"])
+ [Firmware search path (default="")]),
+ [], [with_firmware_path=""])
OLD_IFS=$IFS
IFS=:
for i in $with_firmware_path; do
@@ -717,7 +717,8 @@ for i in $with_firmware_path; do
fi
done
IFS=$OLD_IFS
-AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH])
+AC_SUBST(FIRMWARE_PATH)
+AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
# ------------------------------------------------------------------------------
AC_ARG_ENABLE([gudev],
diff --git a/rules/50-firmware.rules b/rules/50-firmware.rules
new file mode 100644
index 0000000..f0ae684
--- /dev/null
+++ b/rules/50-firmware.rules
@@ -0,0 +1,3 @@
+# do not edit this file, it will be overwritten on update
+
+SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware"
diff --git a/rules/50-udev-default.rules b/rules/50-udev-default.rules
index 5d8bde5..9d17cf7 100644
--- a/rules/50-udev-default.rules
+++ b/rules/50-udev-default.rules
@@ -64,5 +64,4 @@ SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id"
-SUBSYSTEM=="firmware", ACTION=="add", IMPORT{builtin}="firmware"
ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"
diff --git a/shell-completion/bash/udevadm b/shell-completion/bash/udevadm
index a31d465..123fb51 100644
--- a/shell-completion/bash/udevadm
+++ b/shell-completion/bash/udevadm
@@ -93,7 +93,7 @@ _udevadm() {
fi
elif __contains_word "$verb" ${VERBS[TESTBUILTIN]}; then
- comps='blkid btrfs firmware hwdb input_id kmod net_id path_id usb_id uaccess'
+ comps='blkid btrfs hwdb input_id kmod net_id path_id usb_id uaccess'
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
index 57d75a1..13922d3 100644
--- a/src/udev/udev-builtin.c
+++ b/src/udev/udev-builtin.c
@@ -34,7 +34,9 @@ static const struct udev_builtin *builtins[] = {
[UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
#endif
[UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
+#ifdef ENABLE_FIRMWARE
[UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware,
+#endif
[UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
[UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
#ifdef HAVE_KMOD
diff --git a/src/udev/udev.h b/src/udev/udev.h
index b54cb58..aa2edbe 100644
--- a/src/udev/udev.h
+++ b/src/udev/udev.h
@@ -140,7 +140,9 @@ enum udev_builtin_cmd {
UDEV_BUILTIN_BLKID,
#endif
UDEV_BUILTIN_BTRFS,
+#ifdef ENABLE_FIRMWARE
UDEV_BUILTIN_FIRMWARE,
+#endif
UDEV_BUILTIN_HWDB,
UDEV_BUILTIN_INPUT_ID,
#ifdef HAVE_KMOD
@@ -167,7 +169,9 @@ struct udev_builtin {
extern const struct udev_builtin udev_builtin_blkid;
#endif
extern const struct udev_builtin udev_builtin_btrfs;
+#ifdef ENABLE_FIRMWARE
extern const struct udev_builtin udev_builtin_firmware;
+#endif
extern const struct udev_builtin udev_builtin_hwdb;
extern const struct udev_builtin udev_builtin_input_id;
#ifdef HAVE_KMOD
More information about the systemd-commits
mailing list