rpm tool can't be used in yocto enviroment - yocto

In local.conf, I can see:
PACKAGE_CLASSES ?= "package_rpm"
However, after boot the yocto OS, the rpm command not found.

PACKAGE_CLASSES specifies the package manager the OpenEmbedded build system uses when packaging data. This will not add rpm package to your image.
To have rpm package to your image, add EXTRA_IMAGE_FEATURES += "package-management" to your conf/local.conf

Related

Installing a kernel module in rootfs in yocto build system

I have a out of tree kernel module(hello.ko) from a vendor which i need to install in rootfs using yocto build. The kernel module is built on the same kernel which yocto build system is using.
I do not have the kernel source for the above module so i cannot build it using recipe.
How can i only install the kernel module in rootfs and to which path it will be installed.
Can anyone share a recipe for this.
I am new to yocto and recently started using it.
Inputs will be helpful.
Loadable kernel module are located in /lib/modules/<kernel_version>/kernel/drivers/
You can create a recipe and add your pre-compiled kernel module in files/lib/modules/<kernel_version>/kernel/drivers/
Then, add the line MODULE_NAME = "hello" to the module_autoload list. This is an example :
#Recipe for hello.ko
SUMMARY = "Hello world"
LICENSE = "closed"
SRC_URI = "file://hello.ko"
S="${WORKDIR}"
do_install()
{
install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers
install -m 0644 ${WORKDIR}/hello.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/
}
FILES_${PN} += "/lib/modules/${KERNEL_VERSION}/kernel/drivers/hello.ko"
MODULE_NAME = "hello"
module_autoload = "${MODULE_NAME}"

Remove the package alsa from the Yocto Build

My requirement -- was to Remove the package alsa from the Yocto Build. So
I just tried to Remove the ALSA Packages from the Yocto Build.
I followed same procedure as you stated 
MACHINE_FEATURES_remove = "alsa" on your machine.conf
poky.conf, used DISTRO_FEATURES_remove = "alsa". 
But it removed some of the alsa packages in rootfs looks good, these alsa-lib, alsa-conf still exists in the tmp/deploy/licenses/machine/licence.manifest file
Can any one suggest me the way to Remove that from Yocto Build.
As #ah008a said, you could check the dependencies for your image such as core-image-sato with cmd bitbake -g core-image-sato. Then check the file task-depends.dot.
The other way is to check the dependency by starting the image. Append following to local.conf:
EXTRA_IMAGE_FEATURES += "package-management"
then build and start the image. Check alsa related packages and try to remove them:
root#qemumips:~# rpm -qa | grep alsa |xargs rpm -e --test
error: Failed dependencies:
alsa-ucm-conf is needed by (installed) libasound2-1.2.8-r0.mips32r2
alsa-conf is needed by (installed) libasound2-1.2.8-r0.mips32r2
pulseaudio-module-alsa-card is needed by (installed) pulseaudio-server-16.1-r0.mips32r2
pulseaudio-module-alsa-sink is needed by (installed) pulseaudio-server-16.1-r0.mips32r2
pulseaudio-module-alsa-source is needed by (installed) pulseaudio-server-16.1-r0.mips32r2
alsa-plugins-pulseaudio-conf is needed by (installed) pulseaudio-server-16.1-r0.mips32r2
Then try to remove the dependencies recursively such as:
root#qemumips:~# rpm -e --test libasound2
Finally find that
pulseaudio-server is needed by (installed) packagegroup-core-x11-sato-base-1.0-r33.qemumips
Check the recipe meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb and distro feature pulseaudio should be removed too. So set in local.conf:
MACHINE_FEATURES:remove = 'alsa'
DISTRO_FEATURES:remove = 'alsa pulseaudio'
Then there is no alsa related packages installed to the image core-image-sato.

How install Nuget Microsoft.ML.OnnxRuntime.Gpu for ONNX Runtime in Ubuntu 18?

I'm trying to use ONNX runtime for Ubuntu: https://onnxruntime.ai/
I selected Linux, C++, x64, then CUDA. It says "Install Nuget package Microsoft.ML.OnnxRuntime.Gpu
Refer to docs for requirements."
When I click on "Microsoft.ML.OnnxRuntime.Gpu", I'm taken to https://www.nuget.org/packages/Microsoft.ML.OnnxRuntime.Gpu
There, it just says "Install-Package Microsoft.ML.OnnxRuntime.Gpu -Version 1.8.1". Now what am I supposed to do?
They expect you to install nuget in linux with
sudo apt-get install -y nuget
And then run the following with the version you want installed.
nuget install Microsoft.ML.OnnxRuntime.Gpu -Version 1.12.0
That's the expected approach. Personally, for me that didn't work. I kept getting some error saying "'Microsoft.ML.OnnxRuntime.Managed' already has a dependency defined for 'System.Memory'." So I did it a different way. I just went to https://github.com/microsoft/onnxruntime/releases/tag/v1.12.0. And then at the bottom under assets it lists pre-built .tgz packages for the different setups. You can just download one and unpack it.

Python3-glob and Python3-shutil Missing in Bitbake

Using openembedded-core Morty branch:
For whatever reason, python 2 has these package but when attempting to run:
bitbake python3-glob
and
bitbake python3-shutil
These packages are not available. When installing just python3 as part of a project they are missing as well.
However, another "standard package" (not sure if this is an accurate statement but this comes included in python3 on debian) subprocess can be installed by adding python3-subprocess as a dependency.
Is glob and shutil part of some larger python3 standard packages recipe?
Found it:
the openembedded-core Python3 recipe comes with a file called python-3.5-manifest. This file outlines different sub-recipes of python3.
glob and shutil are available by building python3-shell.
It appears for these to show up in an image they must be added to IMAGE_INSTALL in your image recipe.

How do I specify dependancies from a custom repository for Linux Deb archives

I'm using install4j V 5.0.9 and I make a Linux Deb media file. How can I specify a repository for other dependencies that aren't in the default repository of ubuntu ?
The objectif is to add java for dependencies, not openjdk but sun-jdk. The sun jdk is in an other repository (deb http://archive.canonical.com/ lucid partner).
RPM and DEB media files in install4j do not support dependencies at this time.