Hi,
I have problems to get an initramfs work which should be bundled to the kernel via INITRAMFS_IMAGE_BUNDLE.
I switched to "zeus" as yocto version to be able to work with .wic files. I have an i.MX8mm evalboard where I boot Linux from SD card.
That's why I configured the build with: DISTRO=fsl-imx-wayland MACHINE=imx8mmevk source imx-setup-release.sh -b build which results to the following variables in local.conf:
MACHINE ??= 'imx8mmevk'
DISTRO ?= 'fsl-imx-wayland'
The rest is as it comes by default.
What did I do?:
- First, I added the following lines to my yocto/build/conf/local.conf of yocto:
INITRAMFS_IMAGE = "core-image-tiny-initramfs"
INITRAMFS_IMAGE_BUNDLE = "1"
VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
- Second, for a fast trial, I also changed a line in yocto/sources/poky/meta/recipes-core/images/core-image-tiny-initramfs.bb to add aarch64 support:
COMPATIBLE_HOST = "(i.86|x86_64|aarch64).*-linux"
- and I commented out a line in yocto/sources/meta-imx/meta-bsp/conf/layer.conf this way:
#IMAGE_CLASSES += "image_types_create_sdcard_symlink"
- Now I was able to build the whole thing with bitbake core-image-minimal without errors. I think, the resulting key files in yocto/build/tmp/deploy/images/imx8mmevk are the following, and I also extracted the wic.bz2 already here:
core-image-minimal-imx8mmevk-[timestamp].rootfs.wic.bz2 42,3 MiB
core-image-minimal-imx8mmevk-[timestamp].rootfs.wic 271,2 MiB
core-image-tiny-initramfs.imx8mmevk-[timestamp].rootfs.cpio.gz 11,8 MiB
core-image-tiny-initramfs.imx8mmevk.cpio.gz (link to file above) - Next I wrote that .wic file to my SD card with dd (as described in the NXP docs).
- I plugged that SD card into my eval board, switched on and typed on u-boot command line this one:
setenv mmcroot /dev/ram0 rootwait rw
boot Now the Linux boots properly but hangs with: Waiting for root device /dev/ram0...
- When I keep the mmcroot in u-boot to /dev/mmcblk1p2, Linux boots without problems! But in that case I cannot see it boots via initramfs. It uses the common rootfs of core-image-minimal.
It seems to me a core-image-minimal image without bundled initramfs image is just 200KB smaller. So I suspect the bundling does not properly work.
What goes wrong? What must be changed to let the Linux kernel use the bundled initramfs RAM filesystem??? Is there a problem with the scripts which bundle the initramfs to the wic file?
The actual thing I want to do is to setup my Linux with an overlayfs over the whole rootfs, and I can see core-image-tiny-initramfs is exactly doing that as it is configured so via its yocto/sources/poky/meta/recipes-core/initrdscripts/files/init-live.sh.
Thanx in advance for your help.