KJ L
KJ L

Reputation: 175

About yocto /etc/os-release versioning

i try to implement /etc/os-release in my beaglebone yocto after some attempt in my google. i added following in my configuration files

local.conf

INHERIT += "image-buildinfo"

BUILD_ID = "${@time.strftime('%Y-%m-%d %H:%M:%S',time.localtime())}"

IMAGE_BUILDINFO_VARS = "DISTRO DISTRO_VERSION MACHINE IMAGE_NAME USER"

in os-release.bb

INHERIT += "image-buildinfo"

BUILD_ID = "${@time.strftime('%Y-%m-%d %H:%M:%S',time.localtime())}"

IMAGE_BUILDINFO_VARS = "DISTRO DISTRO_VERSION MACHINE IMAGE_NAME USER"

I was expecting /etc/os-release or /usr/lib/os-release build successfully upon bitbake run completely , but i don't see both of them in my images.

Am i missing anything?or i misinterpret on any concept? Sorry for the rookies question, i am trying to exploring yocto

Upvotes: 2

Views: 5178

Answers (3)

Pankaj Joshi
Pankaj Joshi

Reputation: 11

You can add it by following method CORE_IMAGE_EXTRA_INSTALL += "os-release lsb-release"

Upvotes: 1

amonthedeamon
amonthedeamon

Reputation: 346

INHERIT += "image-buildinfo" generates a /etc/build file and not /etc/os-release that you're looking for

See this official section of mega-manual

Upvotes: 3

vermaete
vermaete

Reputation: 1373

Could it be you still have to tell Yocto to use the os-release recipe?

With a os-release.bbappend you can modify the recipe that is part of openembedded-core. There are a few examples how to do at that webpage. A good one is e.g. the one used in meta-yoe.

But all this is just telling Yocto how to build the recipe. You still have to tell Yocto to add it to your image.
This can be done in the local.conf file or e.g. the recipes-images/images/your-image.bb file or in a packagegroup. The first solution is the quick and dirty one.

Upvotes: 3

Related Questions