<div dir="ltr">Hello to all,<br><br>I have my own YOCTO recipe how I do the initramfs.<br><br>Usually, some of these are missing in kernel .config file:<br><br>CONFIG_BLK_DEV_INITRD=y<br>CONFIG_RD_GZIP=y<br>CONFIG_RD_BZIP2=y<br>CONFIG_RD_LZMA=y<br>CONFIG_RD_XZ=y<br>CONFIG_RD_LZO=y<br>CONFIG_RD_LZ4=y<br><br>Please, check (they should be on) the CONFIG_DECOMPRESS_* options and if not, please, turn them on.<br><br>To do this, please, for YOCTO use the following (to reconfigure kernel .config):<br>bitbake -c menuconfig virtual/kernel<br><br>Also, in the local.conf I have the following set:<br><br>DISTRO_FEATURES_append = " ram"<br>IMAGE_FSTYPES_append = " cpio.xz"<br><br>Then I do: bitbake -k core-image-minimal, and from:<br>.../build/tmp/tmp/deploy/images/<platform_name> <br><br>Take my <initramfs_name>.cpio.xz as initramfs. Also, I take accordingly zImage and .dtb files as well.<br><br>I prepend to initramfs.cpio.xz u-boot header:<br>mkimage -n 'Ramdisk Image'Â -A arm -O linux -T ramdisk -C gzip -d initramfs.cpio.xz initramfs.cpio.xz.uboot<br><br>And then write tiny U-Boot ash script to tftp (from host) all three files to the target platform.<br><br>Works like a charm!<br><br>Zoran<br>_______<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 4, 2018 at 8:57 PM, Ferry Toth <span dir="ltr"><<a href="mailto:ftoth@telfort.nl" target="_blank">ftoth@telfort.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Tim Hammer wrote:<br>
<br>
> Can anyone point me to a step-by-step tutorial or simple how-to on<br>
> creating and using an initramfs with my kernel for ARM aarch64?<br>
> <br>
> <br>
> I have tried creating my own:<br>
>Â - <a href="http://boot-image.bb" rel="noreferrer" target="_blank">boot-image.bb</a> file with IMAGE_FSTYPES = "cpio.gz".<br>
>Â - local.conf has INITRAMFS_IMAGE_BUNDLE = "1"<br>
>Â - linux.bbappend has INITRAMFS_IMAGE = "boot-image"<br>
> <br>
> This all seems to be "correct" to the extent that bitbake linux tries to<br>
> do the right thing.<br>
> <br>
> However, I get a failure in do_bundle_initramfs- "mv: cannot stat<br>
> 'arch/arm64/boot/Image': No such file or directory".<br>
> <br>
> To the best of my (limited) debugging abilities with Yocto, it seems like<br>
> the kernel image backup has already been run when it gets to this point<br>
> and the Image file in that directory has already been moved to Image.bak.<br>
> If I comment out the mv statement in kernel.bbclass causing the failure,<br>
> the process continues, but the initramfs does not seem to get populated or<br>
> perhaps installed into my kernel image as I get kernel panics that I have<br>
> been unable to get past.<br>
> <br>
> <br>
> I decided to take a different approach and try using the<br>
> core-image-minimal-initramfs recipe as INITRAMFS_IMAGE. By commenting out<br>
> the COMPATIBLE_HOST entry I am able to build a kernel for ARM aarch64. I<br>
> can even seem to boot into this initramfs- it counts down waiting for<br>
> removable media; seems to find my primary rootfs on sda3, but there is no<br>
> rootfs.img file there so says it is dropping to a shell (although I never<br>
> get a prompt...).<br>
<br>
</div></div>We have taken this approach here <br>
<a href="https://github.com/edison-fw/meta-intel-edison/tree/master/meta-intel-edison-distro/recipes-core" rel="noreferrer" target="_blank">https://github.com/edison-fw/<wbr>meta-intel-edison/tree/master/<wbr>meta-intel-edison-distro/<wbr>recipes-core</a><br>
<br>
There are 2 images, the rootfs and the initramfs. And we overload the init-live.sh <br>
to load certain kernel modules and acpi-tables then switchroot to the rootfs.<br>
<span class="im HOEnZb"><br>
> Thinking I could start with that recipe and work to get rid of the live<br>
> stuff and just get to a busybox prompt before trying to run my unique init<br>
> commands, I copied <a href="http://core-image-minimal-initramfs.bb" rel="noreferrer" target="_blank">core-image-minimal-initramfs.<wbr>bb</a> to my-<br>
> <a href="http://core-image-minimal-initramfs.bb" rel="noreferrer" target="_blank">core-image-minimal-initramfs.<wbr>bb</a> in my layer and changed INITRAMFS_IMAGE to<br>
> "my- core-image-minimal-initramfs".<br>
> However, I obviously missed something in the configuration as I get an<br>
> error in go_bundle_initramfs again:<br>
>Â Â Â kernel-source/scripts/gen_<wbr>initramfs_list.sh:<br>
>Â Â Â Â Â Â Â Â Â Cannot open<br>
> '/.../linux-qoriq/4.14-r0/<wbr>build/usr/my-core-image-<wbr>minimal-initramfs-{machine}.<wbr>cpio'<br>
> <br>
> Any help would be greatly appreciated.<br>
> Thank you!<br>
<br>
<br>
-- <br>
</span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
yocto mailing list<br>
<a href="mailto:yocto@yoctoproject.org">yocto@yoctoproject.org</a><br>
<a href="https://lists.yoctoproject.org/listinfo/yocto" rel="noreferrer" target="_blank">https://lists.yoctoproject.<wbr>org/listinfo/yocto</a><br>
</div></div></blockquote></div><br></div>