From: Michael Richardson <mcr@sandelman.ottawa.on.ca>
To: linux-mtd@lists.infradead.org
Subject: [PATCH 1/2] --cvs-exclude for mkfs.jffs2
Date: Mon, 28 Nov 2005 21:26:22 -0500 [thread overview]
Message-ID: <v0mzjofaup.fsf@marajade.sandelman.ca> (raw)
[-- 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 --]
next reply other threads:[~2005-11-29 2:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-29 2:26 Michael Richardson [this message]
2005-11-29 10:09 ` [PATCH 1/2] --cvs-exclude for mkfs.jffs2 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=v0mzjofaup.fsf@marajade.sandelman.ca \
--to=mcr@sandelman.ottawa.on.ca \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox