All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/eudev: remove HOST_EUDEV_SYSCONFDIR
@ 2022-07-28 19:37 Arnout Vandecappelle (Essensium/Mind)
  2022-07-28 19:37 ` [Buildroot] [PATCH 2/2] Makefile: always delete hwdb sources Arnout Vandecappelle (Essensium/Mind)
  2022-07-28 21:05 ` [Buildroot] [PATCH 1/2] package/eudev: remove HOST_EUDEV_SYSCONFDIR Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Arnout Vandecappelle (Essensium/Mind) @ 2022-07-28 19:37 UTC (permalink / raw)
  To: buildroot
  Cc: Bernd Kuhls, Eric Le Bihan, Sen Hastings, Norbert Lange, Yann E . MORIN

The HOST_EUDEV_SYSCONFDIR is a leftover from before eudev, when udev was
still built from systemd sources. Now that we have a separate file for
eudev and systemd, there's no need any more to have a condition there.
In addition, its usage in systemd.mk has been removed.

Remove the HOST_EUDEV_SYSCONFDIR variable and instead use /etc directly
in eudev.mk.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 package/eudev/eudev.mk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/package/eudev/eudev.mk b/package/eudev/eudev.mk
index 705370689d..f050563feb 100644
--- a/package/eudev/eudev.mk
+++ b/package/eudev/eudev.mk
@@ -57,13 +57,12 @@ endef
 
 HOST_EUDEV_DEPENDENCIES = host-gperf host-pkgconf
 
-HOST_EUDEV_SYSCONFDIR = $(if $(BR2_PACKAGE_SYSTEMD),/usr/lib,/etc)
 HOST_EUDEV_CONF_OPTS = \
 	--prefix=/usr \
 	--sbindir=/sbin \
 	--libexecdir=/lib \
 	--with-rootlibdir=/lib \
-	--sysconfdir=$(HOST_EUDEV_SYSCONFDIR) \
+	--sysconfdir=/etc \
 	--disable-blkid \
 	--disable-introspection \
 	--disable-kmod \
@@ -86,7 +85,7 @@ HOST_EUDEV_TARGET_FINALIZE_HOOKS += HOST_EUDEV_BUILD_HWDB
 # of tharget/, not the real one, so the files are still available on
 # re-builds (foo-rebuild, etc...)
 define HOST_EUDEV_RM_HWDB_SRC
-	rm -rf $(TARGET_DIR)/$(HOST_EUDEV_SYSCONFDIR)/udev/hwdb.d/
+	rm -rf $(TARGET_DIR)/etc/udev/hwdb.d/
 endef
 HOST_EUDEV_ROOTFS_PRE_CMD_HOOKS += HOST_EUDEV_RM_HWDB_SRC
 
-- 
2.35.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 2/2] Makefile: always delete hwdb sources
  2022-07-28 19:37 [Buildroot] [PATCH 1/2] package/eudev: remove HOST_EUDEV_SYSCONFDIR Arnout Vandecappelle (Essensium/Mind)
@ 2022-07-28 19:37 ` Arnout Vandecappelle (Essensium/Mind)
  2022-07-28 21:05 ` [Buildroot] [PATCH 1/2] package/eudev: remove HOST_EUDEV_SYSCONFDIR Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle (Essensium/Mind) @ 2022-07-28 19:37 UTC (permalink / raw)
  To: buildroot
  Cc: Bernd Kuhls, Eric Le Bihan, Sen Hastings, Norbert Lange, Yann E . MORIN

In eudev and systemd, we have code that deletes the hwdb sources from
the target - they are not useful since a binary hwdb is created from
them. However, if eudev or systemd is not used, then those sources are
not useful either. It's possible that other packages than eudev or
systemd install hwdb files, which would be left on the system.

Always remove the hwdb files.

Note that we don't expect much space savings from this, but anything may
help. It's certainly more consistent to do it always than just in eudev
and systemd.

We do this both from /usr/lib/udev (usual installation path for systemd)
and in /etc/udev (usual installation path for eudev) because packages
may install in either location.

We keep the comment explaining why it's done in rootfs-pre-cmd instead
of target-finalize - this was only present in eudev.mk.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 Makefile                   | 8 ++++++++
 package/eudev/eudev.mk     | 8 --------
 package/systemd/systemd.mk | 5 -----
 3 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index f116ccb5bc..e30e778346 100644
--- a/Makefile
+++ b/Makefile
@@ -807,6 +807,14 @@ endif # merged /usr
 
 	touch $(TARGET_DIR)/usr
 
+# Note: this will run in the filesystem context, so will use a copy
+# of target/, not the real one, so the files are still available on
+# re-builds (foo-rebuild, etc...)
+define ROOTFS_RM_HWDB_DATA
+	rm -rf $(TARGET_DIR)/usr/lib/udev/hwdb.d/ $(TARGET_DIR)/etc/udev/hwdb.d/
+endef
+ROOTFS_PRE_CMD_HOOKS += ROOTFS_RM_HWDB_DATA
+
 .PHONY: target-post-image
 target-post-image: $(TARGETS_ROOTFS) target-finalize staging-finalize
 	@rm -f $(ROOTFS_COMMON_TAR)
diff --git a/package/eudev/eudev.mk b/package/eudev/eudev.mk
index f050563feb..feb5505289 100644
--- a/package/eudev/eudev.mk
+++ b/package/eudev/eudev.mk
@@ -81,13 +81,5 @@ define HOST_EUDEV_BUILD_HWDB
 endef
 HOST_EUDEV_TARGET_FINALIZE_HOOKS += HOST_EUDEV_BUILD_HWDB
 
-# Note: this will run in the filesystem context, so will use a copy
-# of tharget/, not the real one, so the files are still available on
-# re-builds (foo-rebuild, etc...)
-define HOST_EUDEV_RM_HWDB_SRC
-	rm -rf $(TARGET_DIR)/etc/udev/hwdb.d/
-endef
-HOST_EUDEV_ROOTFS_PRE_CMD_HOOKS += HOST_EUDEV_RM_HWDB_SRC
-
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 19fd525534..1d7452de19 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -732,11 +732,6 @@ endef
 SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_UPDATE_CATALOGS
 endif
 
-define SYSTEMD_RM_HWDB_DATA
-	rm -rf $(TARGET_DIR)/usr/lib/udev/hwdb.d/ $(TARGET_DIR)/etc/udev/hwdb.d/
-endef
-SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_RM_HWDB_DATA
-
 define SYSTEMD_RM_CATALOG_UPDATE_SERVICE
 	rm -rf $(TARGET_DIR)/usr/lib/systemd/catalog \
 		$(TARGET_DIR)/usr/lib/systemd/system/systemd-journal-catalog-update.service \
-- 
2.35.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/2] package/eudev: remove HOST_EUDEV_SYSCONFDIR
  2022-07-28 19:37 [Buildroot] [PATCH 1/2] package/eudev: remove HOST_EUDEV_SYSCONFDIR Arnout Vandecappelle (Essensium/Mind)
  2022-07-28 19:37 ` [Buildroot] [PATCH 2/2] Makefile: always delete hwdb sources Arnout Vandecappelle (Essensium/Mind)
@ 2022-07-28 21:05 ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-07-28 21:05 UTC (permalink / raw)
  To: Arnout Vandecappelle (Essensium/Mind)
  Cc: Bernd Kuhls, Eric Le Bihan, Sen Hastings, buildroot,
	Norbert Lange, Yann E . MORIN

On Thu, 28 Jul 2022 21:37:25 +0200
"Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be> wrote:

> The HOST_EUDEV_SYSCONFDIR is a leftover from before eudev, when udev was
> still built from systemd sources. Now that we have a separate file for
> eudev and systemd, there's no need any more to have a condition there.
> In addition, its usage in systemd.mk has been removed.
> 
> Remove the HOST_EUDEV_SYSCONFDIR variable and instead use /etc directly
> in eudev.mk.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
>  package/eudev/eudev.mk | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Both applied, thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-07-28 21:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-28 19:37 [Buildroot] [PATCH 1/2] package/eudev: remove HOST_EUDEV_SYSCONFDIR Arnout Vandecappelle (Essensium/Mind)
2022-07-28 19:37 ` [Buildroot] [PATCH 2/2] Makefile: always delete hwdb sources Arnout Vandecappelle (Essensium/Mind)
2022-07-28 21:05 ` [Buildroot] [PATCH 1/2] package/eudev: remove HOST_EUDEV_SYSCONFDIR Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.