@@ -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)
@@ -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))
@@ -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 \
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(-)