From 9226a9907c4eb0fffab777f50e88b74aa14d1737 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 17 Nov 2012 03:52:14 +0000 Subject: Warn the user about the usage of output/target as the root filesystem A very common mistake done by our users is that they use output/target/ directory as their root filesystem. Even though this is loudly documented in our Buildroot manual, people don't read documentation, so it is not sufficient. This patch adds a text file named output/target/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM which explains why output/target isn't appropriate to use as the root filesystem. The process is: * At the beginning of the build, right after the skeleton has been copied, support/misc/target-dir-warning.txt is copied to output/target/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM * In the filesystem images creation code, this file is removed before launching fakeroot, and restored right after that, so that this file is not present in the generated root filesystem images. Note that the file has not been added to the default skeleton for two reasons: * It would have annoying to have in our source tree a file named in capital letters inside system/skeleton/ * The proposed way works even if the user uses a custom skeleton. [Peter: fixed typo] Signed-off-by: Thomas Petazzoni Cc: Juha Lumme Acked-by: Gustavo Zacarias Signed-off-by: Peter Korsgaard --- fs/common.mk | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fs') diff --git a/fs/common.mk b/fs/common.mk index 0f0eae996..b1512dd95 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -45,6 +45,7 @@ $(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) + rm -f $(TARGET_DIR_WARNING_FILE) echo "chown -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT) ifneq ($(ROOTFS_DEVICE_TABLES),) cat $(ROOTFS_DEVICE_TABLES) > $(FULL_DEVICE_TABLE) @@ -57,6 +58,7 @@ endif echo "$(ROOTFS_$(2)_CMD)" >> $(FAKEROOT_SCRIPT) chmod a+x $(FAKEROOT_SCRIPT) $(HOST_DIR)/usr/bin/fakeroot -- $(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) -- cgit v1.2.3