diff --git a/Makefile b/Makefile index 6eca3c9ec6..6cfe83072e 100644 --- a/Makefile +++ b/Makefile @@ -677,6 +677,9 @@ endif $(TARGETS_ROOTFS): target-finalize +# Avoid the rootfs name leaking down the dependency chain +target-finalize: ROOTFS= + .PHONY: target-finalize target-finalize: $(PACKAGES) @$(call MESSAGE,"Finalizing target directory") diff --git a/fs/common.mk b/fs/common.mk index 274a3e9c7b..19a975aa47 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -72,6 +72,7 @@ ROOTFS_$(2)_COMPRESS_EXT = .xz ROOTFS_$(2)_COMPRESS_CMD = xz -9 -C crc32 -c endif +$$(BINARIES_DIR)/rootfs.$(1): ROOTFS=$(2) $$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(ROOTFS_$(2)_DEPENDENCIES) @$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)") rm -rf $(FS_DIR) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 6d82f7027e..152e1d0c67 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -384,6 +384,10 @@ endef define inner-generic-package +# When doing a package, we're definitely not doing a rootfs, but we +# may inherit it via the dependency chain, so we reset it. +$(1): ROOTFS= + # Ensure the package is only declared once, i.e. do not accept that a # package be re-defined by a br2-external tree ifneq ($(call strip,$(filter $(1),$(PACKAGES_ALL))),)