diff options
author | Paul Sokolovsky <pmiscml@gmail.com> | 2007-09-11 16:52:27 +0000 |
---|---|---|
committer | Paul Sokolovsky <pmiscml@gmail.com> | 2007-09-11 16:52:27 +0000 |
commit | 4d5b429bca6e2a6bfb2b36dc8ad8bb38b78b2429 (patch) | |
tree | 186a1f825cb66a8ee8cbe262e06bba11ae5fc7d3 | |
parent | f56148af04529554908eb3af1d616b51266ebd1a (diff) | |
parent | 9c68f8a0ada21051d514fd158e0da531c0a602e8 (diff) |
merge of '41bc7cd136be3eabb67bde38705e491f649cd322'
and 'cb02b3f58dbbe96a4730fcb455585ec97277014a'
-rw-r--r-- | conf/bitbake.conf | 10 | ||||
-rw-r--r-- | conf/machine/include/motorola-ezx-base.inc | 11 | ||||
-rw-r--r-- | conf/machine/include/motorola-ezx.inc | 41 | ||||
-rw-r--r-- | packages/madwifi/madwifi-ng_r2702-20070903.bb | 1 | ||||
-rw-r--r-- | packages/openmoko2/neod_svn.bb | 11 | ||||
-rw-r--r-- | packages/puzzles/oh-puzzles_svn.bb | 2 | ||||
-rw-r--r-- | packages/yaffs2/.mtn2git_empty | 0 | ||||
-rw-r--r-- | packages/yaffs2/files/.mtn2git_empty | 0 | ||||
-rw-r--r-- | packages/yaffs2/files/mkyaffs2image.patch | 345 | ||||
-rw-r--r-- | packages/yaffs2/files/yaffs2-unioob.patch | 216 | ||||
-rw-r--r-- | packages/yaffs2/yaffs2-utils-native_cvs.bb | 15 | ||||
-rw-r--r-- | packages/yaffs2/yaffs2-utils_cvs.bb | 27 |
12 files changed, 628 insertions, 51 deletions
diff --git a/conf/bitbake.conf b/conf/bitbake.conf index 232986827c..fb5bb197bb 100644 --- a/conf/bitbake.conf +++ b/conf/bitbake.conf @@ -207,10 +207,10 @@ IMAGE_ROOTFS = "${TMPDIR}/rootfs" IMAGE_BASENAME = "${PN}" IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}" IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}" + IMAGE_CMD = "" -IMAGE_CMD_jffs2 = "mkfs.jffs2 -x lzo --root=${IMAGE_ROOTFS} --faketime \ - --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \ - ${EXTRA_IMAGECMD}" +IMAGE_CMD_jffs2 = "mkfs.jffs2 -x lzo --root=${IMAGE_ROOTFS} --faketime --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 ${EXTRA_IMAGECMD}" +IMAGE_CMD_yaffs2 = "mkyaffs2image ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.yaffs2 ${EXTRA_IMAGECMD}" IMAGE_CMD_cramfs = "mkcramfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cramfs ${EXTRA_IMAGECMD}" IMAGE_CMD_ext2 = "genext2fs -b ${IMAGE_ROOTFS_SIZE} -d ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext2 ${EXTRA_IMAGECMD}" IMAGE_CMD_ext2.gz = "rm -rf ${DEPLOY_DIR_IMAGE}/tmp.gz && mkdir ${DEPLOY_DIR_IMAGE}/tmp.gz; genext2fs -b ${IMAGE_ROOTFS_SIZE} -d ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/tmp.gz/${IMAGE_NAME}.rootfs.ext2 ${EXTRA_IMAGECMD}; gzip -f -9 ${DEPLOY_DIR_IMAGE}/tmp.gz/${IMAGE_NAME}.rootfs.ext2; mv ${DEPLOY_DIR_IMAGE}/tmp.gz/${IMAGE_NAME}.rootfs.ext2.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext2.gz; rmdir ${DEPLOY_DIR_IMAGE}/tmp.gz" @@ -223,13 +223,16 @@ IMAGE_CMD_tar.gz = "cd ${IMAGE_ROOTFS} && tar -zcvf ${DEPLOY_DIR_IMAGE}/${IMAGE_ IMAGE_CMD_tar.bz2 = "cd ${IMAGE_ROOTFS} && tar -jcvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar.bz2 ." IMAGE_CMD_cpio = "cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio)" IMAGE_CMD_cpio.gz = "cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc | gzip -c -9 >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.gz)" + EXTRA_IMAGECMD = "" EXTRA_IMAGECMD_jffs2 = "" +EXTRA_IMAGECMD_yaffs2 = "" EXTRA_IMAGECMD_squashfs = "" EXTRA_IMAGECMD_squashfs-lzma = "" IMAGE_DEPENDS = "" IMAGE_DEPENDS_jffs2 = "mtd-utils-native" +IMAGE_DEPENDS_yaffs2 = "yaffs2-utils-native" IMAGE_DEPENDS_cramfs = "cramfs-native" IMAGE_DEPENDS_ext2 = "genext2fs-native" IMAGE_DEPENDS_ext2.gz = "genext2fs-native" @@ -237,6 +240,7 @@ IMAGE_DEPENDS_ext3 = "genext2fs-native e2fsprogs-native" IMAGE_DEPENDS_ext3.gz = "genext2fs-native e2fsprogs-native" IMAGE_DEPENDS_squashfs = "squashfs-tools-native" IMAGE_DEPENDS_squashfs-lzma = "squashfs-lzma-tools-native" + EXTRA_IMAGEDEPENDS = "" ################################################################## diff --git a/conf/machine/include/motorola-ezx-base.inc b/conf/machine/include/motorola-ezx-base.inc index 95496b3266..3912d8fc9b 100644 --- a/conf/machine/include/motorola-ezx-base.inc +++ b/conf/machine/include/motorola-ezx-base.inc @@ -4,8 +4,6 @@ PACKAGE_EXTRA_ARCHS = "armv4 armv4t armv5te iwmmxt" PREFERRED_PROVIDER_xserver = "xserver-kdrive" PREFERRED_PROVIDER_virtual/kernel = "linux-ezx" -EXTRA_IMAGECMD_jffs2 = "--pad=14680064 --little-endian --eraseblock=0x20000 -n" - #cat /proc/mtd #dev: size erasesize name #mtd0: 00020000 00008000 "Bootloader" @@ -14,10 +12,6 @@ EXTRA_IMAGECMD_jffs2 = "--pad=14680064 --little-endian --eraseblock=0x20000 -n" #mtd3: 00020000 00020000 "Logo" MACHINE_FEATURES = "kernel26 touchscreen apm alsa bluetooth usbgadget usbhost keyboard screen" - -# the EZX phones need a userspace daemon to stop the BP from shutting down the phone -MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "ezxd" - MACHINE_DISPLAY_WIDTH_PIXELS = "240" MACHINE_DISPLAY_HEIGHT_PIXELS = "320" MACHINE_DISPLAY_ORIENTATION = "0" @@ -25,8 +19,13 @@ MACHINE_DISPLAY_PPI = "180" ROOT_FLASH_SIZE = "24" +EXTRA_IMAGECMD_jffs2 = "--pad=14680064 --little-endian --eraseblock=0x20000 -n" + EXTRA_IMAGEDEPENDS += "ezx-boot-usb-native" +# the EZX phones need a userspace daemon to stop the BP from shutting down the phone +MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "ezxd" + # Ezxd needs to be started very early so we need the mux devices in static /dev IMAGE_DEVICE_TABLES = "files/device_table-minimal.txt \ files/device_table-ezx.txt" diff --git a/conf/machine/include/motorola-ezx.inc b/conf/machine/include/motorola-ezx.inc deleted file mode 100644 index e87f6aa70f..0000000000 --- a/conf/machine/include/motorola-ezx.inc +++ /dev/null @@ -1,41 +0,0 @@ -# choose the proper kernel for this hardware -PREFERRED_PROVIDER_virtual/kernel = "ezx-kernels" -# we don't need support for kernel 2.4 -MODUTILS = "26" -# build tar.gz for SD/MMC/Transflash and jffs2 for later when we have mtd -IMAGE_FSTYPES = "tar.gz jffs2" - -BOOTSTRAP_EXTRA_RDEPENDS += "kernel udev sysfsutils apm irda-utils udev-utils ppp ppp-dialin module-init-tools" - -# -# disable all modules until we have something that boots... -# - -# Ethernet modules -#BOOTSTRAP_EXTRA_RDEPENDS += "kernel-module-pcnet-cs" -# NFS Modules -#BOOTSTRAP_EXTRA_RDEPENDS += "kernel-module-nfs kernel-module-lockd kernel-module-sunrpc" -# Crypto Modules -#BOOTSTRAP_EXTRA_RDEPENDS += "kernel-module-des kernel-module-md5" -# SMB and CRAMFS -#BOOTSTRAP_EXTRA_RDEPENDS += "kernel-module-smbfs kernel-module-cramfs" -# Serial Modules -#BOOTSTRAP_EXTRA_RDEPENDS += "kernel-module-8250 kernel-module-serial-cs" -# Bluetooth Modules -#BOOTSTRAP_EXTRA_RDEPENDS += "kernel-module-bluetooth kernel-module-l2cap kernel-module-rfcomm kernel-module-hci-vhci \ -# kernel-module-bnep kernel-module-hidp kernel-module-hci-uart kernel-module-sco \ -# kernel-module-bt3c-cs kernel-module-bluecard-cs kernel-module-btuart-cs kernel-module-dtl1-cs" -# Infrared Modules -#BOOTSTRAP_EXTRA_RDEPENDS += "kernel-module-pxaficp-ir kernel-module-irda kernel-module-ircomm \ -# kernel-module-ircomm-tty kernel-module-irlan kernel-module-irnet kernel-module-ir-usb" -# -# USB Gadget Modules -#BOOTSTRAP_EXTRA_RDEPENDS += "kernel-module-gadgetfs kernel-module-g-file-storage \ -# kernel-module-g-serial kernel-module-g-ether" -# -# Sound Modules -#BOOTSTRAP_EXTRA_RDEPENDS += "kernel-module-snd-mixer-oss kernel-module-snd-pcm-oss" -#BOOTSTRAP_EXTRA_SOUND = "kernel-module-soundcore kernel-module-snd kernel-module-snd-page-alloc -# kernel-module-snd-timer kernel-module-snd-pcm \ -# kernel-module-snd-soc-core kernel-module-snd-soc-pxa2xx kernel-module-snd-soc-pxa2xx-i2s" -# diff --git a/packages/madwifi/madwifi-ng_r2702-20070903.bb b/packages/madwifi/madwifi-ng_r2702-20070903.bb index cf614c96ae..43a491bd1f 100644 --- a/packages/madwifi/madwifi-ng_r2702-20070903.bb +++ b/packages/madwifi/madwifi-ng_r2702-20070903.bb @@ -3,6 +3,7 @@ # Don't use this unless you know what you're doing -- this version does # *NOT* build on BE kernels. DEFAULT_PREFERENCE = "-1" +DEFAULT_PREFERENCE_alix = "1" # Disable stripping of kernel modules, since this action strips too # much out, and the resulting module won't load. diff --git a/packages/openmoko2/neod_svn.bb b/packages/openmoko2/neod_svn.bb index 4d6115ae93..a82dbd574c 100644 --- a/packages/openmoko2/neod_svn.bb +++ b/packages/openmoko2/neod_svn.bb @@ -5,3 +5,14 @@ PV = "0.1.0+svn${SVNREV}" PR = "r0" inherit openmoko2 gconf + +EXTRA_OECONF_fic-gta01 = "--with-platform=neo1973" +EXTRA_OECONF_fic-gta02 = "--with-platform=neo1973" +EXTRA_OECONF_a780 = "--with-platform=ezx" +EXTRA_OECONF_a1200 = "--with-platform=ezx" +EXTRA_OECONF_e680 = "--with-platform=ezx" +EXTRA_OECONF_rokre2 = "--with-platform=ezx" +EXTRA_OECONF_rokre6 = "--with-platform=ezx" + +PACKAGE_ARCH = "${MACHINE}" + diff --git a/packages/puzzles/oh-puzzles_svn.bb b/packages/puzzles/oh-puzzles_svn.bb index 67643cb281..f0e0eade69 100644 --- a/packages/puzzles/oh-puzzles_svn.bb +++ b/packages/puzzles/oh-puzzles_svn.bb @@ -2,7 +2,7 @@ DESCRIPTION = "Portable Puzzle Collection" LICENSE = "MIT" SECTION = "x11" DEPENDS = "gtk+ gconf intltool-native librsvg libowl" -PV = "0.1+svn${SRCDATE}" +PV = "0.1+svnr${SRCREV}" PR = "r5" inherit autotools pkgconfig diff --git a/packages/yaffs2/.mtn2git_empty b/packages/yaffs2/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/yaffs2/.mtn2git_empty diff --git a/packages/yaffs2/files/.mtn2git_empty b/packages/yaffs2/files/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/yaffs2/files/.mtn2git_empty diff --git a/packages/yaffs2/files/mkyaffs2image.patch b/packages/yaffs2/files/mkyaffs2image.patch new file mode 100644 index 0000000000..521f1ba9a0 --- /dev/null +++ b/packages/yaffs2/files/mkyaffs2image.patch @@ -0,0 +1,345 @@ + * + * mkyaffs2image hacks by NCB + * + * Changes by Sergey Kubushin flagged KSI + * + */ + +/* KSI: + * All this nightmare should be rewritten from ground up. Why save return + * values if nobody checks them? The read/write function returns only one + * error, -1. Positive return value does NOT mean read/write operation has + * been completed successfully. If somebody opens files, he MUST close them + * when they are not longer needed. Only those brave enough can write 64 + * bytes from a yaffs_PackedTags2 structure. The list is too long, there is + * enough bugs here to write a couple of thick books on how NOT to write + * programs... + * + * And BTW, what was one supposed to do with that file that this horror + * occasionally managed to generate? + */ +diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c +--- yaffs2.orig/utils/mkyaffs2image.c 2005-12-12 16:34:58.000000000 -0800 ++++ yaffs2/utils/mkyaffs2image.c 2006-02-10 16:56:13.000000000 -0800 +@@ -31,10 +47,10 @@ + #include <dirent.h> + #include <string.h> + #include <unistd.h> ++#include <mtd/mtd-user.h> + #include "yaffs_ecc.h" + #include "yaffs_guts.h" + +-#include "yaffs_tagsvalidity.h" + #include "yaffs_packedtags2.h" + + unsigned yaffs_traceMask=0; +@@ -43,9 +59,45 @@ + + #define chunkSize 2048 + #define spareSize 64 ++#define PT2_BYTES 25 + + const char * mkyaffsimage_c_version = "$Id: mkyaffs2image.c,v 1.4 2007-02-14 01:09:06 wookey Exp $"; + ++static int layout_no; ++ ++static struct nand_oobinfo oob_layout[] = { ++ /* KSI: ++ * Dummy "raw" layout - no ECC, all the bytes are free. Does NOT ++ * really work, only used for compatibility with CVS YAFFS2 that ++ * never ever worked with any stock MTD. ++ */ ++ { ++ .useecc = MTD_NANDECC_AUTOPLACE, ++ .eccbytes = 0, ++ .eccpos = {}, ++ .oobfree = { {0, 64} } ++ }, ++ /* KSI: ++ * Regular MTD AUTOPLACED ECC for large page NAND devices, the ++ * only one existing in stock MTD so far. It corresponds to layout# 1 ++ * in command line arguments. Any other layouts could be added to ++ * the list when they made their way in kernel's MTD. The structure ++ * is simply copied from kernel's drivers/mtd/nand/nand_base.c as-is. ++ */ ++ { ++ .useecc = MTD_NANDECC_AUTOPLACE, ++ .eccbytes = 24, ++ .eccpos = { ++ 40, 41, 42, 43, 44, 45, 46, 47, ++ 48, 49, 50, 51, 52, 53, 54, 55, ++ 56, 57, 58, 59, 60, 61, 62, 63}, ++ .oobfree = { {2, 38} } ++ }, ++ /* End-of-list marker */ ++ { ++ .useecc = -1, ++ } ++}; + + typedef struct + { +@@ -59,7 +111,7 @@ + static int n_obj = 0; + static int obj_id = YAFFS_NOBJECT_BUCKETS + 1; + +-static int nObjects, nDirectories, nPages; ++static int nObjects = 0, nDirectories = 0, nPages = 0; + + static int outFile; + +@@ -123,6 +175,11 @@ + return -1; + } + ++/* KSI: ++ * No big endian for now. This is left for a later time. The existing code ++ * is FUBAR. ++ */ ++#if 0 + /* This little function converts a little endian tag to a big endian tag. + * NOTE: The tag is not usable after this other than calculating the CRC + * with. +@@ -155,11 +212,56 @@ + tags->asBytes[7] = temp.asBytes[7]; + #endif + } ++#endif ++ ++void nandmtd2_pt2buf(unsigned char *buf, yaffs_PackedTags2 *pt) ++{ ++ int i, j = 0, k, n; ++ unsigned char pt2_byte_buf[PT2_BYTES]; ++ ++ *((unsigned int *) &pt2_byte_buf[0]) = pt->t.sequenceNumber; ++ *((unsigned int *) &pt2_byte_buf[4]) = pt->t.objectId; ++ *((unsigned int *) &pt2_byte_buf[8]) = pt->t.chunkId; ++ *((unsigned int *) &pt2_byte_buf[12]) = pt->t.byteCount; ++ pt2_byte_buf[16] = pt->ecc.colParity; ++ pt2_byte_buf[17] = pt->ecc.lineParity & 0xff; ++ pt2_byte_buf[18] = (pt->ecc.lineParity >> 8) & 0xff; ++ pt2_byte_buf[19] = (pt->ecc.lineParity >> 16) & 0xff; ++ pt2_byte_buf[20] = (pt->ecc.lineParity >> 24) & 0xff; ++ pt2_byte_buf[21] = pt->ecc.lineParityPrime & 0xff; ++ pt2_byte_buf[22] = (pt->ecc.lineParityPrime >> 8) & 0xff; ++ pt2_byte_buf[23] = (pt->ecc.lineParityPrime >> 16) & 0xff; ++ pt2_byte_buf[24] = (pt->ecc.lineParityPrime >> 24) & 0xff; ++ ++ k = oob_layout[layout_no].oobfree[j][0]; ++ n = oob_layout[layout_no].oobfree[j][1]; ++ ++ if (n == 0) { ++ fprintf(stderr, "No OOB space for tags"); ++ exit(-1); ++ } ++ ++ for (i = 0; i < PT2_BYTES; i++) { ++ if (n == 0) { ++ j++; ++ k = oob_layout[layout_no].oobfree[j][0]; ++ n = oob_layout[layout_no].oobfree[j][1]; ++ if (n == 0) { ++ fprintf(stderr, "No OOB space for tags"); ++ exit(-1); ++ } ++ } ++ buf[k++] = pt2_byte_buf[i]; ++ n--; ++ } ++} + + static int write_chunk(__u8 *data, __u32 objId, __u32 chunkId, __u32 nBytes) + { + yaffs_ExtendedTags t; + yaffs_PackedTags2 pt; ++ unsigned char spare_buf[spareSize]; ++ + + error = write(outFile,data,chunkSize); + if(error < 0) return error; +@@ -177,18 +279,27 @@ + // added NCB **CHECK** + t.chunkUsed = 1; + ++/* KSI: Broken anyway -- e.g. &t is pointer to a wrong type... */ ++#if 0 + if (convert_endian) + { + little_to_big_endian(&t); + } ++#endif + + nPages++; + + yaffs_PackTags2(&pt,&t); +- +-// return write(outFile,&pt,sizeof(yaffs_PackedTags2)); +- return write(outFile,&pt,spareSize); +- ++ ++ memset(spare_buf, 0xff, sizeof(spare_buf)); ++ ++ if (layout_no == 0) { ++ memcpy(spare_buf, &pt, sizeof(yaffs_PackedTags2)); ++ } else { ++ nandmtd2_pt2buf(spare_buf, &pt); ++ } ++ ++ return write(outFile,spare_buf,spareSize); + } + + #define SWAP32(x) ((((x) & 0x000000FF) << 24) | \ +@@ -199,6 +310,8 @@ + #define SWAP16(x) ((((x) & 0x00FF) << 8) | \ + (((x) & 0xFF00) >> 8)) + ++/* KSI: Removed for now. TBD later when the proper util (from scratch) is written */ ++#if 0 + // This one is easier, since the types are more standard. No funky shifts here. + static void object_header_little_to_big_endian(yaffs_ObjectHeader* oh) + { +@@ -256,6 +369,7 @@ + oh->roomToGrow[11] = SWAP32(oh->roomToGrow[11]); + #endif + } ++#endif + + static int write_object_header(int objId, yaffs_ObjectType t, struct stat *s, int parent, const char *name, int equivalentObj, const char * alias) + { +@@ -300,10 +414,13 @@ + strncpy(oh->alias,alias,YAFFS_MAX_ALIAS_LENGTH); + } + ++/* KSI: FUBAR. Left for a leter time. */ ++#if 0 + if (convert_endian) + { + object_header_little_to_big_endian(oh); + } ++#endif + + return write_chunk(bytes,objId,0,0xffff); + +@@ -319,7 +436,7 @@ + nDirectories++; + + dir = opendir(path); +- ++ + if(dir) + { + while((entry = readdir(dir)) != NULL) +@@ -403,12 +520,12 @@ + error = nBytes; + + printf("%d data chunks written\n",chunk); ++ close(h); + } + else + { + perror("Error opening file"); + } +- close(h); + + } + +@@ -448,58 +565,82 @@ + } + } + } ++ /* KSI: ++ * Who is supposed to close those open directories in this ++ * recursive function, lord Byron? Stock "ulimit -n" is 1024 ++ * and e.g. stock Fedora /etc directory has more that 1024 ++ * directories... ++ */ ++ closedir(dir); + } + + return 0; + + } + ++void usage(void) ++{ ++ printf("usage: mkyaffs2image layout# dir image_file [convert]\n"); ++ printf(" layout# NAND OOB layout # (0 - raw, 1 - nand_oob_64)\n"); ++ printf(" dir the directory tree to be converted\n"); ++ printf(" image_file the output file to hold the image\n"); ++ printf(" 'convert' make a big-endian img on a little-endian machine. BROKEN !\n"); ++ exit(1); ++} + + int main(int argc, char *argv[]) + { + struct stat stats; ++ int i; + + printf("mkyaffs2image: image building tool for YAFFS2 built "__DATE__"\n"); + +- if(argc < 3) ++ if ((argc < 4) || (sscanf(argv[1], "%u", &layout_no) != 1)) + { +- printf("usage: mkyaffs2image dir image_file [convert]\n"); +- printf(" dir the directory tree to be converted\n"); +- printf(" image_file the output file to hold the image\n"); +- printf(" 'convert' produce a big-endian image from a little-endian machine\n"); +- exit(1); ++ usage(); + } + +- if ((argc == 4) && (!strncmp(argv[3], "convert", strlen("convert")))) +- { +- convert_endian = 1; +- } ++ i = 0; ++ ++ while (oob_layout[i].useecc != -1) ++ i++; ++ ++ if (layout_no >= i) ++ usage(); ++ ++ if ((argc == 5) && (!strncmp(argv[4], "convert", strlen("convert")))) ++ { ++ /* KSI: Broken as of now. TBD. Fail. */ ++ usage(); ++ convert_endian = 1; ++ } + +- if(stat(argv[1],&stats) < 0) ++ if(stat(argv[2],&stats) < 0) + { +- printf("Could not stat %s\n",argv[1]); ++ printf("Could not stat %s\n",argv[2]); + exit(1); + } + + if(!S_ISDIR(stats.st_mode)) + { +- printf(" %s is not a directory\n",argv[1]); ++ printf(" %s is not a directory\n",argv[2]); + exit(1); + } + +- outFile = open(argv[2],O_CREAT | O_TRUNC | O_WRONLY, S_IREAD | S_IWRITE); ++ outFile = open(argv[3],O_CREAT | O_TRUNC | O_WRONLY, S_IREAD | S_IWRITE); + + + if(outFile < 0) + { +- printf("Could not open output file %s\n",argv[2]); ++ printf("Could not open output file %s\n",argv[3]); + exit(1); + } + +- printf("Processing directory %s into image file %s\n",argv[1],argv[2]); ++ printf("Processing directory %s into image file %s\n",argv[2],argv[3]); + error = write_object_header(1, YAFFS_OBJECT_TYPE_DIRECTORY, &stats, 1,"", -1, NULL); ++ + if(error) +- error = process_directory(YAFFS_OBJECTID_ROOT,argv[1]); ++ error = process_directory(YAFFS_OBJECTID_ROOT,argv[2]); + + close(outFile); + diff --git a/packages/yaffs2/files/yaffs2-unioob.patch b/packages/yaffs2/files/yaffs2-unioob.patch new file mode 100644 index 0000000000..c894528ca1 --- /dev/null +++ b/packages/yaffs2/files/yaffs2-unioob.patch @@ -0,0 +1,216 @@ +diff -urN yaffs2.orig/yaffs_mtdif2.c yaffs2/yaffs_mtdif2.c +--- yaffs2.orig/yaffs_mtdif2.c 2005-12-07 14:00:38.000000000 -0800 ++++ yaffs2/yaffs_mtdif2.c 2006-02-10 17:13:58.000000000 -0800 +@@ -29,6 +29,130 @@ + + #include "yaffs_packedtags2.h" + ++#define PT2_BYTES 25 ++ ++void nandmtd2_pt2buf(yaffs_Device *dev, yaffs_PackedTags2 *pt, int is_raw) ++{ ++ struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice); ++ int i, j = 0, k, n; ++ __u8 pt2_byte_buf[PT2_BYTES]; ++ ++ /* Pack buffer with 0xff */ ++ for (i = 0; i < mtd->oobsize; i++) ++ dev->spareBuffer[i] = 0xff; ++ ++ if (!is_raw) { ++ *((unsigned int *) &dev->spareBuffer[0]) = pt->t.sequenceNumber; ++ *((unsigned int *) &dev->spareBuffer[4]) = pt->t.objectId; ++ *((unsigned int *) &dev->spareBuffer[8]) = pt->t.chunkId; ++ *((unsigned int *) &dev->spareBuffer[12]) = pt->t.byteCount; ++ dev->spareBuffer[16] = pt->ecc.colParity; ++ dev->spareBuffer[17] = pt->ecc.lineParity & 0xff; ++ dev->spareBuffer[18] = (pt->ecc.lineParity >> 8) & 0xff; ++ dev->spareBuffer[19] = (pt->ecc.lineParity >> 16) & 0xff; ++ dev->spareBuffer[20] = (pt->ecc.lineParity >> 24) & 0xff; ++ dev->spareBuffer[21] = pt->ecc.lineParityPrime & 0xff; ++ dev->spareBuffer[22] = (pt->ecc.lineParityPrime >> 8) & 0xff; ++ dev->spareBuffer[23] = (pt->ecc.lineParityPrime >> 16) & 0xff; ++ dev->spareBuffer[24] = (pt->ecc.lineParityPrime >> 24) & 0xff; ++ } else { ++ *((unsigned int *) &pt2_byte_buf[0]) = pt->t.sequenceNumber; ++ *((unsigned int *) &pt2_byte_buf[4]) = pt->t.objectId; ++ *((unsigned int *) &pt2_byte_buf[8]) = pt->t.chunkId; ++ *((unsigned int *) &pt2_byte_buf[12]) = pt->t.byteCount; ++ pt2_byte_buf[16] = pt->ecc.colParity; ++ pt2_byte_buf[17] = pt->ecc.lineParity & 0xff; ++ pt2_byte_buf[18] = (pt->ecc.lineParity >> 8) & 0xff; ++ pt2_byte_buf[19] = (pt->ecc.lineParity >> 16) & 0xff; ++ pt2_byte_buf[20] = (pt->ecc.lineParity >> 24) & 0xff; ++ pt2_byte_buf[21] = pt->ecc.lineParityPrime & 0xff; ++ pt2_byte_buf[22] = (pt->ecc.lineParityPrime >> 8) & 0xff; ++ pt2_byte_buf[23] = (pt->ecc.lineParityPrime >> 16) & 0xff; ++ pt2_byte_buf[24] = (pt->ecc.lineParityPrime >> 24) & 0xff; ++ ++ k = mtd->oobinfo.oobfree[j][0]; ++ n = mtd->oobinfo.oobfree[j][1]; ++ ++ if (n == 0) { ++ T(YAFFS_TRACE_ERROR, (TSTR("No OOB space for tags" TENDSTR))); ++ YBUG(); ++ } ++ ++ for (i = 0; i < PT2_BYTES; i++) { ++ if (n == 0) { ++ j++; ++ k = mtd->oobinfo.oobfree[j][0]; ++ n = mtd->oobinfo.oobfree[j][1]; ++ if (n == 0) { ++ T(YAFFS_TRACE_ERROR, (TSTR("No OOB space for tags" TENDSTR))); ++ YBUG(); ++ } ++ } ++ dev->spareBuffer[k++] = pt2_byte_buf[i]; ++ n--; ++ } ++ } ++} ++ ++void nandmtd2_buf2pt(yaffs_Device *dev, yaffs_PackedTags2 *pt, int is_raw) ++{ ++ struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice); ++ int i, j = 0, k, n; ++ __u8 pt2_byte_buf[PT2_BYTES]; ++ ++ ++ if (!is_raw) { ++ pt->t.sequenceNumber = *((unsigned int *) &dev->spareBuffer[0]); ++ pt->t.objectId = *((unsigned int *) &dev->spareBuffer[4]); ++ pt->t.chunkId = *((unsigned int *) &dev->spareBuffer[8]); ++ pt->t.byteCount = *((unsigned int *) &dev->spareBuffer[12]); ++ pt->ecc.colParity = dev->spareBuffer[16]; ++ pt->ecc.lineParity = (dev->spareBuffer[17] & 0x000000ff) | ++ ((dev->spareBuffer[18] << 8) & 0x0000ff00) | ++ ((dev->spareBuffer[19] << 16) & 0x00ff0000) | ++ ((dev->spareBuffer[20] << 24) & 0xff000000); ++ pt->ecc.lineParityPrime = (dev->spareBuffer[21] & 0x000000ff) | ++ ((dev->spareBuffer[22] << 8) & 0x0000ff00) | ++ ((dev->spareBuffer[23] << 16) & 0x00ff0000) | ++ ((dev->spareBuffer[24] << 24) & 0xff000000); ++ } else { ++ k = mtd->oobinfo.oobfree[j][0]; ++ n = mtd->oobinfo.oobfree[j][1]; ++ ++ if (n == 0) { ++ T(YAFFS_TRACE_ERROR, (TSTR("No space in OOB for tags" TENDSTR))); ++ YBUG(); ++ } ++ ++ for (i = 0; i < PT2_BYTES; i++) { ++ if (n == 0) { ++ j++; ++ k = mtd->oobinfo.oobfree[j][0]; ++ n = mtd->oobinfo.oobfree[j][1]; ++ if (n == 0) { ++ T(YAFFS_TRACE_ERROR, (TSTR("No space in OOB for tags" TENDSTR))); ++ YBUG(); ++ } ++ } ++ pt2_byte_buf[i] = dev->spareBuffer[k++]; ++ n--; ++ } ++ pt->t.sequenceNumber = *((unsigned int *) &pt2_byte_buf[0]); ++ pt->t.objectId = *((unsigned int *) &pt2_byte_buf[4]); ++ pt->t.chunkId = *((unsigned int *) &pt2_byte_buf[8]); ++ pt->t.byteCount = *((unsigned int *) &pt2_byte_buf[12]); ++ pt->ecc.colParity = pt2_byte_buf[16]; ++ pt->ecc.lineParity = (pt2_byte_buf[17] & 0x000000ff) | ++ ((pt2_byte_buf[18] << 8) & 0x0000ff00) | ++ ((pt2_byte_buf[19] << 16) & 0x00ff0000) | ++ ((pt2_byte_buf[20] << 24) & 0xff000000); ++ pt->ecc.lineParityPrime = (pt2_byte_buf[21] & 0x000000ff) | ++ ((pt2_byte_buf[22] << 8) & 0x0000ff00) | ++ ((pt2_byte_buf[23] << 16) & 0x00ff0000) | ++ ((pt2_byte_buf[24] << 24) & 0xff000000); ++ } ++} ++ + int nandmtd2_WriteChunkWithTagsToNAND(yaffs_Device * dev, int chunkInNAND, + const __u8 * data, + const yaffs_ExtendedTags * tags) +@@ -51,24 +175,22 @@ + } + + if (data && tags) { +- if (dev->useNANDECC) +- retval = +- mtd->write_ecc(mtd, addr, dev->nBytesPerChunk, +- &dummy, data, (__u8 *) & pt, NULL); +- else ++ nandmtd2_pt2buf(dev, &pt, 0); + retval = + mtd->write_ecc(mtd, addr, dev->nBytesPerChunk, +- &dummy, data, (__u8 *) & pt, NULL); ++ &dummy, data, dev->spareBuffer, ++ NULL); + } else { + if (data) + retval = + mtd->write(mtd, addr, dev->nBytesPerChunk, &dummy, + data); +- if (tags) ++ if (tags) { ++ nandmtd2_pt2buf(dev, &pt, 1); + retval = + mtd->write_oob(mtd, addr, mtd->oobsize, &dummy, +- (__u8 *) & pt); +- ++ dev->spareBuffer); ++ } + } + + if (retval == 0) +@@ -94,30 +216,24 @@ + TENDSTR), chunkInNAND, data, tags)); + + if (data && tags) { +- if (dev->useNANDECC) { + retval = + mtd->read_ecc(mtd, addr, dev->nBytesPerChunk, + &dummy, data, dev->spareBuffer, + NULL); +- } else { +- retval = +- mtd->read_ecc(mtd, addr, dev->nBytesPerChunk, +- &dummy, data, dev->spareBuffer, +- NULL); +- } ++ nandmtd2_buf2pt(dev, &pt, 0); + } else { + if (data) + retval = + mtd->read(mtd, addr, dev->nBytesPerChunk, &dummy, + data); +- if (tags) ++ if (tags) { + retval = + mtd->read_oob(mtd, addr, mtd->oobsize, &dummy, + dev->spareBuffer); ++ nandmtd2_buf2pt(dev, &pt, 1); ++ } + } + +- memcpy(&pt, dev->spareBuffer, sizeof(pt)); +- + if (tags) + yaffs_UnpackTags2(tags, &pt); + +@@ -178,10 +294,11 @@ + *sequenceNumber = 0; + *state = YAFFS_BLOCK_STATE_EMPTY; + } ++ ++ T(YAFFS_TRACE_MTD, ++ (TSTR("block is OK seq %d state %d" TENDSTR), *sequenceNumber, ++ *state)); + } +- T(YAFFS_TRACE_MTD, +- (TSTR("block is bad seq %d state %d" TENDSTR), *sequenceNumber, +- *state)); + + if (retval == 0) + return YAFFS_OK; diff --git a/packages/yaffs2/yaffs2-utils-native_cvs.bb b/packages/yaffs2/yaffs2-utils-native_cvs.bb new file mode 100644 index 0000000000..7c6442b77d --- /dev/null +++ b/packages/yaffs2/yaffs2-utils-native_cvs.bb @@ -0,0 +1,15 @@ +require yaffs2-utils_cvs.bb +inherit native +DEPENDS = "" + +CFLAGS += "-I.. -DCONFIG_YAFFS_UTIL" + +do_stage() { + for i in mkyaffsimage mkyaffs2image; do + install -m 0755 utils/$i ${STAGING_BINDIR_NATIVE} + done +} + +do_install() { + : +} diff --git a/packages/yaffs2/yaffs2-utils_cvs.bb b/packages/yaffs2/yaffs2-utils_cvs.bb new file mode 100644 index 0000000000..439136e2eb --- /dev/null +++ b/packages/yaffs2/yaffs2-utils_cvs.bb @@ -0,0 +1,27 @@ +DESCRIPTION = "Tools for managing 'yaffs2' file systems." +SECTION = "base" +HOMEPAGE = "http://www.yaffs.net" +LICENSE = "GPLv2" +PV = "0.0.0+cvs${SRCDATE}" +PR = "r0" + +# +# NOTE: This needs pretty recent mtd-utils otherwise it fails to compile +# + +SRC_URI = "cvs://anonymous@cvs.aleph1.co.uk/home/aleph1/cvs;module=yaffs2 \ + file://mkyaffs2image.patch;patch=1" +S = "${WORKDIR}/yaffs2" + +CFLAGS += "-I.. -DCONFIG_YAFFS_UTIL" + +do_compile() { + cd utils && oe_runmake +} + +do_install() { + install -d ${D}${sbindir} + for i in mkyaffsimage mkyaffs2image; do + install -m 0755 utils/$i ${D}${sbindir} + done +} |