Remove the package alsa from the Yocto Build - yocto

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.

Related

rpmbuild unable to find the custom installed package

There are plenty of perl packages missing in Centos 8 and Rocky Linux. So, I try to get the rpm spec by cpanspec and build rpm by myself. But, it seems like that rpmbuild could not find the rpm I built.
This is the script for me to build rpm.
cd /root/rpmbuild
cpanspec --packer 'Example <example#example.com>' <Perl-Package-Name>
mkdir SOURCES
cp <Perl-Package-Name>.tar.gz SOURCES
rpmbuild -ba perl-<Package-Name>.spec
Let's say we have two package A and B. A is needed by B.
I try to build both of the packages through the script above. I build A first, switch into /root/rpmbuild/RPMS/noarch and install A.rpm. Then, I try to build package B.
I got
error: Failed build dependencies:
perl(A) is needed by perl-<B>
I try to check the existence of package A.
yum list installed | grep A
and
perldoc -l A
Both of the commands show that A exists.
Did I miss something?
update 2022/06/07
I just gave up and commented the BuildRequires: A in B package. This is not a good approach but it works.

rpm tool can't be used in yocto enviroment

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

Download all dependencies recursively from a rpm file

I know that I can retrieve all dependencies recursively using yumdownloader --downloadonly. But is there a way that I can do it by passing the an rpm file instead of the package name? like yum install ./google-chrome-stable_current_x86_64.rpm --downloadonly --downloaddir=xx with some option to download dependencies of chrome's dependencies.
Why dont you pull the NEVRA from the RPM file and pass it to yumdownloader
yumdownloader --resolve $(rpm -qp ./<RPMPACKAGE>.rpm --queryformat="%{nevra}")

CentOS 7 - how to install dependency using wget in an RPM spec file

I'm trying to write a spec RPM file to build an RPM package.
Here is in essence my spec file:
[...]
Requires: nodejs java-1.8.0-openjdk java-1.8.0-openjdk-devel log4j
%define _rpmdir ../
%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
%define _unpackaged_files_terminate_build 0
%pre
[Some script]
%post
[Some script]
%preun
[Some script]
%postun
[Some script]
%install
[...]
%files
[...]
I've managed to install the package dependencies with the preamble Requires expect one that doesn't exist as a yum package (tomcat8). I found on the internet that the way to install it on centOS is:
wget https://harbottle.gitlab.io/harbottle-main/7/x86_64/00853071-tomcat8/tomcat8-8.5.37-2.el7.harbottle.x86_64.rpm
rpm -ivh tomcat8-8.5.37-2.el7.harbottle.x86_64.rpm
But where should I put it in the spec file? I tried to put it in the %pre script, but there is a lock on rpm that prevent its use. I tried to put it in the %install part, but it didn't seem right. Can you please help me to fix this problem? Is there a way to still put it in the Requires preamble?
Thanks!
this is not the way you should manage those dependencies. You should search for a way to make this rpm available in you repositories. I see multiple options:
add the harbottle repository:yum-config-manager --add-repo https://harbottle.gitlab.io/harbottle-main/7/x86_64/. Now your yum will be able to find the tomcat8 rpm by itself
If you want to make sure the package remains available; better copy the tomcat8.rpm inside your own repository besides your other rpms.

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.