Forum Discussion

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

Force Update of zImage

I was having problems getting the zImage to update properly when just experimentally adding/subtracting/modifying the romfs as in the Compile Hello example on the wiki.

My standard operation was:

make

make linux

make image

... then copy images/zImage to transfer to the NIOS II processor.

This mysteriously would not update all of the time (hardly ever).

So I found after a few days I could do this:

make clean

make linux_hwselect SYSPTF=insert your.ptf

make

make linux

make image

... the copy images/zImage to transfer to the NIOS II Processor.

This worked however it takes a while to do all of that. So I poked around the Makefile and on the wiki and finally stumbled upon some words of wisdom:

{

Whenever you update the ~/rootfs you have to compile the kernel and update the initramfs.

CHK usr/initramfs_list

CPIO usr/initramfs_data.cpio

GZIP usr/initramfs_data.cpio.gz

AS usr/initramfs_data.o

LD usr/built-in.o

If you didn't see the "CPIO" and "GZIP" in compile message, the initramfs is not updated. You will have to remove the file usr/initramfs_list in kernel dir, and compile again to force the update of initramfs.

}

This works. The key being the makefile checking to see if the initramfs_list file has been changed/modified/or missing.

In my case the file is in uClinux-dist-test/linux-2.6.x/usr/

So now the proper thing to do is:

rm -f linux-2.6.x/usr/initramfs_list

make (only if you want to recompile a user program or something)

make linux

make image

... copy the images/zImage elsewhere to use

I hope this helps someone out. I spent a couple of days on this.

Any helpful comments are appreciated.