package/systemd: Optionally disable hwdb
authorMarcin Niestroj <m.niestroj@grinn-global.com>
Fri, 15 Apr 2016 10:46:30 +0000 (12:46 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 15 Jun 2016 21:21:33 +0000 (23:21 +0200)
By default hwdb files are installed in /usr/lib/udev/hwdb.d
Currently they take about ~5MB. After first boot, systemd-hwdb tool
parses them and creates a binary in /etc/udev/hwdb.bin, which takes
another ~6.5MB.

In case of initramfs images, hwdb parsing is done every boot. This adds
about 2-3 seconds to boot time in case of rootfs on SDHC class 10
card (benchmarked with am335x board). NAND boot takes even longer.

Add config option to disable hwdb in systemd, for smaller images and
better boot performance.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/systemd/Config.in
package/systemd/systemd.mk

index 97d48c41247fb9f187184bad7a2a0dd1c2b97fb8..324e8844894490fb0f4de66f58d3e861acc46385 100644 (file)
@@ -84,6 +84,17 @@ config BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY
 
          http://www.freedesktop.org/software/systemd/man/systemd-journal-gatewayd.service.html
 
+config BR2_PACKAGE_SYSTEMD_HWDB
+       bool "enable hwdb installation"
+       default y
+       help
+         Enables hardware database installation to /usr/lib/udev/hwdb.d
+
+         Disabling this option improves first boot time (or every boot
+         time in case of initramfs images) and saves several MB space.
+
+         https://www.freedesktop.org/software/systemd/man/hwdb.html
+
 config BR2_PACKAGE_SYSTEMD_BINFMT
        bool "enable binfmt tool"
        help
index b5253973c63c08e3ad79bac28445d110cec4065a..c0503ae921b050e82c0feeebe1bd7c358356645d 100644 (file)
@@ -129,6 +129,12 @@ else
 SYSTEMD_CONF_OPTS += --disable-microhttpd
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD_HWDB),y)
+SYSTEMD_CONF_OPTS += --enable-hwdb
+else
+SYSTEMD_CONF_OPTS += --disable-hwdb
+endif
+
 ifeq ($(BR2_PACKAGE_SYSTEMD_BINFMT),y)
 SYSTEMD_CONF_OPTS += --enable-binfmt
 else