nuvoton980 generate yaffs2 format rootfs (九)

1      Scope of Document

This document describes how to product yaffs2 rootfs img file

2      Requiremen

2.1     Function Requirement

2.2     Performance Requirement

3      Method

3.1     Compile

root@vmuer-VirtualBox:/home/vmuer/tmp/nuc980bsp# cd yaffs2utils/

root@vmuer-VirtualBox:/home/vmuer/tmp/nuc980bsp/yaffs2utils# make

gcc -I. -I./yaffs2 -O2 -D_HAVE_BROKEN_MTD_H -Wall -Wshadow -Winline -Wpointer-arith -Wnested-externs -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -D_HAVE_MMAP   -c -o yaffs2/yaffs_hweight.o yaffs2/yaffs_hweight.c

gcc -I. -I./yaffs2 -O2 -D_HAVE_BROKEN_MTD_H -Wall -Wshadow -Winline -Wpointer-arith -Wnested-externs -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -D_HAVE_MMAP   -c -o yaffs2/yaffs_ecc.o yaffs2/yaffs_ecc.c

gcc -I. -I./yaffs2 -O2 -D_HAVE_BROKEN_MTD_H -Wall -Wshadow -Winline -Wpointer-arith -Wnested-externs -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -D_HAVE_MMAP   -c -o yaffs2/yaffs_packedtags1.o yaffs2/yaffs_packedtags1.c

gcc -I. -I./yaffs2 -O2 -D_HAVE_BROKEN_MTD_H -Wall -Wshadow -Winline -Wpointer-arith -Wnested-externs -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -D_HAVE_MMAP   -c -o yaffs2/yaffs_packedtags2.o yaffs2/yaffs_packedtags2.c

gcc -I. -I./yaffs2 -O2 -D_HAVE_BROKEN_MTD_H -Wall -Wshadow -Winline -Wpointer-arith -Wnested-externs -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -D_HAVE_MMAP   -c -o safe_rw.o safe_rw.c

gcc -I. -I./yaffs2 -O2 -D_HAVE_BROKEN_MTD_H -Wall -Wshadow -Winline -Wpointer-arith -Wnested-externs -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -D_HAVE_MMAP   -c -o endian_convert.o endian_convert.c

gcc -I. -I./yaffs2 -O2 -D_HAVE_BROKEN_MTD_H -Wall -Wshadow -Winline -Wpointer-arith -Wnested-externs -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -D_HAVE_MMAP   -c -o progress_bar.o progress_bar.c

gcc -I. -I./yaffs2 -O2 -D_HAVE_BROKEN_MTD_H -Wall -Wshadow -Winline -Wpointer-arith -Wnested-externs -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -D_HAVE_MMAP   -c -o mkyaffs2.o mkyaffs2.c

gcc -o mkyaffs2 yaffs2/yaffs_hweight.o yaffs2/yaffs_ecc.o yaffs2/yaffs_packedtags1.o yaffs2/yaffs_packedtags2.o safe_rw.o endian_convert.o progress_bar.o mkyaffs2.o -lm

gcc -I. -I./yaffs2 -O2 -D_HAVE_BROKEN_MTD_H -Wall -Wshadow -Winline -Wpointer-arith -Wnested-externs -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -D_HAVE_MMAP   -c -o unyaffs2.o unyaffs2.c

unyaffs2.c: In function ‘unyaffs2_obj_chattr’:

unyaffs2.c:763:2: warning: ignoring return value of ‘lchown’, declared with attribute warn_unused_result [-Wunused-result]

  lchown(fpath, obj->uid, obj->gid);

  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from unyaffs2.c:51:0:

At top level:

nand_ecclayout.h:44:25: warning: ‘nuc970_oobTb’ defined but not used [-Wunused-variable]

 static nand_ecclayout_t nuc970_oobTb = {

                         ^~~~~~~~~~~~

In file included from /usr/include/string.h:494:0,

                 from unyaffs2.c:26:

In function ‘memcpy’,

    inlined from ‘unyaffs2_extract_hardlink.constprop’ at unyaffs2.c:1222:2,

    inlined from ‘unyaffs2_extract_obj’ at unyaffs2.c:1289:10:

/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’ writing 16 bytes into a region of size 8 overflows the destination [-Wstringop-overflow=]

   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));

          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

gcc -o unyaffs2 yaffs2/yaffs_hweight.o yaffs2/yaffs_ecc.o yaffs2/yaffs_packedtags1.o yaffs2/yaffs_packedtags2.o safe_rw.o endian_convert.o progress_bar.o unyaffs2.o -lm

gcc -I. -I./yaffs2 -O2 -D_HAVE_BROKEN_MTD_H -Wall -Wshadow -Winline -Wpointer-arith -Wnested-externs -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -D_HAVE_MMAP   -c -o unspare2.o unspare2.c

gcc -o unspare2 yaffs2/yaffs_hweight.o yaffs2/yaffs_ecc.o yaffs2/yaffs_packedtags1.o yaffs2/yaffs_packedtags2.o safe_rw.o endian_convert.o progress_bar.o unspare2.o -lm

root@vmuer-VirtualBox:/home/vmuer/tmp/nuc980bsp/yaffs2utils# cd ..

root@vmuer-VirtualBox:/home/vmuer/tmp/nuc980bsp# ./yaffs2utils/mkyaffs2 --inband-tags -p 2048 -s 64 rootfs rootfs.yaffs2 && cp rootfs.yaffs2  /media/vmuer/share/image/

mkyaffs2 0.2.9_20120815: image building tool for YAFFS2.

stage 1: scanning directory 'rootfs'... [done]

scanning complete, total objects: 1555.

stage 2: creating image 'rootfs.yaffs2'

[==========================================================================================================================================================================================] 1555/1555 100%

operation complete,

1555 objects in 16333 NAND pages.

4      Output file

rootfs.yaffs2

原文地址:https://www.cnblogs.com/lianghong881018/p/12529973.html