Skip to contentSkip to conversation

Initramfs with OpenSBI for a RISCV SoC

DISCUSSION [email protected] 2 participants 5 messages Apr 12, 2021 – Apr 16, 2021

lore
Share & tools
lore
#0 lore raw

Hi,

i pulled openembedded-core, meta-openembedded, meta-riscv layers
In build/local/auto.conf, added INITRAMFS_IMAGE = "core-image-minimal-initramfs" and INITRAMFS_IMAGE_BUNDLE = "1" I created core-image-minimal-initramfs.bbappend with adding riscv to COMPATIBLE_HOST

trying to build with "bitbake riscv-initramfs-image"

(without adding INITRAMFS_IMAGE in build/local/auto.conf, able to get successfully the kernel Image files, dtbs, riscv-initramfs-image-mach1-???????.rootfs.cpio.gz, except initramfs is NOT bundled along with the kernel Image which i want)

getting the following circular dependency error

Identifying dependency loops (this may take a short while)...

ERROR:
Dependency loop #1 found:
Task /media/meta-mach1/recipes-kernel/linux/linux-mainline_5.11.bb:do_bundle_initramfs (dependent Tasks ['linux-mainline_5.11.bb:do_install', 'core-image-minimal-initramfs.bb:do_image_complete'])
Task /media/meta-mach1/recipes-kernel/linux/linux-mainline_5.11.bb:do_deploy (dependent Tasks ['linux-mainline_5.11.bb:do_bundle_initramfs', 'pigz_2.6.bb:do_populate_sysroot', 'linux-mainline_5.11.bb:do_packagedata', 'depmodwrapper-cross_1.0.bb:do_populate_sysroot', 'linux-mainline_5.11.bb:do_populate_sysroot']) Task /media/openembedded-core/meta/recipes-bsp/opensbi/opensbi_0.9.bb:do_compile (dependent Tasks ['linux-mainline_5.11.bb:do_deploy', 'opensbi_0.9.bb:do_configure'])
Task /media/openembedded-core/meta/recipes-bsp/opensbi/opensbi_0.9.bb:do_install (dependent Tasks ['opensbi_0.9.bb:do_compile', 'pseudo_git.bb:do_populate_sysroot'])
Task /media/openembedded-core/meta/recipes-bsp/opensbi/opensbi_0.9.bb:do_populate_sysroot (dependent Tasks ['opensbi_0.9.bb:do_install', 'binutils-cross_2.36.bb:do_populate_sysroot'])
Task /media/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_image_complete (dependent Tasks ['opensbi_0.9.bb:do_populate_sysroot', 'core-image-minimal-initramfs.bb:do_image_cpio', 'core-image-minimal-initramfs.bb:do_image'])

ERROR: Command execution failed: 1

Please suggest

#1 lore raw
Quoted 11 lines · sathishmls via lists.openembedded.org

Hi,

i pulled openembedded-core, meta-openembedded, meta-riscv layers
In build/local/auto.conf, added INITRAMFS_IMAGE = "core-image-minimal-initramfs" and INITRAMFS_IMAGE_BUNDLE = "1" I created core-image-minimal-initramfs.bbappend with adding riscv to COMPATIBLE_HOST

trying to build with "bitbake riscv-initramfs-image"

(without adding INITRAMFS_IMAGE in build/local/auto.conf, able to get successfully the kernel Image files, dtbs, riscv-initramfs-image-mach1-???????.rootfs.cpio.gz, except initramfs is NOT bundled along with the kernel Image which i want)

you can try to build just the kernel which should build the initramfs image too or build any other image than 'core-image-minimal-initramfs.

bitbake core-image-minimal

e.g.

Quoted 19 lines

getting the following circular dependency error

Identifying dependency loops (this may take a short while)...

ERROR:
Dependency loop #1 found:
Task /media/meta-mach1/recipes-kernel/linux/linux-mainline_5.11.bb:do_bundle_initramfs (dependent Tasks ['linux-mainline_5.11.bb:do_install', 'core-image-minimal-initramfs.bb:do_image_complete'])
Task /media/meta-mach1/recipes-kernel/linux/linux-mainline_5.11.bb:do_deploy (dependent Tasks ['linux-mainline_5.11.bb:do_bundle_initramfs', 'pigz_2.6.bb:do_populate_sysroot', 'linux-mainline_5.11.bb:do_packagedata', 'depmodwrapper-cross_1.0.bb:do_populate_sysroot', 'linux-mainline_5.11.bb:do_populate_sysroot']) Task /media/openembedded-core/meta/recipes-bsp/opensbi/opensbi_0.9.bb:do_compile (dependent Tasks ['linux-mainline_5.11.bb:do_deploy', 'opensbi_0.9.bb:do_configure'])
Task /media/openembedded-core/meta/recipes-bsp/opensbi/opensbi_0.9.bb:do_install (dependent Tasks ['opensbi_0.9.bb:do_compile', 'pseudo_git.bb:do_populate_sysroot'])
Task /media/openembedded-core/meta/recipes-bsp/opensbi/opensbi_0.9.bb:do_populate_sysroot (dependent Tasks ['opensbi_0.9.bb:do_install', 'binutils-cross_2.36.bb:do_populate_sysroot'])
Task /media/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_image_complete (dependent Tasks ['opensbi_0.9.bb:do_populate_sysroot', 'core-image-minimal-initramfs.bb:do_image_cpio', 'core-image-minimal-initramfs.bb:do_image'])

ERROR: Command execution failed: 1

Please suggest

#2 lore raw

I found the issue.
The issue was that i have added "opensbi" using EXTRA_IMAGEDEPENDS through conf/machine/<machine>.conf file and that has made "opensbi" as dependency for initramfs image also. This has created the circular dependency.

I added a EXTRA_IMAGEDEPENDS = "" to the core-image-minimal-initramfs.bb

This fixed the circular dependency issue.

#3 lore raw
Quoted 8 lines · sathishmls via lists.openembedded.org

I found the issue.
The issue was that i have added "opensbi" using EXTRA_IMAGEDEPENDS through conf/machine/<machine>.conf file and that has made "opensbi" as dependency for initramfs image also. This has created the circular dependency.

I added a EXTRA_IMAGEDEPENDS = "" to the core-image-minimal-initramfs.bb

This fixed the circular dependency issue.

good, I think this could be a patch for core-image-minimal-initramfs.bb that you can submit to oe-core ml. Since we use opensbi in qemu machines its highly likely to be copied into BSPs
would you mind submitting such a patch?

Quoted 2 lines