02-21-2017 12:13 PM
I'm running into problems trying to customize a rootfs for my Linux OS running on a ZedBoard. There are a couple of reasons I need to customize it:
- Once I get Linux configured to my liking, I will be relegating it to a secondary boot, as I'll be booting Linux from OP-TEE. This will require some additional changes to the kernel and rootfs.
- In addition, I'll be changing my HW design and possibly creating some drivers which will require similar changes to the rootfs
- While I can boot using the arm_ramdisk.image.gz provided on the Wiki, it has a very old and buggy version of the C runtime, which I need for my application to run.
From what I have read, just plopping down new C libs and updating links will likely lead to chaos. So, I figured I'd opt for something better...like using the rootfs that comes with Petalinux. So, I thought that maybe I'd go ahead and give Petalinux tools a spin. While I was able to install them fine, they just won't work properly on my Ubuntu 16.10 VM.
So, I then tried to just use the rootfs that comes with Petalinux...but repackage it to an initrd ramdisk (i.e. not a cpio based one). To do that, I created a device off of /dev/ram, mounted it, dd-ed it into a file, and then packaged it up just like I normally would do with this type of rootfs (i.e. following the instructions on the wiki). I figured this would do the trick. Unfortunately, when I boot, the kernel can't load the ramdisk. I get errors like "couldn't mount as ext3 due to feature incompatibilties". I tried moving from ext2 to ext4, but neither worked...and apparently you can't mount an ext3 filesystem from /dev/ram.
OK...now I'm stuck, and am desperately looking for a way to just create an easily customizable rootfs that includes a more recent C runtime, without using petalinux tools (since they won't work)...one that uses the initrd format...unless there is a way to reconfigure my kernel to use the newer cpio format.
After posting this, I'm going to try one more thing. However, I am all ears for a better way to do this.
02-21-2017 12:21 PM
So, the one thing I said I would try didn't work either. I went ahead and mounted the downloaded ramdisk that does work, and just replaced the whole thing with the contents of the cpio based archive.
Unfortunately, I received exactly the same kind of errors. So, it appears that at least my process was somewhat reasonable...though entirely futile :-).
Again, I'd really appreciate some help, as I'm running out of options. I really don't want to have to try and setup something like a 32 bit bit Linux VM that may do better with petalinux tools.
I'll continue to beat on this while I hope for a merciful response.
02-21-2017 12:28 PM
BTW...I did try the approach documented on the wiki to create a blank initrd based FS as well. It was only slightly different than what I did with the /dev/ram device...and unfortunately, had the same results.
Is there something fundamentally different with the cpio based rootfs that makes it wrong to use it in this way, or am I missing something completely different. It seems like this should work.