Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] Makefile: add target to clean targetfs
@ 2015-03-10  0:25 Emeric Vigier
  2015-03-10  4:45 ` Baruch Siach
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Emeric Vigier @ 2015-03-10  0:25 UTC (permalink / raw)
  To: buildroot

If you had some files added to the targetfs (fs-overlay, new packages,
...) and you no longer need them, buildroot does not offer a simple way
to remove these items from the output/target directory. The rule added
by this commit allows you to clean the targetfs. Issuing 'make'
afterward will generate a new and clean targetfs.

A section in the documentation is also added. It describes few examples
when developers could need it.

Signed-off-by: Emeric Vigier <emeric.vigier@savoirfairelinux.com>
---
 Makefile                                |  5 +++++
 docs/manual/advanced.txt                |  2 ++
 docs/manual/clean-target-filesystem.txt | 37 +++++++++++++++++++++++++++++++++
 3 files changed, 44 insertions(+)
 create mode 100644 docs/manual/clean-target-filesystem.txt

diff --git a/Makefile b/Makefile
index af043a3..eee2dbb 100644
--- a/Makefile
+++ b/Makefile
@@ -679,6 +679,11 @@ graph-depends: graph-depends-requirements
 	|tee $(BASE_DIR)/graphs/$(@).dot \
 	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(BASE_DIR)/graphs/$(@).$(BR_GRAPH_OUT)
 
+clean-target:
+	rm -rf $(TARGET_DIR) $(STAGING_DIR) $(BUILD_DIR)/.root \
+		$(BUILD_DIR)/*/.stamp_target_installed $(BUILD_DIR)/*/.stamp_staging_installed \
+		$(BUILD_DIR)/linux-*/.stamp_installed $(BUILD_DIR)/*/.built
+
 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
 all: menuconfig
diff --git a/docs/manual/advanced.txt b/docs/manual/advanced.txt
index b7bfc49..1cf0427 100644
--- a/docs/manual/advanced.txt
+++ b/docs/manual/advanced.txt
@@ -14,3 +14,5 @@ include::download-location.txt[]
 include::package-make-target.txt[]
 
 include::using-buildroot-development.txt[]
+
+include::clean-target-filesystem.txt[]
diff --git a/docs/manual/clean-target-filesystem.txt b/docs/manual/clean-target-filesystem.txt
new file mode 100644
index 0000000..0274474
--- /dev/null
+++ b/docs/manual/clean-target-filesystem.txt
@@ -0,0 +1,37 @@
+// -*- mode:doc; -*-
+// vim: set syntax=asciidoc:
+
+==== Clean target filesystem
+
+There are various cases where you would like to clean the target
+filesystem. Especially once you understood that buildroot build system
+is kept simple, and does not allow to uninstall files. Let's take some
+examples:
+
+1. You enabled +PACKAGE_OPENSSH+ to have a SSH server running on your
+   board. But you figure out that +sshd+ does not run well on your
+   target's architecture. Thus you decide to disable +PACKAGE_OPENSSH+
+   and enable +PACKAGE_DROPBEAR+ instead. You run +make+, +openssh+
+   gets built and installed. Problem: +openssh+ files are still present
+   in +output/target+!
+
+2. You enabled +PACKAGE_NTPD+ and set the local timezone to
+   +America/Montreal+ with +BR2_TARGET_LOCALTIME+ config. Then you find
+   out that +Montreal+ local has been replaced by +Toronto+ (French
+   looks like a rogue language). You enter +make menuconfig+, make the
+   change, save, and run +make+ again. Problem:
+   +output/target/etc/timezone+ still has +America/Montreal+ content!
+
+Solution to this is either to identify which package to reconfigure, or
+remove files manually, or destroy the target filesystem and recreate it.
+This latter option is convenient: you don't have to care about which
+packages to rebuild, and it is fast. Here is how to recreate your
+target filesystem, and get rid of filesystem _stains_:
+
+------------------
+make clean-target
+make
+------------------
+
++clean-target+ removes +output/target+, tells buildroot to recreate the
+target skeleton, and install each package again.
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2015-10-04 16:56 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-10  0:25 [Buildroot] [PATCH 1/1] Makefile: add target to clean targetfs Emeric Vigier
2015-03-10  4:45 ` Baruch Siach
2015-03-10 14:56   ` Emeric Vigier
2015-03-10 15:17     ` Baruch Siach
2015-03-10 19:28 ` [Buildroot] [PATCH v2 " Emeric Vigier
2015-03-10 23:41   ` Ryan Barnett
2015-03-11  5:06     ` Baruch Siach
2015-03-11  8:22       ` Angelo Compagnucci
2015-03-11  8:58         ` Baruch Siach
2015-03-12  8:32           ` Angelo Compagnucci
2015-03-12 14:56             ` Emeric Vigier
2015-03-12 14:44     ` Emeric Vigier
2015-03-12 14:46       ` Ryan Barnett
2015-03-12  8:36   ` Angelo Compagnucci
2015-03-12 15:59   ` Jérôme Oufella
2015-04-27  0:45 ` [Buildroot] [PATCH v3 " Emeric Vigier
2015-04-27  4:11   ` Baruch Siach
2015-04-28 14:36     ` Emeric Vigier
2015-04-27  8:28   ` Andreas Naumann
2015-04-28 15:06     ` Emeric Vigier
2015-07-14 21:56     ` Emeric Vigier
2015-07-16 15:15       ` Emeric Vigier
2015-07-23 20:51         ` Andreas Naumann
2015-10-04 16:56   ` Arnout Vandecappelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox