diff options
Diffstat (limited to 'meta/packages/mtd')
7 files changed, 308 insertions, 0 deletions
diff --git a/meta/packages/mtd/mtd-utils-native_20060223.bb b/meta/packages/mtd/mtd-utils-native_20060223.bb new file mode 100644 index 0000000000..cd1fb7d11b --- /dev/null +++ b/meta/packages/mtd/mtd-utils-native_20060223.bb | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | LICENSE = "GPLv2" | ||
| 2 | SECTION = "base" | ||
| 3 | include mtd-utils_${PV}.bb | ||
| 4 | inherit native | ||
| 5 | DEPENDS = "zlib-native" | ||
| 6 | FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/mtd-utils" | ||
| 7 | |||
| 8 | do_stage () { | ||
| 9 | for binary in ${mtd_utils}; do | ||
| 10 | install -m 0755 util/$binary ${STAGING_BINDIR}/ | ||
| 11 | done | ||
| 12 | } | ||
diff --git a/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-20060131.patch b/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-20060131.patch new file mode 100644 index 0000000000..e24f395890 --- /dev/null +++ b/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-20060131.patch | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | --- mtd/util/mkfs.jffs2.c~add-exclusion-to-mkfs-jffs2.patch | ||
| 2 | +++ mtd/util/mkfs.jffs2.c | ||
| 3 | @@ -92,7 +92,12 @@ | ||
| 4 | struct filesystem_entry *files; /* Only relevant to directories */ | ||
| 5 | }; | ||
| 6 | |||
| 7 | - | ||
| 8 | +struct ignorepath_entry { | ||
| 9 | + struct ignorepath_entry* next; /* Points to the next ignorepath element */ | ||
| 10 | + char name[PATH_MAX]; /* Name of the entry */ | ||
| 11 | +}; | ||
| 12 | + | ||
| 13 | +static struct ignorepath_entry* ignorepath = 0; | ||
| 14 | static int out_fd = -1; | ||
| 15 | static int in_fd = -1; | ||
| 16 | static char default_rootdir[] = "."; | ||
| 17 | @@ -367,7 +372,7 @@ | ||
| 18 | char *hpath, *tpath; | ||
| 19 | struct dirent *dp, **namelist; | ||
| 20 | struct filesystem_entry *entry; | ||
| 21 | - | ||
| 22 | + struct ignorepath_entry* element = ignorepath; | ||
| 23 | |||
| 24 | if (lstat(hostpath, &sb)) { | ||
| 25 | perror_msg_and_die("%s", hostpath); | ||
| 26 | @@ -376,6 +381,15 @@ | ||
| 27 | entry = add_host_filesystem_entry(targetpath, hostpath, | ||
| 28 | sb.st_uid, sb.st_gid, sb.st_mode, 0, parent); | ||
| 29 | |||
| 30 | + while ( element ) { | ||
| 31 | + if ( strcmp( element->name, targetpath ) == 0 ) { | ||
| 32 | + printf( "Note: ignoring directories below '%s'\n", targetpath ); | ||
| 33 | + return entry; | ||
| 34 | + break; | ||
| 35 | + } | ||
| 36 | + element = element->next; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | n = scandir(hostpath, &namelist, 0, alphasort); | ||
| 40 | if (n < 0) { | ||
| 41 | perror_msg_and_die("opening directory %s", hostpath); | ||
| 42 | @@ -1157,6 +1171,7 @@ | ||
| 43 | {"root", 1, NULL, 'r'}, | ||
| 44 | {"pagesize", 1, NULL, 's'}, | ||
| 45 | {"eraseblock", 1, NULL, 'e'}, | ||
| 46 | + {"ignore", 1, NULL, 'I'}, | ||
| 47 | {"output", 1, NULL, 'o'}, | ||
| 48 | {"help", 0, NULL, 'h'}, | ||
| 49 | {"verbose", 0, NULL, 'v'}, | ||
| 50 | @@ -1199,6 +1214,7 @@ | ||
| 51 | " -L, --list-compressors Show the list of the avaiable compressors\n" | ||
| 52 | " -t, --test-compression Call decompress and compare with the original (for test)\n" | ||
| 53 | " -n, --no-eraseblock-headers Don't add a eraseblock header to every eraseblock\n" | ||
| 54 | + " -I, --ignore=PATH Ignore sub directory and file tree below PATH when recursing over the file system\n" | ||
| 55 | " -o, --output=FILE Output to FILE (default: stdout)\n" | ||
| 56 | " -l, --little-endian Create a little-endian filesystem\n" | ||
| 57 | " -b, --big-endian Create a big-endian filesystem\n" | ||
| 58 | @@ -1368,11 +1384,12 @@ | ||
| 59 | struct filesystem_entry *root; | ||
| 60 | char *compr_name = NULL; | ||
| 61 | int compr_prior = -1; | ||
| 62 | + struct ignorepath_entry* element = ignorepath; | ||
| 63 | |||
| 64 | jffs2_compressors_init(); | ||
| 65 | |||
| 66 | while ((opt = getopt_long(argc, argv, | ||
| 67 | - "D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0) | ||
| 68 | + "D:d:r:s:I:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0) | ||
| 69 | { | ||
| 70 | switch (opt) { | ||
| 71 | case 'D': | ||
| 72 | @@ -1395,6 +1412,28 @@ | ||
| 73 | page_size = strtol(optarg, NULL, 0); | ||
| 74 | break; | ||
| 75 | |||
| 76 | + case 'I': | ||
| 77 | + printf( "Note: Adding '%s' to ignore Path\n", optarg ); | ||
| 78 | + element = ignorepath; | ||
| 79 | + if ( !ignorepath ) { | ||
| 80 | + ignorepath = xmalloc( sizeof( struct ignorepath_entry ) ); | ||
| 81 | + ignorepath->next = 0; | ||
| 82 | + strcpy( &ignorepath->name[0], optarg ); | ||
| 83 | + } else { | ||
| 84 | + while ( element->next ) element = element->next; | ||
| 85 | + element->next = xmalloc( sizeof( struct ignorepath_entry ) ); | ||
| 86 | + element->next->next = 0; | ||
| 87 | + strcpy( &element->next->name[0], optarg ); | ||
| 88 | + } | ||
| 89 | + printf( "--------- Dumping ignore path list ----------------\n" ); | ||
| 90 | + element = ignorepath; | ||
| 91 | + while ( element ) { | ||
| 92 | + printf( " * '%s'\n", &element->name[0] ); | ||
| 93 | + element = element->next; | ||
| 94 | + } | ||
| 95 | + printf( "---------------------------------------------------\n" ); | ||
| 96 | + break; | ||
| 97 | + | ||
| 98 | case 'o': | ||
| 99 | if (out_fd != -1) { | ||
| 100 | error_msg_and_die("output filename specified more than once"); | ||
diff --git a/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2.patch b/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2.patch new file mode 100644 index 0000000000..3ac41280bb --- /dev/null +++ b/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2.patch | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | |||
| 2 | # | ||
| 3 | # Patch managed by http://www.holgerschurig.de/patcher.html | ||
| 4 | # | ||
| 5 | |||
| 6 | --- mtd/util/mkfs.jffs2.c~add-exclusion-to-mkfs-jffs2.patch | ||
| 7 | +++ mtd/util/mkfs.jffs2.c | ||
| 8 | @@ -92,7 +92,12 @@ | ||
| 9 | struct filesystem_entry *files; /* Only relevant to directories */ | ||
| 10 | }; | ||
| 11 | |||
| 12 | +struct ignorepath_entry { | ||
| 13 | + struct ignorepath_entry* next; /* Points to the next ignorepath element */ | ||
| 14 | + char name[PATH_MAX]; /* Name of the entry */ | ||
| 15 | +}; | ||
| 16 | |||
| 17 | +static struct ignorepath_entry* ignorepath = 0; | ||
| 18 | static int out_fd = -1; | ||
| 19 | static int in_fd = -1; | ||
| 20 | static char default_rootdir[] = "."; | ||
| 21 | @@ -367,6 +372,7 @@ | ||
| 22 | char *hpath, *tpath; | ||
| 23 | struct dirent *dp, **namelist; | ||
| 24 | struct filesystem_entry *entry; | ||
| 25 | + struct ignorepath_entry* element = ignorepath; | ||
| 26 | |||
| 27 | |||
| 28 | if (lstat(hostpath, &sb)) { | ||
| 29 | @@ -376,6 +382,15 @@ | ||
| 30 | entry = add_host_filesystem_entry(targetpath, hostpath, | ||
| 31 | sb.st_uid, sb.st_gid, sb.st_mode, 0, parent); | ||
| 32 | |||
| 33 | + while ( element ) { | ||
| 34 | + if ( strcmp( element->name, targetpath ) == 0 ) { | ||
| 35 | + printf( "Note: ignoring directories below '%s'\n", targetpath ); | ||
| 36 | + return entry; | ||
| 37 | + break; | ||
| 38 | + } | ||
| 39 | + element = element->next; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | n = scandir(hostpath, &namelist, 0, alphasort); | ||
| 43 | if (n < 0) { | ||
| 44 | perror_msg_and_die("opening directory %s", hostpath); | ||
| 45 | @@ -1147,6 +1162,7 @@ | ||
| 46 | {"root", 1, NULL, 'r'}, | ||
| 47 | {"pagesize", 1, NULL, 's'}, | ||
| 48 | {"eraseblock", 1, NULL, 'e'}, | ||
| 49 | + {"ignore", 1, NULL, 'I'}, | ||
| 50 | {"output", 1, NULL, 'o'}, | ||
| 51 | {"help", 0, NULL, 'h'}, | ||
| 52 | {"verbose", 0, NULL, 'v'}, | ||
| 53 | @@ -1189,6 +1205,7 @@ | ||
| 54 | " -L, --list-compressors Show the list of the avaiable compressors\n" | ||
| 55 | " -t, --test-compression Call decompress and compare with the original (for test)\n" | ||
| 56 | " -n, --no-cleanmarkers Don't add a cleanmarker to every eraseblock\n" | ||
| 57 | + " -I, --ignore=PATH Ignore sub directory and file tree below PATH when recursing over the file system\n" | ||
| 58 | " -o, --output=FILE Output to FILE (default: stdout)\n" | ||
| 59 | " -l, --little-endian Create a little-endian filesystem\n" | ||
| 60 | " -b, --big-endian Create a big-endian filesystem\n" | ||
| 61 | @@ -1349,11 +1366,12 @@ | ||
| 62 | struct filesystem_entry *root; | ||
| 63 | char *compr_name = NULL; | ||
| 64 | int compr_prior = -1; | ||
| 65 | + struct ignorepath_entry* element = ignorepath; | ||
| 66 | |||
| 67 | jffs2_compressors_init(); | ||
| 68 | |||
| 69 | while ((opt = getopt_long(argc, argv, | ||
| 70 | - "D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0) | ||
| 71 | + "D:d:r:s:I:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0) | ||
| 72 | { | ||
| 73 | switch (opt) { | ||
| 74 | case 'D': | ||
| 75 | @@ -1376,6 +1394,28 @@ | ||
| 76 | page_size = strtol(optarg, NULL, 0); | ||
| 77 | break; | ||
| 78 | |||
| 79 | + case 'I': | ||
| 80 | + printf( "Note: Adding '%s' to ignore Path\n", optarg ); | ||
| 81 | + element = ignorepath; | ||
| 82 | + if ( !ignorepath ) { | ||
| 83 | + ignorepath = xmalloc( sizeof( struct ignorepath_entry ) ); | ||
| 84 | + ignorepath->next = 0; | ||
| 85 | + strcpy( &ignorepath->name[0], optarg ); | ||
| 86 | + } else { | ||
| 87 | + while ( element->next ) element = element->next; | ||
| 88 | + element->next = xmalloc( sizeof( struct ignorepath_entry ) ); | ||
| 89 | + element->next->next = 0; | ||
| 90 | + strcpy( &element->next->name[0], optarg ); | ||
| 91 | + } | ||
| 92 | + printf( "--------- Dumping ignore path list ----------------\n" ); | ||
| 93 | + element = ignorepath; | ||
| 94 | + while ( element ) { | ||
| 95 | + printf( " * '%s'\n", &element->name[0] ); | ||
| 96 | + element = element->next; | ||
| 97 | + } | ||
| 98 | + printf( "---------------------------------------------------\n" ); | ||
| 99 | + break; | ||
| 100 | + | ||
| 101 | case 'o': | ||
| 102 | if (out_fd != -1) { | ||
| 103 | error_msg_and_die("output filename specified more than once"); | ||
diff --git a/meta/packages/mtd/mtd-utils/fix-ignoreerrors-20060131.patch b/meta/packages/mtd/mtd-utils/fix-ignoreerrors-20060131.patch new file mode 100644 index 0000000000..8266a37c46 --- /dev/null +++ b/meta/packages/mtd/mtd-utils/fix-ignoreerrors-20060131.patch | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | --- mtd/util/nanddump.c.orig 2006-01-30 21:19:22.000000000 +0100 | ||
| 2 | +++ mtd/util/nanddump.c 2006-01-30 21:19:24.000000000 +0100 | ||
| 3 | @@ -224,7 +224,7 @@ | ||
| 4 | } | ||
| 5 | } | ||
| 6 | |||
| 7 | - if (badblock) { | ||
| 8 | + if (badblock && !ignoreerrors) { | ||
| 9 | if (omitbad) | ||
| 10 | continue; | ||
| 11 | memset (readbuf, 0xff, bs); | ||
| 12 | @@ -259,7 +259,7 @@ | ||
| 13 | if (omitoob) | ||
| 14 | continue; | ||
| 15 | |||
| 16 | - if (badblock) { | ||
| 17 | + if (badblock && !ignoreerrors) { | ||
| 18 | memset (readbuf, 0xff, meminfo.oobsize); | ||
| 19 | } else { | ||
| 20 | /* Read OOB data and exit on failure */ | ||
diff --git a/meta/packages/mtd/mtd-utils/fix-ignoreerrors.patch b/meta/packages/mtd/mtd-utils/fix-ignoreerrors.patch new file mode 100644 index 0000000000..b1f702a316 --- /dev/null +++ b/meta/packages/mtd/mtd-utils/fix-ignoreerrors.patch | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | --- mtd/util/nanddump.c.orig 2005-12-30 19:07:39.000000000 +0100 | ||
| 2 | +++ mtd/util/nanddump.c 2005-12-30 19:08:53.000000000 +0100 | ||
| 3 | @@ -224,7 +224,7 @@ | ||
| 4 | } | ||
| 5 | } | ||
| 6 | |||
| 7 | - if (badblock) { | ||
| 8 | + if (badblock && !ignoreerrors) { | ||
| 9 | if (omitbad) | ||
| 10 | continue; | ||
| 11 | memset (readbuf, 0xff, bs); | ||
| 12 | @@ -259,7 +259,7 @@ | ||
| 13 | if (omitoob) | ||
| 14 | continue; | ||
| 15 | |||
| 16 | - if (badblock) { | ||
| 17 | + if (badblock && !ignoreerrors) { | ||
| 18 | memset (readbuf, 0xff, meminfo.oobsize); | ||
| 19 | } else { | ||
| 20 | /* Read OOB data and exit on failure */ | ||
diff --git a/meta/packages/mtd/mtd-utils/more-verbosity.patch b/meta/packages/mtd/mtd-utils/more-verbosity.patch new file mode 100644 index 0000000000..cdc842a8f9 --- /dev/null +++ b/meta/packages/mtd/mtd-utils/more-verbosity.patch | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | |||
| 2 | # | ||
| 3 | # Patch managed by http://www.holgerschurig.de/patcher.html | ||
| 4 | # | ||
| 5 | |||
| 6 | --- mtd/util/mkfs.jffs2.c~more-verbosity.patch | ||
| 7 | +++ mtd/util/mkfs.jffs2.c | ||
| 8 | @@ -374,6 +374,9 @@ | ||
| 9 | struct filesystem_entry *entry; | ||
| 10 | struct ignorepath_entry* element = ignorepath; | ||
| 11 | |||
| 12 | + if (verbose) { | ||
| 13 | + printf( "mkfs.jffs2: scanning '%s'...\n", targetpath ); | ||
| 14 | + } | ||
| 15 | |||
| 16 | if (lstat(hostpath, &sb)) { | ||
| 17 | perror_msg_and_die("%s", hostpath); | ||
diff --git a/meta/packages/mtd/mtd-utils_20060223.bb b/meta/packages/mtd/mtd-utils_20060223.bb new file mode 100644 index 0000000000..21d0f21fcd --- /dev/null +++ b/meta/packages/mtd/mtd-utils_20060223.bb | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | DESCRIPTION = "Tools for managing memory technology devices." | ||
| 2 | SECTION = "base" | ||
| 3 | DEPENDS = "zlib" | ||
| 4 | HOMEPAGE = "http://www.linux-mtd.infradead.org/" | ||
| 5 | LICENSE = "GPLv2" | ||
| 6 | PR = "r0" | ||
| 7 | SRCDATE = "${PV}" | ||
| 8 | |||
| 9 | SRC_URI = "cvs://anoncvs:anoncvs@cvs.infradead.org/home/cvs;module=mtd \ | ||
| 10 | file://add-exclusion-to-mkfs-jffs2-20060131.patch;patch=1 \ | ||
| 11 | file://fix-ignoreerrors-20060131.patch;patch=1" | ||
| 12 | S = "${WORKDIR}/mtd/" | ||
| 13 | |||
| 14 | CFLAGS_prepend = "-I${S}/include " | ||
| 15 | |||
| 16 | do_compile () { | ||
| 17 | oe_runmake -C util ${mtd_utils} | ||
| 18 | } | ||
| 19 | |||
| 20 | do_stage () { | ||
| 21 | install -d ${STAGING_INCDIR}/mtd | ||
| 22 | for f in ${S}/include/mtd/*.h; do | ||
| 23 | install -m 0644 $f ${STAGING_INCDIR}/mtd/ | ||
| 24 | done | ||
| 25 | } | ||
| 26 | |||
| 27 | mtd_utils = "ftl_format flash_erase flash_eraseall nanddump doc_loadbios \ | ||
| 28 | mkfs.jffs ftl_check mkfs.jffs2 flash_lock flash_unlock flash_info mtd_debug \ | ||
| 29 | flashcp nandwrite jffs2dump sumtool" | ||
| 30 | |||
| 31 | do_install () { | ||
| 32 | install -d ${D}${bindir} | ||
| 33 | for binary in ${mtd_utils}; do | ||
| 34 | install -m 0755 util/$binary ${D}${bindir} | ||
| 35 | done | ||
| 36 | } | ||
