]> Git Repo - buildroot-mgba.git/blobdiff - fs/common.mk
qemu/sh4-r2d: update to use kernel 3.2.35
[buildroot-mgba.git] / fs / common.mk
index cc94eb4ef22fc0a02e06449dea3d9740fc09d1d5..b1512dd957e25caf5c338497db3f547ca61549bf 100644 (file)
 #  ROOTFS_$(FSTYPE)_POST_GEN_HOOKS, a list of hooks to call after
 #  generating the filesystem image
 #
+#  ROOTFS_$(FSTYPE)_POST_TARGETS, the list of targets that should be
+#  run after running the main filesystem target. This is useful for
+#  initramfs, to rebuild the kernel once the initramfs is generated.
+#
 # In terms of configuration option, this macro assumes that the
 # BR2_TARGET_ROOTFS_$(FSTYPE) config option allows to enable/disable
 # the generation of a filesystem image of a particular type. If
 # macro will automatically generate a compressed filesystem image.
 
 FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs
-ROOTFS_DEVICE_TABLE = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE))
+FULL_DEVICE_TABLE = $(BUILD_DIR)/_device_table.txt
+ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE)) \
+       $(call qstrip,$(BR2_ROOTFS_STATIC_DEVICE_TABLE))
 
 define ROOTFS_TARGET_INTERNAL
 
-$(BINARIES_DIR)/rootfs.$(1): $(ROOTFS_$(2)_DEPENDENCIES) host-fakeroot makedevs $(if $(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma)
+# extra deps
+$(eval ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs $(if $(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma))
+
+$(BINARIES_DIR)/rootfs.$(1): $(ROOTFS_$(2)_DEPENDENCIES)
        @$(call MESSAGE,"Generating root filesystem image rootfs.$(1)")
        $(foreach hook,$(ROOTFS_$(2)_PRE_GEN_HOOKS),$(call $(hook))$(sep))
        rm -f $(FAKEROOT_SCRIPT)
-       touch $(BUILD_DIR)/.fakeroot.00000
-       cat $(BUILD_DIR)/.fakeroot* > $(FAKEROOT_SCRIPT)
+       rm -f $(TARGET_DIR_WARNING_FILE)
        echo "chown -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
-ifneq ($(ROOTFS_DEVICE_TABLE),)
-       echo "$(HOST_DIR)/usr/bin/makedevs -d $(ROOTFS_DEVICE_TABLE) $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
+ifneq ($(ROOTFS_DEVICE_TABLES),)
+       cat $(ROOTFS_DEVICE_TABLES) > $(FULL_DEVICE_TABLE)
+ifeq ($(BR2_ROOTFS_DEVICE_CREATION_STATIC),y)
+       printf '$(subst $(sep),\n,$(PACKAGES_DEVICES_TABLE))' >> $(FULL_DEVICE_TABLE)
+endif
+       printf '$(subst $(sep),\n,$(PACKAGES_PERMISSIONS_TABLE))' >> $(FULL_DEVICE_TABLE)
+       echo "$(HOST_DIR)/usr/bin/makedevs -d $(FULL_DEVICE_TABLE) $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
 endif
        echo "$(ROOTFS_$(2)_CMD)" >> $(FAKEROOT_SCRIPT)
        chmod a+x $(FAKEROOT_SCRIPT)
        $(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
-       -@rm -f $(FAKEROOT_SCRIPT)
+       cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
+       -@rm -f $(FAKEROOT_SCRIPT) $(FULL_DEVICE_TABLE)
        $(foreach hook,$(ROOTFS_$(2)_POST_GEN_HOOKS),$(call $(hook))$(sep))
 ifeq ($$(BR2_TARGET_ROOTFS_$(2)_GZIP),y)
        gzip -9 -c $$@ > [email protected]
@@ -57,10 +71,13 @@ ifeq ($$(BR2_TARGET_ROOTFS_$(2)_LZMA),y)
        $(LZMA) -9 -c $$@ > [email protected]
 endif
 
-$(1)-root: $(BINARIES_DIR)/rootfs.$(1)
+rootfs-$(1)-show-depends:
+       @echo $(ROOTFS_$(2)_DEPENDENCIES)
+
+rootfs-$(1): $(BINARIES_DIR)/rootfs.$(1) $(ROOTFS_$(2)_POST_TARGETS)
 
 ifeq ($$(BR2_TARGET_ROOTFS_$(2)),y)
-TARGETS += $(1)-root
+TARGETS += rootfs-$(1)
 endif
 endef
 
This page took 0.026228 seconds and 4 git commands to generate.