I'm having a hard time getting an initrd to work nicely with a multi image boot. I'm using an imx6 quad with 1 gb or ram. Our starting address with it is 0x80000000.
So I have an issue with using the normal cpio image built into the kernel as an initramfs. My problem is that we have proprietary modules so it becomes a circular dependency in the tool we got from timesys. To be able to build the cpio in the kernel image I need to build the modules first, which require the kernel to be built, which needs the mudels... So I've opted for a single file with multiple images built into it. But I'm having a hard time finding any decent documentation with this.
I've noticed that the kernel load address is the same as the ramdisk which I'm not sure if this is a problem. I do have both images separate, but I'm not entirely sure where to load cpio image separate. It seems like that could be easier since then I could just use bootm {kerneladdress} {cpioaddress} ?
## Booting kernel from Legacy Image at 80800000 ...
Image Name: Linux-3.0.35
Image Type: ARM Linux Multi-File Image (uncompressed)
Data Size: 61927702 Bytes = 59.1 MiB
Load Address: 80008000
Entry Point: 80008000
Contents:
Image 0: 3581868 Bytes = 3.4 MiB
Image 1: 58345822 Bytes = 55.6 MiB
Verifying Checksum ... OK
## Loading init Ramdisk from multi component Legacy Image at 80800000 ...
## Flattened Device Tree from multi component Image at 80800000
Loading Multi-File Image ... OK
The kernel arguments I used I pulled from the only example of the multi image I could find.
] Kernel command line: console=ttymxc1,115200 consoleblank=0 root=/dev/ram0 rw initrd=80800000 rootfstype=cpio
...
[ 1.152419] Unpacking initramfs...
[ 1.155854] Initramfs unpacking failed: junk in compressed archive
[ 1.173722] Freeing initrd memory: 56980K
...
I'm not sure if i needed this but I added some config options to my kernel
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
I found some mistakes apparently, someone mentioned i don't really need more than the console arguments.
console=ttymxc1,115200 consoleblank=0
and if i do use them rootfstype=ramfs
Also I didn't have the ram disk block driver enabled in the kernel.
[ | 1.203461] Trying to unpack rootfs image as initramfs... |
[ | 1.209196] rootfs image is not initramfs (junk in compressed archive); looks like an initrd |
[ | 1.229656] Freeing initrd memory: 3080K |
66] RAMDISK: Couldn't find valid RAM disk image starting at 0.
I also removed most of the user space libraries out, its more reasonable at 6.9 mb. Just enough to use busy box, and custom modules.
I believe so, there wasn't any real reason why most of my options didn't work. I ended up basically with an uncompressed cpio image since none of the compression was working, the multipart image I couldn't get working at all so I just loaded the cpio image separately.
Due to the build system, the initramfs which had the least issues I couldn't use because of dependancies on some kernel modules and another oddity in which the order of the build seemed wrong.