How to flash Yocto Images directly using clonezilla - linux

We are using meta-intel layer to generate .hddimg.
We can flash the generated .hddimg using Bootable Thumb Drive, but using this mechanism in manufacturing is not a good solution.
We need some way to flash the Yocto Image using clonezilla, hddimg is not recognized by clonezilla.
Do we need to add any IMAGE_FSTYPES to make it work. Or is there any other solutions to flash Yocto Images over PXE Boot
Thanks for your time and patience

IMAGE_FSTYPES just sets the build output image extension. With the IMAGE_FSTYPES variable, you can get partitioned image or unpartitoned image separetly.
Also you can create a recipe then, you can generate a new partitioned image according to the your needs but, As I know clonezilla can handle the raw images("dd") and yocto can able to generate raw images. I use the raw image most of the time and clonezilla can handle the raw images.

Related

Zynq, Yocto Linux and Custom FPGA IP Block Workflow

I'm new to the Zynq devices and also to linux and the Yocto project.
I now have a project where I need to implement a custom FPGA IP block and use it from a yocto generated linux distribution.
Obviously I will have to write the linux drivers for that custom IP. But I'm not able to find a clear explanation how the workflow for such a project may look like.
I found some old tutorials but I'm not sure if they are still the way to go, so an up-to-date best practice workflow would be great.
What I did so far:
I created a test project in Vivado and created a small led example by passing through the FPGA block in a Microzed + carrier board.
Then I exported the HW from Vivado to get a BSP package I tested in a bare metal project with Vitis.
I installed Yocto and I build a reference distro for my microzed board with just a serial interface by following a tutorial online.All this comes more or less pre-backed from Xilinx.
But now I need to use a Yocto generated linux distro and enable it to use my custom (LED) IP.
My questions:
How does a detailed workflow in this case look like (at the end I
need a bootable SD card)?
More in detail:
How can I bring the mydevice_bsp generated from Vivado into the Yocto distro?
In which environment(how to write them i'll find out my self) do I write the
drivers for the yocto Linux and bring them into the distro?
How do I load the bitstream into the FPGA fabric when the Linux image has booted up?
Unfortunately I do not have to much time to get all this working, so it would be really cool to find a step by step tutorial from the start to the end.
Thanks in advance for your help.
Regards
Martin
I´m not sure if someone has written down a workflow for this, but I can tell you how I would handle it.
Create your IP code as hardware and use the IP packager to pack the code. You can also add some driver code too, so the SDK can use this to automatic generate the drivers. So you can use the regular workflow in Vitis to write your software.
Or you skip this part and use the hardware direct in your Linux. So you will create an IP core and add him to your system in Vivado. Export the hardware to get your BSP file. Then you need the Xilinx Device Tree Generator to generate your device tree. This tool uses some basic definitions (like the base adress) of your IP core to generate the device tree part for your hardware.
Then you create a normal bitstream and a bunch of tools to create your bootloader, kernel, device tree, bitstream file, etc. (all without Yocto). Copy all files to a SD card and boot up your device. You can take a look at my Linux project and the Wiki when you need some help. Now you can begin to write the driver for your device and test him on your real hardware. At last you can create a Yocto recipe to automatic include your driver to the kernel with KConfig.
After booting Linux you find a device /dev/devcfg which can be used to reprogram the FPGA. Please note that changing the FPGA with impact on the processing system (i. e. you add some interfaces to your PS) will cause in some errors (maybe that bug is gone over the last years, but I have to issue this problem a few years ago).
So according to your LED example you have to do the following steps:
Create the IP core
Create a basic processing system and add the IP core
Generate the bitstream
Export the hardware to Vitis
Open Vitis and create a new FSBL project
Add the Device Tree Generator to the Vitis repositories
Create a new device tree project
Build BOOT.bin, uImage, devicetree.dtb and copy them to your SD card
Boot your device
Check /proc/device-tree/ for your device
Begin with the driver development
Export your driver to Kconfig and Yocto (or use him as a loadable module)
You can find all the steps in my Wiki. Feel free to ask me.
But please note: The tutorial isn´t that new and unfortunately I don´t add a custom IP integration to that tutorial (maybe I will add it soon) but it should show you the way how you can do it.

How to build a linux for Intel galileo gen 2?

There're some files, provided by intel. It is set of linux images for Intel galileo. I tryed to build one of them with help of this thing, but it doesn't work, because image doesn't consist .bb file which is the target file for bitbake. Could you explain how to build one of those images? I need it to boot this on galileo.
A simple google search of "galileo gen 2 yocto" brought up many guides of how to build a Yocto image for what you are asking for.

Creating Installable ISO for mSATA harddisk

Am trying to build small OS using buildroot & able to generate iso hybrid image to boot from USB. Generated iso image is working fine as live CD but not able to install it inside hard disk (like regular OS image).
I have tried to modify /init but need more guidance for doing so. Any help here will be much appreciated.
To install on a hard disk, you want a regular root filesystem + kernel. Select:
BR2_LINUX_KERNEL_INSTALL_TARGET "Install kernel image to /boot in target" to make the kernel part of the rootfs.
grub2 as the bootloader;
ext4 as the root filesystem;
host-genimage to create a partitioned hard disk image
You also need to supply:
a grub.cfg to configure grub;
a post-build script to copy the grub.cfg to the right place;
a genimage.cfg to configure the hard disk image.
Look at configs/pc_x86_64_efi_defconfig for inspiration. You might even be able to use it directly.

How to create and deploy a customized embedded linux image

I have a customized Linux filesystem with some binaries and new folders in the root file system. This Linux filesystem is created for small board computer.
Currently, I compress the root folder of the customized filesystem to a tar.gz file. With this tar.gz file I can share it to my friends. Then this file have to be extracted to their SD card. With this method they can also update a libraries or binary for testing.
However, this mechanism (creating and deploying) takes a lot of time.
My questions are:
1. How can I improve the creating and deploying customized linux image?
2. If I see the linux distributions, they use .iso or .img format. What is the reason using .iso or .img instead of tar.gz or zip file?
Thanks.
You have two steps to speed up:
Create an image that is shareable with your friends
Deploy the image on the board to test it
1. Step
Automate as much as you can. You could even set up a Jenkins server which should be able to automate anything that looks like a repetitive job. (compiling, compressing, uploading or sending the image to friends)
Compress your image using all your cores. AFAIK gzip does only use one core. pigz should compress/decompress faster
2. Step: Run your rootfs from an NFS.
This is the real time saver because you don't need to copy your rootfs to a sdcard anymore:
If your bootloader supports it, use nfs/tftp boot. Your board then boots directly from a network mount instead of a sdcard. I dont know which bootloader you use, but u-boot supports it, and others probably do as well.
it depends from what exactly need to be updated. If this is entire filesystem that is always changing - then just distribute the compressed img (by xz for example). if this is some small part of the system - just use the package manager, i.e. extract this part to package, next create this new package using the standard distro tools and distribute only it.
So if your SD card image has the fixed size - you can use rsync/xdelta to distribute only changes, but their efficiency depends from the exact changes percentage.

Adding drivers to already built CE 6.0 image

Is this possible? I am using a CE image from a manufacturer that won't release a custom image with an extra driver I need.
Give me some good news!
Yes, there is a possibility that you can add your driver over an existing image. You just need to place your driver dll(s) in the required folder (generally Windows folder) in your device where you want it to be and make some registry entries for it. If you already have a .reg file for the driver then you just need to import it on your device.
You can also make a CAB file to avoid the manual work.
It depends. You need to have permanent registry and storage. If you have, then you can configure registry entries to load your driver (at boot or when is detected by USB, SD, PCI etc.) and store it on the device. In some cases drivers are loaded from the image before any storage is mounted and this may prevent you from being able to load your driver at boot (or having your device detected if it's plugged in at boot).

Resources