initramfs is isn't trying to mount the actual rootfs and is not doing switch_root #kernel #yocto
I am using the kirkstone yocto build to build a firmware image that has a kernel with initramfs, and a ext4 root file system on an emmc partition.
After booting up the kernel doesn't mount the device passed to the kernel as the "root=" parameter and doesn't switch_root, it just mounts everything to ram.
In my initramfs image recipe I have set:
PACKAGE_INSTALL = "util-linux udev busybox base-passwd ${VIRTUAL-RUNTIME_base-utils} ${VIRTUAL-RUNTIME_dev_manager} ${ROOTFS_BOOTSTRAP_INSTALL}"
and I was under the impression that the ${ROOTFS_BOOTSTRAP_INSTALL} should handle the switch_root portion of the boot after the initramfs loads, but that is not happening.
Is there a different package I need to add to the PACKAGE_INSTALL to allow the real root partition to be mounted, and switch_root to occur?
Quoted 9 lines · greymattr via lists.yoctoproject.org
I am using the kirkstone yocto build to build a firmware image that has a kernel with initramfs, and a ext4 root file system on an emmc partition. After booting up the kernel doesn't mount the device passed to the kernel as the "root=" parameter and doesn't
switch_root, it just mounts everything to ram.In my initramfs image recipe I have set:
PACKAGE_INSTALL= "util-linux udev busybox base-passwd ${VIRTUAL-RUNTIME_base-utils} ${VIRTUAL-RUNTIME_dev_manager} ${ROOTFS_BOOTSTRAP_INSTALL}"and I was under the impression that the ${ROOTFS_BOOTSTRAP_INSTALL} should handle the
switch_rootportion of the boot after the initramfs loads, but that is not happening. Is there a different package I need to add to thePACKAGE_INSTALLto allow the real root partition to be mounted, andswitch_rootto occur?
$ bitbake-getvar -r core-image-minimal —value ROOTFS_BOOTSTRAP_INSTALL ROOTFS_BOOTSTRAP_INSTALL="run-postinsts”
ROOTFS_BOOTSTRAP_INSTALL is the list of recipes that also need to be installed to handle rootfs stuff, so typically it’s either empty or includes run-postinsts to run any postinstall scripts that couldn’t be ran on the build host.
The initramfs-framework recipes have various pieces of the typical initramfs setup in (scan for devices, mount, pivot, etc) and these are used in core-image-minimal-initramfs. I actually recently added to master a slimmer image which _just_ finds and pivots:
https://git.yoctoproject.org/poky/tree/meta/recipes-core/images/core-image-initramfs-boot.bb
Ross