aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-11-17 03:52:14 +0000
committerGravatar Peter Korsgaard <jacmet@sunsite.dk>2012-11-17 17:12:49 +0100
commit9226a9907c4eb0fffab777f50e88b74aa14d1737 (patch)
tree10f2f5d570f20e6643aa60a0148947c28cbe6cfa /Makefile
parentee3a96137b6cbb8f970c540c61f75300a44ea803 (diff)
downloadbuildroot-9226a9907c4eb0fffab777f50e88b74aa14d1737.tar.gz
buildroot-9226a9907c4eb0fffab777f50e88b74aa14d1737.tar.bz2
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 <thomas.petazzoni@free-electrons.com> Cc: Juha Lumme <juha.lumme@gmail.com> Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c526fe1c10..3e7d520af5 100644
--- a/Makefile
+++ b/Makefile
@@ -269,6 +269,10 @@ LEGAL_LICENSES_TXT=$(LEGAL_INFO_DIR)/licenses.txt
LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings
LEGAL_REPORT=$(LEGAL_INFO_DIR)/README
+# Location of a file giving a big fat warning that output/target
+# should not be used as the root filesystem.
+TARGET_DIR_WARNING_FILE=$(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
+
ifeq ($(BR2_CCACHE),y)
CCACHE:=$(HOST_DIR)/usr/bin/ccache
BUILDROOT_CACHE_DIR = $(call qstrip,$(BR2_CCACHE_DIR))
@@ -403,6 +407,7 @@ $(BUILD_DIR)/.root:
cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \
fi; \
fi
+ cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
-find $(TARGET_DIR) -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf
-find $(TARGET_DIR) -type f \( -name .empty -o -name '*~' \) -print0 | xargs -0 rm -rf
touch $@