Author: titmuss
Date: Wed Jul 16 06:42:07 2008
New Revision: 2702

URL: http://svn.slimdevices.com?rev=2702&root=Jive&view=rev
Log:
Bug: N/A
Description:
Add mtd-utils.

Added:
    
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image-debug.bb
    7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/
    7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/
    
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/nanddump_skip_bad_blocks.patch
    
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/nandwrite_input_stdio.patch
    
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/new-ubi-git.patch
    7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils_1.2.0+git.bb
Modified:
    
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image-boot.bb
    7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image.bb

Modified: 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image-boot.bb
URL: 
http://svn.slimdevices.com/7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image-boot.bb?rev=2702&root=Jive&r1=2701&r2=2702&view=diff
==============================================================================
--- 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image-boot.bb 
(original)
+++ 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image-boot.bb 
Wed Jul 16 06:42:07 2008
@@ -4,7 +4,8 @@
 
 inherit image
 
-IMAGE_INSTALL ?= "task-squeezeos-base"
+IMAGE_INSTALL = "task-squeezeos-base"
+IMAGE_INSTALL += "mtd-utils ubi-utils"
 
 # remove not needed ipkg informations
 ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files"

Added: 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image-debug.bb
URL: 
http://svn.slimdevices.com/7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image-debug.bb?rev=2702&root=Jive&view=auto
==============================================================================
--- 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image-debug.bb
 (added)
+++ 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image-debug.bb
 Wed Jul 16 06:42:07 2008
@@ -1,0 +1,12 @@
+DESCRIPTION = "SqueezeOS - debugging tools"
+
+inherit image
+
+IMAGE_LINGUAS = " "
+
+IMAGE_INSTALL += "strace oprofile"
+
+IMAGE_FSTYPES = "tar.gz"
+
+# remove not needed ipkg informations
+ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files"

Modified: 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image.bb
URL: 
http://svn.slimdevices.com/7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image.bb?rev=2702&root=Jive&r1=2701&r2=2702&view=diff
==============================================================================
--- 7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image.bb 
(original)
+++ 7.2/trunk/squeezeos/poky/meta-squeezeos/packages/images/squeezeos-image.bb 
Wed Jul 16 06:42:07 2008
@@ -2,4 +2,4 @@
 
 require squeezeos-image-boot.bb
 
-IMAGE_INSTALL += "squeezeplay dropbear"
+IMAGE_INSTALL += "squeezeplay dropbear patch wireless-tools"

Added: 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/nanddump_skip_bad_blocks.patch
URL: 
http://svn.slimdevices.com/7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/nanddump_skip_bad_blocks.patch?rev=2702&root=Jive&view=auto
==============================================================================
--- 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/nanddump_skip_bad_blocks.patch
 (added)
+++ 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/nanddump_skip_bad_blocks.patch
 Wed Jul 16 06:42:07 2008
@@ -1,0 +1,33 @@
+Index: mtd-utils/nanddump.c
+===================================================================
+--- mtd-utils/nanddump.c       (revision 2478)
++++ mtd-utils/nanddump.c       (revision 2479)
+@@ -281,8 +281,16 @@
+               }
+ 
+               if (badblock) {
+-                      if (omitbad)
++                      if (omitbad) {
++                              if (length) {
++                                      /* bad blocks don't count towards the 
length */
++                                      end_addr += bs;
++                                      if (end_addr > meminfo.size) {
++                                              end_addr = meminfo.size;
++                                      }
++                              }
+                               continue;
++                      }
+                       memset (readbuf, 0xff, bs);
+               } else {
+                       /* Read page data and exit on failure */
+@@ -292,6 +300,10 @@
+                       }
+               }
+ 
++              if (bs > end_addr - ofs) {
++                      bs = end_addr - ofs;
++              }
++
+               /* ECC stats available ? */
+               if (eccstats) {
+                       if (ioctl(fd, ECCGETSTATS, &stat2)) {

Added: 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/nandwrite_input_stdio.patch
URL: 
http://svn.slimdevices.com/7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/nandwrite_input_stdio.patch?rev=2702&root=Jive&view=auto
==============================================================================
--- 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/nandwrite_input_stdio.patch
 (added)
+++ 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/nandwrite_input_stdio.patch
 Wed Jul 16 06:42:07 2008
@@ -1,0 +1,140 @@
+Index: mtd-utils/nandwrite.c
+===================================================================
+--- mtd-utils/nandwrite.c      (revision 2477)
++++ mtd-utils/nandwrite.c      (revision 2478)
+@@ -72,7 +72,7 @@
+ 
+ void display_help (void)
+ {
+-      printf("Usage: nandwrite [OPTION] MTD_DEVICE INPUTFILE\n"
++      printf("Usage: nandwrite [OPTION] [MTD_DEVICE INPUTFILE|-]\n"
+                       "Writes to the specified MTD device.\n"
+                       "\n"
+                       "  -a, --autoplace      Use auto oob layout\n"
+@@ -218,6 +218,7 @@
+       int ret, readlen;
+       int oobinfochanged = 0;
+       struct nand_oobinfo old_oobinfo;
++      int read_from_stdin = 0;
+ 
+       process_options(argc, argv);
+ 
+@@ -334,15 +335,29 @@
+       oob.length = meminfo.oobsize;
+       oob.ptr = noecc ? oobreadbuf : oobbuf;
+ 
+-      /* Open the input file */
+-      if ((ifd = open(img, O_RDONLY)) == -1) {
+-              perror("open input file");
+-              goto restoreoob;
++      // Check if we read from stdin
++      if (strcmp(img, "-") == 0) {
++              // FIXME OOB data and stdin
++              if( writeoob) {
++                      fprintf(stderr, "Can't use oob data when stdin is 
used.\n");
++                      exit(-1);
++              }
++
++              ifd = STDIN_FILENO;
++              read_from_stdin = 1;
++              imglen = pagelen;       // used as flag in stdin case
+       }
++      else {
++              /* Open the input file */
++              if ((ifd = open(img, O_RDONLY)) == -1) {
++                      perror("open input file");
++                      goto restoreoob;
++              }
+ 
+-      // get image length
+-      imglen = lseek(ifd, 0, SEEK_END);
+-      lseek (ifd, 0, SEEK_SET);
++              // get image length
++              imglen = lseek(ifd, 0, SEEK_END);
++              lseek (ifd, 0, SEEK_SET);
++      }
+ 
+       pagelen = meminfo.writesize + ((writeoob == 1) ? meminfo.oobsize : 0);
+ 
+@@ -361,6 +376,7 @@
+       }
+ 
+       /* Get data from input and write to the device */
++      /* imglen is used as flag in stdin case */
+       while (imglen && (mtdoffset < meminfo.size)) {
+               // new eraseblock , check for bad block(s)
+               // Stay in the loop to be sure if the mtdoffset changes because
+@@ -398,18 +414,51 @@
+               }
+ 
+               readlen = meminfo.writesize;
+-              if (pad && (imglen < readlen))
+-              {
+-                      readlen = imglen;
+-                      memset(writebuf + readlen, 0xff, meminfo.writesize - 
readlen);
+-              }
+ 
+-              /* Read Page Data from input file */
+-              if ((cnt = read(ifd, writebuf, readlen)) != readlen) {
+-                      if (cnt == 0)   // EOF
++              if( !read_from_stdin) { 
++                      if (pad && (imglen < readlen))
++                      {
++                              readlen = imglen;
++                              memset(writebuf + readlen, 0xff, 
meminfo.writesize - readlen);
++                      }
++
++                      /* Read Page Data from input file */
++                      if ((cnt = read(ifd, writebuf, readlen)) != readlen) {
++                              if (cnt == 0)   // EOF
++                                      break;
++                              perror ("File I/O error on input file");
++                              goto closeall;
++                      }
++              } else {
++                      /* Read Page Data from stdin */
++                      int tinycnt = 0;
++                      while(tinycnt < readlen) {
++                              cnt = read(ifd, writebuf + tinycnt, readlen - 
tinycnt);
++                              if (cnt == 0) { // EOF
++                                      break;
++                              }
++                              else if (cnt < 0) {
++                                      perror ("File I/O error on stdin");
++                                      goto closeall;
++                              }
++                              tinycnt += cnt;
++                      }
++
++                      /* No padding needed - we are done */
++                      if (tinycnt == 0) {
++                              imglen = 0;
+                               break;
+-                      perror ("File I/O error on input file");
+-                      goto closeall;
++                      }
++
++                      /* No more bytes - we are done after writing the 
remaining bytes */
++                      if (cnt == 0) {
++                              imglen = 0;
++                      }
++
++                      /* Padding */
++                      if (pad && (tinycnt < readlen)) {
++                              memset( writebuf + tinycnt, 0xff, 
meminfo.writesize - tinycnt);
++                      }
+               }
+ 
+               if (writeoob) {
+@@ -493,7 +542,10 @@
+ 
+                       continue;
+               }
+-              imglen -= readlen;
++
++              if (!read_from_stdin) { 
++                      imglen -= readlen;
++              }
+               mtdoffset += meminfo.writesize;
+       }
+ 

Added: 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/new-ubi-git.patch
URL: 
http://svn.slimdevices.com/7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/new-ubi-git.patch?rev=2702&root=Jive&view=auto
==============================================================================
--- 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/new-ubi-git.patch
 (added)
+++ 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils/new-ubi-git.patch
 Wed Jul 16 06:42:07 2008
@@ -1,0 +1,28 @@
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile  2008-07-16 13:39:27.000000000 +0100
++++ git/Makefile       2008-07-16 13:49:31.000000000 +0100
+@@ -47,7 +47,7 @@
+ .SUFFIXES:
+ 
+ all: $(TARGETS)
+-      make -C $(BUILDDIR)/ubi-utils
++      make -C $(BUILDDIR)/ubi-utils/new-utils
+ 
+ IGNORE=${wildcard $(BUILDDIR)/.*.c.dep}
+ -include ${IGNORE}
+@@ -55,7 +55,7 @@
+ clean:
+       rm -f $(BUILDDIR)/*.o $(TARGETS) $(BUILDDIR)/.*.c.dep $(SYMLINKS)
+       if [ "$(BUILDDIR)x" != ".x" ]; then rm -rf $(BUILDDIR); fi
+-      make -C $(BUILDDIR)/ubi-utils clean
++      make -C $(BUILDDIR)/ubi-utils/new-utils clean
+ 
+ $(SYMLINKS):
+       ln -sf ../fs/jffs2/$@ $@
+@@ -97,4 +97,4 @@
+       install -m0755 ${TARGETS} ${DESTDIR}/${SBINDIR}/
+       mkdir -p ${DESTDIR}/${MANDIR}/man1
+       gzip -9c mkfs.jffs2.1 > ${DESTDIR}/${MANDIR}/man1/mkfs.jffs2.1.gz
+-      make -C $(BUILDDIR)/ubi-utils install
++      make -C $(BUILDDIR)/ubi-utils/new-utils install

Added: 
7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils_1.2.0+git.bb
URL: 
http://svn.slimdevices.com/7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils_1.2.0%2Bgit.bb?rev=2702&root=Jive&view=auto
==============================================================================
--- 7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils_1.2.0+git.bb 
(added)
+++ 7.2/trunk/squeezeos/poky/meta-squeezeos/packages/mtd/mtd-utils_1.2.0+git.bb 
Wed Jul 16 06:42:07 2008
@@ -1,0 +1,35 @@
+DESCRIPTION = "Tools for managing memory technology devices."
+SECTION = "base"
+DEPENDS = "zlib lzo"
+HOMEPAGE = "http://www.linux-mtd.infradead.org/";
+LICENSE = "GPLv2"
+PR = "r2"
+
+SRC_URI = 
"git://git.infradead.org/mtd-utils.git;protocol=git;tag=487550498f70455f083cdc82b65442596fe7308e
 \
+          file://new-ubi-git.patch;patch=1 \
+          file://nanddump_skip_bad_blocks.patch;patch=1 \
+          file://nandwrite_input_stdio.patch;patch=1"
+
+S = "${WORKDIR}/git/"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'CFLAGS=${CFLAGS} -I${S}/include -Iinclude -Isrc 
-DWITHOUT_XATTR' \
+       'RAWTARGETS=flash_eraseall nanddump nandwrite nandtest'"
+
+do_stage () {
+       install -d ${STAGING_INCDIR}/mtd
+       for f in ${S}/include/mtd/*.h; do
+               install -m 0644 $f ${STAGING_INCDIR}/mtd/
+       done
+}
+
+do_install () {
+       oe_runmake install DESTDIR=${D}
+}
+
+PARALLEL_MAKE = ""
+
+
+PACKAGES = "ubi-utils-dbg ${PN}-dbg ubi-utils ${PN} ${PN}-doc"
+
+FILES_ubi-utils = "${sbindir}/ubi*"
+FILES_ubi-utils-dbg = "${sbindir}/.debug/ubi*"

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to