[meta-xilinx] rootfs on ram
Jean-Francois Dagenais
jeff.dagenais at gmail.com
Mon Sep 16 08:37:51 PDT 2019
Hi Jek,
> On Sep 16, 2019, at 11:15, Jek F. <jek.fessia at gmail.com> wrote:
>
> Hi everyone, i propose again the question i desccribed to you at the beginning of the summer because I haven't been able to solve it yet.
> Sorry if i'm boring, but this is a very important topic to me.
>
>
> I'm using a microzed, and i need to create an image that mount rootf on ram.
> I tried to follow the yocto manual for initramfs (https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#building-an-initramfs-image), but at bitbake it returns this error:
>
> ERROR: Nothing PROVIDES 'core-image-minimal-initramfs'
> core-image-minimal-initramfs was skipped: incompatible with host arm-poky-linux-gnueabi (not in COMPATIBLE_HOST)
> core-image-minimal-initramfs was skipped: incompatible with host arm-poky-linux-gnueabi (not in COMPATIBLE_HOST)
>
> Any suggestion?
Indeed, the last lines of core-image-minimal-initramfs.bb are:
# Use the same restriction as initramfs-live-install
COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
You would need to why they put that there... My hunch is that loading an initrd image is very bootload specific. So you can remove them, or override the line with a bbappend. You will be missing some glue to make it work though.
On zynqmp, one can use u-boot to load the initrd.
I have this in my machine.conf:
INITRAMFS_FSTYPES = "cpio.gz.u-boot"
Then in my image classes that make the initrd rootfs, I have:
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
(The image recipes use INITRAMFS_FSTYPES to not include knowledge of the bootloader/machine underneath. This is just good practice, so you can do whatever you want for your recipes.)
But then this will make the .cpio.gz.u-boot file. If you want an image which you can dd on, say, an SD card, you need another image for this, one which doesn't really make a rootfs, a relevant one anyway, but is bundled in the end with the WIC framework with the initrd.cpio.gz.u-boot file included. Your WKS file can just mention the boot part, no second rootfs.
I have this in my other image:
INITRD_IMAGE = "the-initrd-rootfs-recipe"
IMAGE_FSTYPES = "wic.lz4"
Just specifying wic.lz4 is not enough, you need to specify the kickstart file to use:
WKS_FILES = "my-bootonly.wks"
I personally specify this to all my images by using an IMAGE_CLASSES in my machine.conf:
IMAGE_CLASSES += "my-image-wic"
This is "my-image-wic.bbclass":
WKS_FILES ?= "my-bootonly.wks"
WIC_CREATE_EXTRA_ARGS = " --no-fstab-update"
do_image_wic[depends] += "\
xilinx-bootbin:do_deploy \
e2fsprogs-native:do_populate_sysroot \
"
python () {
initRdImage = d.getVar("INITRD_IMAGE")
if initRdImage:
d.appendVarFlag("do_image_wic", "depends", " " + initRdImage + ":do_image_complete")
}
IMAGE_CMD_wic_append() {
cd ${DEPLOY_DIR_IMAGE}
ln -sfv ${IMAGE_LINK_NAME}.wic.lz4 ${IMAGE_LINK_NAME}.sdcard.lz4
}
here's my-bootonly.wks (1 line only):
part /boot --source bootimg-partition --fstype=vfat --label boot --active --align 4096 --extra-space 10
The "bootimg-partition" wic plugin mentioned above expects variable IMAGE_BOOT_FILES to be set. Usually, this is defined in the machine.conf:
IMAGE_BOOT_FILES = "\
BOOT-${MACHINE}.bin;boot.bin \
Image \
${MACHINE}.dtb \
uEnv.txt.example \
${INITRD_IMAGE}.cpio.gz.u-boot;initrd.cpio.gz.u-boot \
"
Then you need to make your u-boot configuration find a load as initrd a file named initrd.cpio.gz.u-boot...
This should get you going. I may be doing way more manually than is required. I had developed this a while back and it's been working fine for us since.
Cheers!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2287 bytes
Desc: not available
URL: <http://lists.yoctoproject.org/pipermail/meta-xilinx/attachments/20190916/5422ac49/attachment.bin>
More information about the meta-xilinx
mailing list