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++
Объявления
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Обсуждение

problem with initramfs

Altera_Forum
Почетный участник II
1 653Просмотр.

hello all friend 

 

i have made kernel image with initramfs.i have used nios ide fot it. 

for intramfs ,i have made rootfs sourse with help of nios (filesystem project).  

but when i load it on board then i get folowing messeges.. 

 

Linux version 2.6.11-uc0 (Administrator@WINWORK_013) (gcc version 3.4.1 (Altera  

Nios II 5.0 b73))# 2 Tue Jul 11 14:25:43 IST 2006 

 

 

 

 

uClinux/Nios II 

 

Altera Nios II support © 2004 Microtronix Datacom Ltd. 

 

Built 1 zonelists 

 

Kernel command line: root=/dev/mtdblock0 ro 

 

PID hash table entries: 64 (order: 6, 1024 bytes) 

 

Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) 

 

Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) 

 

Memory available: 6656k/8192k RAM, 0k/0k ROM (749k kernel code, 671k data) 

 

Mount-cache hash table entries: 512 (order: 0, 4096 bytes) 

 

Kernel panic - not syncing: junk in compressed archive 

 

 

 

 

i know i have to select linux system for building vmlinux not nios ide on window. 

but can you help me to build kernel with initramfs on nios ide.
0 баллов
9 Ответы
Altera_Forum
Почетный участник II
888Просмотр.

Jdhar and I had tried a lot on cygwin, but failed. You may track the old posts. Your problem may be in kernel Makefile, there are too many dos2unix. 

 

I don&#39;t recommend work on IDE. Actually I think it is totally wrong. But it is all up to you. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif
Altera_Forum
Почетный участник II
888Просмотр.

thaks hippo for reply. 

 

now i am starting with linux redhat-9. 

 

i have downloaded nios2linux-1.4.zip and build0411.zip. 

but i can&#39;t understand your 3and 4 step in buildrootguide. 

which folder i have to make in ~/download folder. and which source i have to put in which folder. 

 

please guide me hippo....
Altera_Forum
Почетный участник II
888Просмотр.

soory hippo 

i get idea how to start. 

 

but i have some query. 

 

1> i have linux redhat -9.is it posible on radhat -9? 

2> can i use source uClinux-dist-20060511.tar.bz2 in place of uClinux-dist- 

20051110.tar.bz2. 

 

 

please reply as soon as posible.
Altera_Forum
Почетный участник II
888Просмотр.

 

--- Quote Start ---  

originally posted by slsnios@Jul 12 2006, 02:19 PM 

thaks hippo for reply. 

 

now i am starting with linux redhat-9. 

 

i have downloaded nios2linux-1.4.zip and build0411.zip. 

but i can&#39;t understand your 3and 4 step in buildrootguide. 

which folder i have to make in ~/download folder. and which source  i have to put in which folder. 

 

please guide me hippo.... 

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

--- quote end ---  

 

--- Quote End ---  

 

the make command in redhat 9.0 may be too old. 

you&#39;d better use Fedora core 5. 

 

Don&#39;t follow the buildroot guide !! 

The wiki is easier now. follow step 1-3. 

http://nioswiki.jot.com/wikihome/operating...ms/%c2%b5clinux (http://nioswiki.jot.com/wikihome/operatingsystems/%c2%b5clinux)
Altera_Forum
Почетный участник II
888Просмотр.

hi hippo 

 

i have read step1-3 .i have some query. 

according it and my understanding for it,i have made following doc for my reference .before going to work on linux, i want to be sure am i right or wrong . 

can you tell me where i am wong in my doc. 

 

 

 

 

 

i am following below step: 

 

-> i have copy source code into home folder  

 

ls 

 

=> o/p: 

uClinux-dist-test-20060511.tar.bz2 uClinux-dist.diff.gz nios2gcc.tar.bz2 

 

nios2libs.tar.bz2 build0411.zip nios2rootfs.tar.bz2 nios2linux-1.4.zip 

 

 

 

-> Login as a user account on Linux PC, open a terminal.  

 

pwd ->/home 

su -# root passwd 

tar jxf nios2gcc.tar.bz2 -C / 

exit 

 

->so now /opt is in home folder.next command for setting path  

->for /home/opt/nios2/bin 

 

PATH=$PATH:/home/opt/nios2/bin:$usr/bin 

 

->for checking command 

 

nios2-linux-uclibc-gcc -v 

 

 

->Login as a user account on Linux PC, open a terminal. 

 

su -# your root passwd 

tar jxf nios2libs.tar.bz2 -C / 

exit 

 

-> i have query after above step => have i to give PATH for nios2libs ? if  

-> yes, then where? . 

 

 

-># login as a user account, don&#39;t use root account, 

 

cd /home 

tar jxf uClinux-dist-test-20060511.tar.bz2 

cd uClinux-dist-test 

zcat ../uClinux-dist.diff.gz | patch -p0 

 

-> still in /home/uClinux-dist-test dir, don&#39;t cd linux-2.6.x  

 

make menuconfig 

 

make linux_hwselect SYSPTF=your_system.ptf 

 

make romfs# to create romfs dir, make will fail, ignored 

 

make menuconfig 

 

-> compile kernel and apps 

 

make 

 

-> rebuild kernel for initramfs 

 

make linux image
Altera_Forum
Почетный участник II
888Просмотр.

 

--- Quote Start ---  

originally posted by slsnios@Jul 13 2006, 02:43 PM 

hi hippo 

 

i have read step1-3 .i have some query. 

according it and my understanding for it,i have made following doc for my reference .before going to work on linux, i want to be sure am i right or wrong . 

can you tell me where i am wong in my doc. 

 

 

 

 

 

i am following below step: 

 

eg, i am user hippo, 

  -> login as a user account, eg hippo on linux pc, open a terminal.  

 

  -> i have copy source code into /home/hippo folder  

     

      ls /home/hippo 

         

          => o/p: 

              uclinux-dist-test-20060511.tar.bz2  uclinux-dist.diff.gz  nios2gcc.tar.bz2 

             

     

      su  -#   root passwd 

      tar jxf /home/hippo/nios2gcc.tar.bz2 -c / 

      exit 

     

    ->so  /opt/nios2/bin has the cross gcc. next command for setting path   

    ->add /opt/nios2/bin to path ( if you save it to .bash_profile, logout and login again) 

 

      path=$path:/opt/nios2/bin 

 

    ->for checking command 

     

      nios2-linux-uclibc-gcc -v 

 

   

    --> install uclinux-dist source 

      cd /home/hippo 

      tar jxf uclinux-dist-test-20060511.tar.bz2 

      cd uclinux-dist-test 

      zcat ../uclinux-dist.diff.gz | patch -p0 

 

    -> still in /home/hippo/uclinux-dist-test dir, don&#39;t cd linux-2.6.x  

     

      make menuconfig 

 

      make linux_hwselect sysptf=path of your_system.ptf 

       

      make romfs# to create romfs dir, make will fail, ignored 

 

      make menuconfig 

       

    -> compile kernel and apps 

     

      make 

     

    -> rebuild kernel for initramfs 

     

      make linux image 

 

--> the kernel in elf object format will be  /home/hippo/uclinux-dist-test/images/zimage 

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

--- quote end ---  

 

--- Quote End ---  

 

updated your doc.
Altera_Forum
Почетный участник II
888Просмотр.

Hi all 

 

I have Fedora core 3. 

i have succeed up to following step:  

 

 

ls 

 

=> o/p: 

uClinux-dist-test-20060511.tar.bz2 uClinux-dist.diff.gz nios2gcc.tar.bz2 

nios2libs.tar.bz2  

-> Login as a user account on Linux PC, open a terminal.  

pwd ->/home/slsnios/ 

su -# root passwd 

tar jxf nios2gcc.tar.bz2  

exit 

->so now /opt is in home folder.next command for setting path  

->for /home/opt/nios2/bin 

PATH=$PATH:/home/slsnios/opt/nios2/bin:$usr/bin 

->for checking command 

nios2-linux-uclibc-gcc -v 

->Login as a user account on Linux PC, open a terminal. 

su -# your root passwd 

tar jxf nios2libs.tar.bz2 -C / 

exit 

-># login as a user account 

 

cd /home/slsnios/ 

tar jxf uClinux-dist-test-20060511.tar.bz2 

cd uClinux-dist-test 

zcat ../uClinux-dist.diff.gz | patch -p0 

 

-> still in /home/slsnios/uClinux-dist-test dir, don&#39;t cd linux-2.6.x  

make menuconfig 

make linux_hwselect SYSPTF=your_system.ptf 

make romfs# to create romfs dir, make will fail, ignored 

make menuconfig 

-> compile kernel and apps 

make 

 

 

But when i gave make command ,then i got following messages 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 

make -C tools/ucfront 

make[1]: Entering directory `/home/sls/krunal/initfs/uClinux-dist-test/tools/ucfront&#39; 

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

make[1]: Leaving directory `/home/slsnios/uClinux-dist-test/tools/ucfront&#39; 

ln -sf /home/slsnios/uClinux-dist-test/tools/ucfront/ucfront tools/ucfront-gcc 

ln -sf /home/slsnios/uClinux-dist-test/tools/ucfront/ucfront tools/ucfront-g++ 

ln -sf /home/slsnios/uClinux-dist-test/tools/ucfront/ucfront-ld tools/ucfront-ld 

make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- -C linux- 

2.6.x zImage || exit 1 

/bin/sh: nios2-linux-uclibc-gcc: command not found 

make[1]: nios2-linux-uclibc-gcc: Command not found 

make[1]: Entering directory `/home/slsnios/uClinux-dist-test/linux-2.6.x&#39; 

make[1]: nios2-linux-uclibc-gcc: Command not found 

CHK include/nios2_system.h 

perl -I/home/slsnios/uClinux-dist-test/linux-2.6.x/arch/nios2nommu/scripts /home/slsnios/uClinu 

x-dist-test/linux-2.6.x/arch/nios2nommu/scripts/gen_nios2_system.h.pl CPU SDRAM CFI_Flash < /home/slsnios 

/project/ESDK_Board_Diagnostic_System_using_NiosII.ptf > include/nios2_system.h.tmp; if [ -r include/nios2_system.h 

] && cmp -s include/nios2_system.h include/nios2_system.h.tmp; then rm -f include/nios2_system.h.tmp; else echo &#39; 

UPD include/nios2_system.h&#39;; mv -f include/nios2_system.h.tmp include/nios2_system.h; fi 

make[1]: *** [include/nios2_system.h] Interrupt 

make: *** [linux] Interrupt 

 

[sls@test uClinux-dist-test]$ PATH=$PATH:/home/slsnios/opt/nios2/bin:$/bin 

[sls@test uClinux-dist-test]$ make 

make -C tools/ucfront 

make[1]: Entering directory `/home/slsnios/uClinux-dist-test/tools/ucfront&#39; 

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

make[1]: Leaving directory `/home/slsnios/uClinux-dist-test/tools/ucfront&#39; 

ln -sf /home/slsnios/uClinux-dist-test/tools/ucfront/ucfront tools/ucfront-gcc 

ln -sf /home/slsnios/uClinux-dist-test/tools/ucfront/ucfront tools/ucfront-g++ 

ln -sf /home/slsnios/uClinux-dist-test/tools/ucfront/ucfront-ld tools/ucfront-ld 

make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- -C linux- 

2.6.x zImage || exit 1 

no emulation specific options. 

make[1]: Entering directory `/home/slsnios/uClinux-dist-test/linux-2.6.x&#39; 

CHK include/nios2_system.h 

perl -I/home/slsnios/uClinux-dist-test/linux-2.6.x/arch/nios2nommu/scripts /home/slsnios/uClinu 

x-dist-test/linux-2.6.x/arch/nios2nommu/scripts/gen_nios2_system.h.pl CPU SDRAM CFI_Flash < /home/slsnios 

/project/ESDK_Board_Diagnostic_System_using_NiosII.ptf > include/nios2_system.h.tmp; if [ -r include/nios2_system.h 

] && cmp -s include/nios2_system.h include/nios2_system.h.tmp; then rm -f include/nios2_system.h.tmp; else echo &#39; 

UPD include/nios2_system.h&#39;; mv -f include/nios2_system.h.tmp include/nios2_system.h; fi 

CHK include/linux/version.h 

CHK include/linux/compile.h 

SKIPPED include/linux/compile.h 

CHK usr/initramfs_list 

Kernel: arch/nios2nommu/boot/zImage is ready 

make[1]: Leaving directory `/home/slsnios/uClinux-dist-test/linux-2.6.x&#39; 

if [ -f linux-2.6.x/vmlinux ]; then  

ln -f linux-2.6.x/vmlinux linux-2.6.x/linux ;  

fi 

. linux-2.6.x/.config; if [ "$CONFIG_MODULES" = "y" ]; then  

[ -d linux-2.6.x/modules ] || mkdir linux-2.6.x/modules;  

make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- - 

C linux-2.6.x modules;  

fi 

for dir in include lib include user ; do [ ! -d $dir ] || make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- - 

C $dir || exit 1 ; done 

make[1]: Entering directory `/home/slsnios/uClinux-dist-test/include&#39; 

find . -depth -type l -a ! -name Makefile | xargs rm > /dev/null 2>&1 || exit 0 

find . -depth -type d | xargs rmdir > /dev/null 2>&1 || exit 0 

Making symlinks in include/ 

Making include/c++ symlink to compiler c++ includes 

make[1]: Leaving directory `/home/slsnios/uClinux-dist-test/include&#39; 

make[1]: Entering directory `/home/slsnios/uClinux-dist-test/lib&#39; 

for i in ../include uClibc ../include /home/slsnios/uClinux-dist-test/prop ; do  

if [ -d $i ]; then  

touch $i/.sgbuilt_lib;  

make -C $i || exit $? ;  

fi;  

make make_links || exit ;  

done 

touch: cannot touch `../include/.sgbuilt_lib&#39;: Permission denied 

make[2]: Entering directory `/home/slsnios/uClinux-dist-test/include&#39; 

find . -depth -type l -a ! -name Makefile | xargs rm > /dev/null 2>&1 || exit 0 

find . -depth -type d | xargs rmdir > /dev/null 2>&1 || exit 0 

Making symlinks in include/ 

Making include/c++ symlink to compiler c++ includes 

make[2]: Leaving directory `/home/slsnios/uClinux-dist-test/include&#39; 

make[2]: Entering directory `/home/slsnios/uClinux-dist-test/lib&#39; 

Making symlinks in lib/ 

make[2]: Leaving directory `/home/slsnios/uClinux-dist-test/lib&#39; 

touch: cannot touch `uClibc/.sgbuilt_lib&#39;: Permission denied 

/bin/sh: nios2-elf-gcc: command not found 

/bin/sh: nios2-elf-gcc: command not found 

/bin/sh: nios2-elf-gcc: command not found 

make[2]: Entering directory `/home/slsnios/uClinux-dist-test/uClibc&#39; 

/bin/sh: nios2-elf-gcc: command not found 

+ ./extra/scripts/fix_includes.sh -k &#39;~/uClinux-dist-test/linux-2.6.x&#39; -t nios2 -n 

 

 

The file ~/uClinux-dist-test/linux-2.6.x/Makefile or ~/uClinux-dist-test/linux-2.6.x/include/linux/version.h is mis 

sing! 

Perhaps your kernel source is broken? 

make[2]: *** [headers] Error 1 

make[2]: Leaving directory `/home/slsnios/uClinux-dist-test/uClibc&#39; 

make[1]: *** [all] Error 2 

make[1]: Leaving directory `/home/slsnios/uClinux-dist-test/lib&#39; 

make: *** [subdirs] Error 1  

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 

 

please help me where i am wrong . 

Thanks
Altera_Forum
Почетный участник II
888Просмотр.

slsnios, 

 

to pick up the original thread, 

I had the same problem using the IDE, the archive it produces on Cygwin seems to be corrupted. I use the IDE for Kernel developement, but I have also a Linux machine for compiling applications or libraries. 

To bypass the problem of the corrupted archive I create the archive on Linux machine FC4 and include it in the IDE. 

In the file linux-2.6.x\usr\initramfs_data.s you must specify the path where your archive resides. In the kernels menuconfig I picked the same path. 

On the Linux machine you create the initramfs_data.gpio.gz archive and copy it to the directory from where it should be included. 

Whenever you build the kernel in the IDE your archive gets picked instead of the IDEs archive.
Altera_Forum
Почетный участник II
888Просмотр.

However, 

 

this method also fails if the archive is bigger than 100k. 

Then a compiler warning like: file truncated 

shows up. 

So in my opinion initramfs only works under Linux
Ответить