Yocto build tips - yocto

When I build yocto, there are some files that has larges size and they take me a lot of time to dowload.
I tried placing them in sources/ but doing this is otiose. My question: Is there any way to pass checksum mechanism of yocto?
Thankyou so much for any helping!

The checksum in Yocto is used to make sure that downloaded files are not corrupted or tampered with.
Instead of trying to bypass the checksum mechanism, you can try using a download accelerator or mirror to download the files more quickly.
You can also use a cache server to store the downloaded files, so you
don't have to download them again in the future.
If you need to re-download a file that was partially downloaded or
corrupted, you can use the bitbake command with the -f flag to force
a download.

Related

Extracting particular executable from Yocto build files

I have a project that could be built with the Yocto build system to generate a full disk image. According to the existing procedure, I can get only a full disk image that should be flashed on SD card.
And this does not suit my needs because I can't flash the image on the board. In my case, I need to build a certain project (that currently has a recipe) to an executable. (This project currently is a part of the full disk that is built with Yocto)
So I am wondering, is it possible to extract this executable (and the libraries that this executable depends on) from Yocto build files, so that I could copy and install it on the board? Which possibilities do I have to do this? Do I have some quick and dirty way to do this?
P.S: I heard something about that Yocto can provide a package for a certain project, that could be installed by the corresponding package manager on the board. On the board installed dpkg package manager.
It's a solution to add tar.gz to your IMAGE_FSTYPE.
After building the image, you can extract the executable you were looking for from the created archive.
Or you add the output format you need for your target and install the full image.

How to Build an RPM from Source in One Line without Spec Files etc?

I've been reading about building RPMs, and the process is quite complex. Is there any program/software that works like this:
Download tar.gz file. Extract to directory
cd into directory
Run
RPM file is output into the directory
Does any such program exist? It seems as if it should. After all, when I run make, make install etc, I don't need to specify spec files, provide locations for where the software has to be installed. So why should I have to do all that for creating RPMs?
I've tried using checkinstall, but I keep getting errors like "Directory not found: /root/rpmbuild/BUILDROOT/hello-2.10-1.x86_64/usr"
So is there an easier way?
No. There is no easier way.
Sometimes upstream provide 'make rpm' target. Sometime checkinstall works. But often you have to create the spec file manually.
BTW that error from checkinstall reveals two things:
you are running that command as root. That is very very unwise.
you should create few build directories. Run command rpmdev-setuptree it will create them for you.

How to bitbake clean altera-image-minimal?

I am a beginner to Yocto Linux and having trouble with clean up rootfs filesystem in the build image folder using
bitbake -c clean altera-image-minimal altera-gsrd-image
I did successful with
bitbake -c clean virtual/kernel virtual/bootloader
to remove kernel and uboot generated files from "~/Build1/tmp/deploy/images", but not the filesystem. I tried with -f to force clean the generated filesystem but it doesn't seem like doing anything. If anyone have experienced similar issue, can you help share your solution?
Thank you!
If by clean up you mean remove the rootfs and what it generates then just delete the ~/Build1/tmp folder.
The next time you compile, do not need to worry since you have files stored in SSTATE_CACHE and download to speed up the process.
bitbake -c clean will only clean the stuff in /build/tmp/work/ folders. This is used when you want to recompile something again.

Modifying core-image-minimal to only make rootfs

I am working on an embedded project on Zedboard. I would like (at least for now) to use Bitbake only to produce proper rootfs. I use recipe core-image-minimal, as I need only limited amount of staff there. How can I "tell" it to not compile kernel, not make u-boot, etc. and focus on rootfs only?
Here is what I've done so far:
Created my build environment
Downloaded needed layers
Modified local.conf to add needed packages to rootfs
Then after typing
bitbake core-image-minimal
I get my rootfs, and all this unnecessary staff. How can I avoid it?
I recently had the same need to only build the rootfs with yocto, skipping other things such as kernel, uboot, image creation etc. There are many legitimate reasons to do so. Anyways, this is what you have to do:
bitbake core-image-minimal -c image_cpio
in krogoth, this will populate the rootfs directory in build/tmp/work/$MACHINE/core-image-minimal/1.0-r0/ and create a rootfs.cpio file in build/tmp/deploy/images/$MACHINE/
in morty, the rootfs.cpio archives seem to be in build/tmp/work/$MACHINE/core-image-minimal/1.0-r0/deploy-core-image-minimal-image-complete/
Interesting concept. However, from what I observed, Yocto must get the defconfig in kernel and u-boot to do configuration on the image itself. Therefore, removing the process will make rootfs not bootable.
These happened for me a lot of time since I used different kernels to compile for different machines. I thought that the ARM image will be the same and will work for all machine but I was wrong.
For Debian, the image compiled need to use kernel's corresponding configuration to compile the rootfs for it to work. And Yocto is the same.
bitbake -e |grep IMAGE_FSTYPE
will give you something like:
IMAGE_FSTYPES="tar.gz cpio cpio.gz.u-boot ...."
it's a list of all the image that will be generated, to remove the undesired ones, in the local.conf file use:
IMAGE_FSTYPES_remove = " cpio cpio.gz.u-boot"
the space before the first element it's not optional.
Regards
If you don't want to build a kernel set the preferred provider of virtual/kernel to 'linux-dummy'.

how to compile emacs 22.3

I've recently made a Slax instalation with only the core program.
I used a copy of the live CD and ran a script to make hda1 bootable and then another script to use lilo to boot it... they were all in the CD... So it's like a big live cd on my HD and not really a full fledged OS.
Anyway I want to begin by compiling my own Emacs... Can someone help me?
thanks
The process shouldn't be too complicated. First, you need to download the source from http://ftp.gnu.org/pub/gnu/emacs/
Then, you untar the source with
tar xzf emacs-22.3.tar.gz
and cd into the newly created directory (emacs-22.3)
There, you run:
./configure
and then
make && make install
Read the INSTALL file for more information.
To compile emacs 22.3, first download http://ftp.gnu.org/pub/gnu/emacs/emacs-22.3.tar.gz . Extract the files to a directory, and then follow the instructions in the INSTALL file to install.
If you're asking about how to compile it on a read-only filesystem:
If you have lots of RAM, you can mount a ram disk.
If you have a harddisk, you can mount the extra space.
You can look at something like fuse for more ideas.