[Yaffs] mkyaffs and mkyaffsimage fixes for Linux 2.6
Frank Rowand
frowand@mvista.com
Fri, 21 Jan 2005 15:49:33 -0800
This is a multi-part message in MIME format.
--------------030805000800070709080609
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Hopefully these fixes can be useful.
The subject line is a slight misnomer. I'm actually building mkyaffsimage
on a Redhat 9.0 system (thus Linux 2.4.x) to run on Redhat 9.0. I'm
building mkyaffs on Redhat 9.0 to run on Linux 2.6.10. We will be
building on all the host systems that MontaVista supports, so I will
send additional fixes if we encounter issues on the other hosts.
If putting all the patches in one tar is inconvenient I can break them
out to one patch per email -- just let me know.
Feedback, comments, questions are all welcome.
Thanks!
-Frank
--
Frank Rowand <frank_rowand@mvista.com>
MontaVista Software, Inc
--------------030805000800070709080609
Content-Type: text/plain;
name="info_userland_patches_02"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="info_userland_patches_02"
This is a list of the patches that I used to get the YAFFS userland
programs (host: mkyaffsimage, target: mkyaffs) working for Linux 2.6.10.
These changes have not checked for compatibility with Linux 2.4, but I tried
to be compatible.
Some of these fixes have been sent to this email list before, but I am
including them in this set so that I have everything I've done grouped
together in an easily found set.
yaffs_userland_01_base.patch
The userland related files, as of Oct 27, 2004, from
http://www.aleph1.co.uk/cgi-bin/viewcvs.cgi/yaffs/
"Download tarball" link
I won't send this patch to the email list, since the files can be
retrieved from the web sit.
The files are:
devextras.h
nand_ecc.c
yaffs_guts.h
yportenv.h
utils/Makefile
utils/mkyaffs.c
utils/mkyaffsimage.c
yaffs_userland_02_fixup_rh9.patch
Changes needed to allow compilation of host program on Redhat 9.0.
- /usr/include/bits/stat.h defines st_atime, st_mtime, st_ctime, thus
these strings can not be used as field names in a yaffs data
structure.
- This possible fix has been discussed on the email list, but no final
resolution exists yet.
yaffs_userland_03_mkyaffs_oobinfo.patch
Changes needed to allow compilation of target program.
- Declarations needed for mtd ioctls moved from the Linux 2.4 location of
/usr/include/linux/mtd/mtd.h to the kernel header file mtd/mtd-user.h
- Fix #include in util/mkyaffs.c.
- Add eccbytes field to initialization of yaffs_oobinfo if Linux 2.6.
- It is really bad to include kernel header files into userland
programs, but I included <linux/version.h> so that Linux 2.4 vs
Linux 2.6 could be checked.
yaffs_userland_04_fix_warnings.patch
Make host and target program compile warnings go away.... I like my newly
introduced errors to be more obvious.
yaffs_userland_05_64bit.patch
struct yaffs_ObjectHeader describes an object that resides in the YAFFS
filesystem, in the flash. The size of the structure and offsets within
the structure must be the same, whether on a 32 bit system or a 64 bit
system.
- Fix the data types used in the structure.
- Not tested on a 64 bit system.
yaffs_userland_06_mkyaffs_damaged_count.patch
mkyaffs writes a YAFFS filesystem image into flash, skipping damaged
blocks in the flash. mkyaffs checks to make sure that the image is
not larger than the flash before beginning to write the image.
- The image size is compared against the size of the flash, not the
number of undamaged blocks. Add a check to detect if the size of
the undamaged blocks was sufficient to contain the image.
yaffs_userland_07_mkyaffs_printf.patch
mkyaffs has an incorrect format specifier in printf().
- Fix it.
yaffs_userland_08_mkyaffsimage_argc.patch
mkyaffsimage incorrectly implements check of value of argc.
- Fix it.
yaffs_userland_09_mkyaffsimage_error_handling.patch
mkyaffsimage error handling done slightly incorrectly and inconsistently.
- Fix it.
yaffs_userland_10_mkyaffsimage_buf_overflow.patch
Possible buffer overflow in mkyaffsimage, if path of source filesystem
tree is too long.
- Change sprintf() to snprintf() to prevent overflow.
--------------030805000800070709080609
Content-Type: application/x-gzip;
name="patches_02_tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="patches_02_tar.gz"
H4sIAMeR8UEAA+08a3faSLL5Cr+i1rvJBSNAEi8/kpxxbCfhjoN9bGdn5uT66AjRgDZCYvWI
7ZuT/36rqiUhAX7l4cncVWWMUHd19aO669nM3AytqQgMVW8++VGgqm211+vgU2+12y18qvje
5WcMTzRV67Vbak/vqE9UTddV/Ql0ftiIMhAFoekDPBn73qXpjm7EE+7Ef4zxPDLMF/y/Nsfj
wIgC4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