public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] --cvs-exclude for mkfs.jffs2
@ 2005-11-29  2:26 Michael Richardson
  2005-11-29 10:09 ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Richardson @ 2005-11-29  2:26 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 3218 bytes --]



This adds an option to ignore CVS directories.
We keep bunch of our system that are hard to recreated easily from source
in CVS, and we don't really want to waste space with CVS/Entries, etc.

Man page in following patch.

Signoff: Michael Richardson <mcr@sandelman.ca>

---

 util/mkfs.jffs2.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

applies-to: 078d53047fee81aaab9205a659805a07715076e5
092cb3518a5faa486e62a83796a280f3d45e1229
diff --git a/util/mkfs.jffs2.c b/util/mkfs.jffs2.c
index 7e60a3f..fe0cc63 100644
--- a/util/mkfs.jffs2.c
+++ b/util/mkfs.jffs2.c
@@ -69,6 +69,14 @@
 #undef crc32
 #include "crc32.h"
 
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+
 /* Do not use the wierd XPG version of basename */
 #undef basename
 
@@ -101,6 +109,7 @@ static int verbose = 0;
 static int squash_uids = 0;
 static int squash_perms = 0;
 static int fake_times = 0;
+static int CVSexclude = FALSE;
 int target_endian = __BYTE_ORDER;
 static const char *const app_name = "mkfs.jffs2";
 static const char *const memory_exhausted = "memory exhausted";
@@ -391,6 +400,15 @@ static struct filesystem_entry *recursiv
 			continue;
 		}
 
+		/* ignore the CVS directories */
+		if(CVSexclude &&
+		   (strcmp(dp->d_name, "CVS")==0
+		    || strcmp(dp->d_name, ".KEEP_ME")==0
+		    )) {
+		  free(dp);
+		  continue;
+		}
+
 		asprintf(&hpath, "%s/%s", hostpath, dp->d_name);
 		if (lstat(hpath, &sb)) {
 			perror_msg_and_die("%s", hpath);
@@ -1171,6 +1189,7 @@ static struct option long_options[] = {
 	{"disable-compressor", 1, NULL, 'x'},
 	{"test-compression", 0, NULL, 't'},
 	{"compressor-priority", 1, NULL, 'y'},
+	{"cvs-exclude", 0, NULL, 'C'},
 	{"incremental", 1, NULL, 'i'},
 	{NULL, 0, NULL, 0}
 };
@@ -1183,6 +1202,7 @@ static char *helptext =
 	"                          not specified, the output is padded to the end of\n"
 	"                          the final erase block\n"
 	"  -r, -d, --root=DIR      Build file system from directory DIR (default: cwd)\n"
+        "  --cvs-exclude           Ignore CVS directories, and .KEEP_ME files\n"
 	"  -s, --pagesize=SIZE     Use page size (max data node size) SIZE (default: 4KiB)\n"
 	"  -e, --eraseblock=SIZE   Use erase block size SIZE (default: 64KiB)\n"
 	"  -c, --eraseblock-header=SIZE  Size of eraseblock header (default 28)\n"
@@ -1388,6 +1408,10 @@ int main(int argc, char **argv)
 				rootdir = xstrdup(optarg);
 				break;
 
+ 		        case 'C':
+			        CVSexclude = TRUE;
+			        break;
+
 			case 's':
 				page_size = strtol(optarg, NULL, 0);
 				break;
@@ -1548,6 +1572,10 @@ int main(int argc, char **argv)
 	if (!(cwd = getcwd(0, GETCWD_SIZE)))
 		perror_msg_and_die("getcwd failed");
 
+	if(verbose) {
+	  printf("Initializing image from %s (%s)\n", rootdir, cwd);
+	}
+
 	if(in_fd != -1)
 		parse_image();
 
---
0.99.9.GIT


-- 
]       ON HUMILITY: to err is human. To moo, bovine.           |  firewalls  [
]   Michael Richardson,    Xelerance Corporation, Ottawa, ON    |net architect[
] mcr@xelerance.com      http://www.sandelman.ottawa.on.ca/mcr/ |device driver[
] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [

[-- Attachment #2: Type: application/pgp-signature, Size: 480 bytes --]

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

end of thread, other threads:[~2005-11-29 20:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-29  2:26 [PATCH 1/2] --cvs-exclude for mkfs.jffs2 Michael Richardson
2005-11-29 10:09 ` Wolfgang Denk
2005-11-29 10:41   ` Bernd Petrovitsch
2005-11-29 14:08   ` Jörn Engel
2005-11-29 15:18   ` Michael Richardson
2005-11-29 17:08     ` Josh Boyer
2005-11-29 17:12       ` Josh Boyer
2005-11-29 20:31         ` Michael Richardson
2005-11-29 20:46     ` Wolfgang Denk

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