Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

repack(decompress) / pack zImage

Hi all,

is any way and tools, how to repack zImage and view/edit the files in zImage - /bin, /dev, /etc, /home, /lib, /mnt, /proc, /sbin, /sys, /tmp, /usr, /var ?

And after editing for example rc in /etc is any way, how to pack into zImage (without make) ?

Thank you very much.

Jan Naceradsky, Czech Republic

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You will need to search the gzip magic 1F 8B, gunzip, then you get the kernel. Next search the gzip magic again for initramfs, zcat and cpio. Not a easy job.

    - Hippo
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Oh no...:(

    I found that there is two commands, which is possible to run in NIOSII EDS Command line:

    />nios2-elf-readelf -a zImage // which reports:

    Elf header:

    Magic: xxx

    Class: xxx

    xxx

    Type: EXEC

    Machine: Altera Nios II

    xx

    etc.

    />nios2-elf-ar

    which should be able to delete, replace, extract or add file etc., but when i run

    />nios2-elf-ar p zImage

    nios2-elf-ar:zImage:File format not recognized

    />

    Why ????

    Is anywhere some manual for this command (nios2-elf-ar) ?

    When I start from other side, is any way, how "repair" uClinux zImage, when i only want to edit and compile my user program, edit some etc/rc and *.conf files and after this create zImage or any way upgrade or modify my zImage on Altera fpga without install whole package:

    - download the tar file nios2-linux-20090730.tar, which take 1.6GB and after install, how you write on nioswiki about 6GB or more free disk space.

    I found, that i can install nios2-gcc compiler, which has 69MB on http://www.niosftp.com/pub/gnutools/...080203.tar.bz2 (http://www.niosftp.com/pub/gnutools/...080203.tar.bz2)

    but after this i will need to have some parts of uClinux instalation ...

    Thank you for some answers.

    Jan Naceradsky