Re: [yocto] How can I create a truly minimal distribution that runs entirely from RAM?
Thank you very much. I figured out that you can have Yocto create a suitable U-Boot wrapper as follows (from the image recipe): IMAGE_FSTYPES = "cpio.xz.u-boot" Now there is only one last issue that I wasn't able to solve yet: I would like Yocto to not only generate this U-Boot file but also add it to the boot partition of a wic.gz image. I tried to extend the image recipe as follows: IMAGE_FSTYPES = "cpio.xz.u-boot wic.gz" IMAGE_BOOT_FILES_append += "${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio.xz.u-boot" Unfortunately, there is a dependency issue here. BitBake schedules the do_image_wic task before the do_image_cpio task, which creates the u-boot file. I tried to fix it as follows (from the image recipe): do_image_wic[depends] = "my-image-recipe:do_image_cpio" While the dependency graph acknowledges this dependency, BitBake does not seem to care about it. Whatever I try, do_image_wic is always executed first and, obviously, does not succeed. I think the problem is comparable to the unsolved one outlined here: https://stackoverflow.com/questions/58954170/yocto-creating-a-dependency-for-wic-to-cpio-gz-image How can I instruct Yocto to execute do_image_cpio first? -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#52707): https://lists.yoctoproject.org/g/yocto/message/52707 Mute This Topic: https://lists.yoctoproject.org/mt/81241640/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [yocto] How can I create a truly minimal distribution that runs entirely from RAM?
Thank you very much for your help on the second issue! I was unaware of the fact that another mkimage call is necessary. After taking a look at the the references you provided, I was able to boot the system from an initramfs. However, my current approach requires two manual steps after running Yocto: I need to call mkimage on the cpio.xz file and to extend/configure the U-Boot environment in the running system. Is there a way to automate this? More specifically, is it possible to... * have Yocto generate an initramfs.cpio.xz.uboot file instead of just an initramfs.cpio.xz file and to * modify the default environment that Yocto will compile into the U-Boot binary? -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#52687): https://lists.yoctoproject.org/g/yocto/message/52687 Mute This Topic: https://lists.yoctoproject.org/mt/81241640/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[yocto] How can I create a truly minimal distribution that runs entirely from RAM?
Hello everyone, I am currently using this ( https://source.codeaurora.org/external/imx/imx-manifest/tree/imx-5.4.3-2.0.0.xml?h=imx-linux-zeus ) Yocto-based build setup provided by NXP to create a custom Linux distribution for one of the i.MX boards. My custom image is based on the core-image-minimal recipe and works fine, i.e., runs on the platform as expected. However, I have to following two issues: Although core-image-minimal is documented as "A small image just capable of allowing a device to boot", I can tell from the running system that it contains a huge number of components that I think are not be strictly necessary to boot the device. For instance, the boot log contains entries about an FPGA manager framework, Bluetooth, Ethernet, KVM, USB, and a lot of i.MX-specific modules such as for DMA or power management. For evaluation purposes, I want to get rid of all of these and end up with a *truly* minimal Linux system that is able to boot, schedule its tasks, and to communicate via UART. How can I achieve this without losing the i.MX support, i.e., the generation of a bootloader and suitable device tree files? Furthermore, I would like the minimal system to run entirely from RAM. More specifically: After being started from the SD card, U-Boot should start the Linux distribution via initramfs. I am able to generate some kind of initramfs binary using the following changes: # local.conf INITRAMFS_IMAGE = "recipe-name" INITRAMFS_IMAGE_BUNDLE = "1" # recipe-name.bb IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" PACKAGE_INSTALL = "${IMAGE_INSTALL}" However, this does not affect the generated U-Boot, which means that U-Boot still tries to boot from an SD card partition. What is the "right way" to make use of the Image-initramfs-board.bin or the image-board.cpio.gz files that Yocto creates in this case? Any help yould be greatly appreciated. Kind regards! -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#52656): https://lists.yoctoproject.org/g/yocto/message/52656 Mute This Topic: https://lists.yoctoproject.org/mt/81241640/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [yocto] How to develop kernel modules on the target?
Hello, The execution of "make scripts prepare" did actually solve the issue, thank you very much for your help! However, the need to manually execute this command on the target platform made me look into the kernel-devsrc recipe ( https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/linux/kernel-devsrc.bb?h=zeus ) to see if it is possible to let the build host execute this step. Some comments imply that this is the case. Consider, for instance, the one in line 257: > > Ensure we don't race against "make scripts" during cpio Unfortunately, I was unable to figure out how to do this. Is there a way to let the recipe trigger this step automatically? Thanks! -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#51843): https://lists.yoctoproject.org/g/yocto/message/51843 Mute This Topic: https://lists.yoctoproject.org/mt/79268891/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[yocto] How to develop kernel modules on the target?
Hello everyone, I am using the Yocto-based build system provided by NXP (primarily via the meta-freescale layer) to create Linux images for an i.MX 8M board and would like to develop small kernel modules without going through the build process of the entire image after each modification. Therefore, I would prefer to compile the kernel modules on the target architecture and have added the following items to the IMAGE_INSTALL variable via my local.conf: - packagegroup-core-buildessential - kernel-modules - kernel-dev - kernel-devsrc I then tried to follow the the official build instructions ( https://www.kernel.org/doc/html/latest/kbuild/modules.html ) on the target but was unable to create a kernel module: imx8mqevk:~# make -C /lib/modules/$(uname -r)/build M=$PWD make: Entering directory '/lib/modules/5.4.47-2.2.0+g5ec03d06f54e/build' CC [M] /root/hello.o In file included from ./include/linux/types.h:6, from ./include/linux/list.h:5, from ./include/linux/module.h:9, from /root/hello.c:1: ./include/uapi/linux/types.h:5:10: fatal error: asm/types.h: No such file or directory [...] compilation terminated. What am I missing here? Is there something else I have to do on the target before I can compile kernel modules on the target? For the sake of completeness: The build is based on the Zeus release and the following repo manifest file: https://source.codeaurora.org/external/imx/imx-manifest/tree/imx-5.4.47-2.2.0.xml?h=imx-linux-zeus Thanks! -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#51840): https://lists.yoctoproject.org/g/yocto/message/51840 Mute This Topic: https://lists.yoctoproject.org/mt/79268891/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-