Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12748 Discussions

Problem with build jfss2 filesystem

Altera_Forum
Honored Contributor II
1,652 Views

I do uclinux porting on my own board, use the "uClinux-dist-20060803" released kernel, custom the kernel as follow: 

---------------------------------------------------------- 

Memory Technology Devices (MTD) --> 

<*> Memory Technology Device (MTD) support 

[*] MTD partitioning support  

<*> Direct char device access to MTD devices  

<*> Caching block device access to MTD devices 

RAM/ROM/Flash chip drivers -->  

<*> Support for Altera EPCS Device 

Mapping drivers for chip access -->  

<*> Maps for Altera EPCS Configuration Device 

File systems -->  

Miscellaneous filesystems -->  

<*> Journalling Flash File System v2 (JFFS2) support 

------------------------------------------------------------------ 

then try "make", but there are some errors: 

-------------------------------------------------------------------- 

make[3]: Leaving directory `/home/gaobing/uClinux-dist/user/games&#39; 

[ ! -d "init" ] || ( touch init/.sgbuilt_user && make -j1 -C init ) || exit $? 

make[3]: Entering directory `/home/gaobing/uClinux-dist/user/init&#39; 

make[3]: Nothing to be done for `all&#39;. 

make[3]: Leaving directory `/home/gaobing/uClinux-dist/user/init&#39; 

[ ! -d "mtd-utils" ] || ( touch mtd-utils/.sgbuilt_user && make -j1 -C mtd-utils ) || exit $? 

make[3]: Entering directory `/home/gaobing/uClinux-dist/user/mtd-utils&#39; 

gcc -I/usr/include -I. -Dprintk=printf -DKERN_NOTICE= -DKERN_WARNING= -c -o build/compr_zlib.o compr_zlib.c 

compr_zlib.c:38:18: error: zlib.h: &#27809;&#26377;&#37027;&#20010;&#25991;&#20214;&#25110;&#30446;&#24405; 

compr_zlib.c: &#22312;&#20989;&#25968; ‘zlib_compress’ &#20013;&#65306; 

compr_zlib.c:81: &#38169;&#35823;&#65306;‘z_stream’ &#26410;&#22768;&#26126; (&#22312;&#27492;&#20989;&#25968;&#20869;&#31532;&#19968;&#27425;&#20351;&#29992;) 

compr_zlib.c:81: &#38169;&#35823;&#65306;(&#21363;&#20351;&#22312;&#19968;&#20010;&#20989;&#25968;&#20869;&#22810;&#27425;&#20986;&#29616;&#65292;&#27599;&#20010;&#26410;&#22768;&#26126;&#30340;&#26631;&#35782;&#31526;&#22312;&#20854; 

compr_zlib.c:81: &#38169;&#35823;&#65306;&#25152;&#22312;&#30340;&#20989;&#25968;&#20869;&#21482;&#25253;&#21578;&#19968;&#27425;&#12290;) 

compr_zlib.c:81: &#38169;&#35823;&#65306;syntax error before ‘strm’ 

compr_zlib.c:91: &#38169;&#35823;&#65306;‘strm’ &#26410;&#22768;&#26126; (&#22312;&#27492;&#20989;&#25968;&#20869;&#31532;&#19968;&#27425;&#20351;&#29992;) 

compr_zlib.c:95: &#38169;&#35823;&#65306;‘Z_OK’ &#26410;&#22768;&#26126; (&#22312;&#27492;&#20989;&#25968;&#20869;&#31532;&#19968;&#27425;&#20351;&#29992;) 

compr_zlib.c:110: &#38169;&#35823;&#65306;‘Z_PARTIAL_FLUSH’ &#26410;&#22768;&#26126; (&#22312;&#27492;&#20989;&#25968;&#20869;&#31532;&#19968;&#27425;&#20351;&#29992;) 

compr_zlib.c:121: &#38169;&#35823;&#65306;‘Z_FINISH’ &#26410;&#22768;&#26126; (&#22312;&#27492;&#20989;&#25968;&#20869;&#31532;&#19968;&#27425;&#20351;&#29992;) 

compr_zlib.c:122: &#38169;&#35823;&#65306;‘Z_STREAM_END’ &#26410;&#22768;&#26126; (&#22312;&#27492;&#20989;&#25968;&#20869;&#31532;&#19968;&#27425;&#20351;&#29992;) 

compr_zlib.c: &#22312;&#20989;&#25968; ‘zlib_decompress’ &#20013;&#65306; 

compr_zlib.c:143: &#38169;&#35823;&#65306;‘z_stream’ &#26410;&#22768;&#26126; (&#22312;&#27492;&#20989;&#25968;&#20869;&#31532;&#19968;&#27425;&#20351;&#29992;) 

compr_zlib.c:143: &#38169;&#35823;&#65306;syntax error before ‘strm’ 

compr_zlib.c:150: &#38169;&#35823;&#65306;‘strm’ &#26410;&#22768;&#26126; (&#22312;&#27492;&#20989;&#25968;&#20869;&#31532;&#19968;&#27425;&#20351;&#29992;) 

compr_zlib.c:154: &#38169;&#35823;&#65306;‘Z_OK’ &#26410;&#22768;&#26126; (&#22312;&#27492;&#20989;&#25968;&#20869;&#31532;&#19968;&#27425;&#20351;&#29992;) 

compr_zlib.c:166: &#38169;&#35823;&#65306;‘Z_FINISH’ &#26410;&#22768;&#26126; (&#22312;&#27492;&#20989;&#25968;&#20869;&#31532;&#19968;&#27425;&#20351;&#29992;) 

compr_zlib.c:168: &#38169;&#35823;&#65306;‘Z_STREAM_END’ &#26410;&#22768;&#26126; (&#22312;&#27492;&#20989;&#25968;&#20869;&#31532;&#19968;&#27425;&#20351;&#29992;) 

make[3]: *** [build/compr_zlib.o] &#38169;&#35823; 1 

make[3]: Leaving directory `/home/gaobing/uClinux-dist/user/mtd-utils&#39; 

make[2]: *** [mtd-utils] &#38169;&#35823; 2 

make[2]: Leaving directory `/home/gaobing/uClinux-dist/user&#39; 

make[1]: *** [all] &#38169;&#35823; 2 

make[1]: Leaving directory `/home/gaobing/uClinux-dist/user&#39; 

make: *** [subdirs] &#38169;&#35823; 1 

-------------------------------------------------------------------- 

It seems the library-include problem, in "make menuconfig", I choose "none" library include, did it wrong? What should I do to exclude the errers? 

Need help,ths! 

giantice 

02th Feb 2007
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
798 Views

You will need zlib to build user/mtd-utils/build/mkfs.jffs2. 

Make sure you have zlib install in your Linux PC.
0 Kudos
Altera_Forum
Honored Contributor II
798 Views

 

--- Quote Start ---  

originally posted by hippo@Feb 2 2007, 12:05 PM 

you will need zlib to build user/mtd-utils/build/mkfs.jffs2. 

make sure you have zlib install in your linux pc. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=21139) 

--- quote end ---  

 

--- Quote End ---  

 

hi hippo, 

thanks for your help, now I can successfully make the kernel, but when I download and mount the jffs2, there is problem: 

------------------------------------- 

/> mount -t jffs2 /dev/mtdblock0 /mnt 

 

jffs2: Too few erase blocks (0) 

 

mount: Mounting /dev/mtdblock0 on /mnt failed: Invalid argument 

 

/> 

------------------------------------ 

I see the post before as follow: 

---------------------------------------- 

You need to learn flash programmer before using mtd. 

First, resize your cfi flash to 4M base addr 0 ,in sopc builder, and regenerate sof. 

 

Then enable epcs mtd and cfi mtd, 

in drivers/mtd/maps/ 

edit epcs_map.c 

CODE 

static struct mtd_partition epcs_partitions[] = 

.name = "sof_kernel", 

.size = 0x200000, 

.offset = 0x000000, 

}; 

 

static const char *part_probes[] __initdata = {NULL}; 

 

edit altera.c 

CODE 

static struct mtd_partition alteramap_partitions[] = { 

.name = "romfs/jffs2", 

.size = 0x400000, 

.offset = 0x000000, 

}; 

 

Rebuild kernel image from the start "make clean", "make linux_hwselect....".... 

 

Follow the wiki, 

http://nioswiki.jot.com/wikihome/operating...flashprogrammer (http://nioswiki.jot.com/wikihome/operating...flashprogrammer

To program sof and zImage to your EPCS. 

And erase cfi flash.  

---------------------------------------- 

Did it the problem of epcs_map.c and edit altera.c. I use the EPCS4, which is as large as 512Kbytes. 

Should edit the files of epcs_map.c and edit altera.c? How to do it. 

Waiting your reply, ths! 

Ths again for the bison problem I post before, I download the bison package installed ,then make success, there is no ftp build problems. 

giantice 

02th Feb 2007
0 Kudos
Altera_Forum
Honored Contributor II
798 Views

[ ] Detect non-CFI AMD/JEDEC-compatible flash chips 

Don&#39;t detect non-CFI.
0 Kudos
Altera_Forum
Honored Contributor II
798 Views
0 Kudos
Altera_Forum
Honored Contributor II
798 Views

And please note, the epcs4 is used to store fpga config, plus kernel image. 

So there won&#39;t be much space left for jffs2.
0 Kudos
Reply