Zermingore
Zermingore

Reputation: 753

How to remove opkg from a Yocto image

Using Poky (v. 13.0 - Yocto 1.8), I am trying to build the core-image-minimal but excluding the opkg package.

In the generated rootfs, I still have a /usr/lib/opkg/ populated folder.

I tried to play with the following in my build/conf/local.conf

DISTRO_FEATURES_remove += " package-management"
IMAGE_FEATURES_remove += " package-management"
EXTRA_IMAGE_FEATURES_remove += " package-management opkg"
IMAGE_INSTALL_remove += " package-management opkg"

POKY_DEFAULT_EXTRA_RRECOMMENDS = ""

I saw that in meta-yocto/conf/distro/poky-tiny.conf there is the following, which I tried to add (still in my local.conf without success)

PACKAGECONFIG_pn-opkg-utils = ""

Upvotes: 1

Views: 4039

Answers (1)

Anders
Anders

Reputation: 8981

Well, if you ensure that IMAGE_FEATURES doesn't contain package-management, that should be enough. (Unless you manually install eg opkg).

Have you looked at /usr/lib/opkg? In my image, that directory only contains alternatives, which in turns holds information about alternative versions of installed applications. See eg update-alternatives.

Do you have any other files or directories under /usr/lib/opkg?

============== Update ============== These files are not really needed, unless you want/need to run update-alternatives. This could also be run if you do package based updates. However, on a read-only rootfs, these shouldn't be needed.

Something like this could be used if you want /usr/lib/opkg to be removed:

remove_alternative_files () {
    rm -rf ${IMAGE_ROOTFS}/usr/lib/opkg
}

ROOTFS_POSTPROCESS_COMMAND += "remove_alternative_files;"

This can be added either directly in your recipe, or if you have a custom image-class.

Upvotes: 3

Related Questions