All of lore.kernel.org
 help / color / mirror / Atom feed
* initramfs is isn't trying to mount the actual rootfs and is not doing switch_root #kernel #yocto
@ 2024-01-22 18:17 greymattr
  2024-01-23 10:46 ` [yocto] " Ross Burton
  0 siblings, 1 reply; 2+ messages in thread
From: greymattr @ 2024-01-22 18:17 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 819 bytes --]

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?

[-- Attachment #2: Type: text/html, Size: 1523 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [yocto] initramfs is isn't trying to mount the actual rootfs and is not doing switch_root #kernel #yocto
  2024-01-22 18:17 initramfs is isn't trying to mount the actual rootfs and is not doing switch_root #kernel #yocto greymattr
@ 2024-01-23 10:46 ` Ross Burton
  0 siblings, 0 replies; 2+ messages in thread
From: Ross Burton @ 2024-01-23 10:46 UTC (permalink / raw)
  To: Yocto-mailing-list, mfatheree

On 22 Jan 2024, at 18:17, greymattr via lists.yoctoproject.org <mfatheree=opto22.com@lists.yoctoproject.org> wrote:
> 
> 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?

$ 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-23 10:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22 18:17 initramfs is isn't trying to mount the actual rootfs and is not doing switch_root #kernel #yocto greymattr
2024-01-23 10:46 ` [yocto] " Ross Burton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.