[OE-core] [RFC 1/2] os-release: add new operating system identification recipe

Martin Jansa martin.jansa at gmail.com
Fri Dec 13 15:08:26 UTC 2013


On Fri, Dec 13, 2013 at 07:56:37AM -0700, Christopher Larson wrote:
> From: Christopher Larson <chris_larson at mentor.com>
> 
> This is needed by systemd, among other useful applications. All fields are
> metadata driven, and initial values come from our DISTRO variables.
> 
> Signed-off-by: Christopher Larson <kergoth at gmail.com>
> ---
>  meta/recipes-core/os-release/os-release.bb | 42 ++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100644 meta/recipes-core/os-release/os-release.bb
> 
> diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb
> new file mode 100644
> index 0000000..0f67597
> --- /dev/null
> +++ b/meta/recipes-core/os-release/os-release.bb
> @@ -0,0 +1,42 @@
> +inherit allarch
> +
> +SUMMARY = "Operating system identification"
> +DESCRIPTION = "The /etc/os-release file contains operating system identification data."
> +LICENSE = "MIT"
> +INHIBIT_DEFAULT_DEPS = "1"
> +
> +do_fetch[noexec] = "1"
> +do_unpack[noexec] = "1"
> +do_patch[noexec] = "1"
> +do_configure[noexec] = "1"
> +
> +# Other valid fields: BUILD_ID ANSI_COLOR CPE_NAME HOME_URL SUPPORT_URL BUG_REPORT_URL
> +OS_RELEASE_FIELDS = "ID ID_LIKE NAME VERSION VERSION_ID PRETTY_NAME"
> +
> +export ID = "${DISTRO}"
> +export NAME = "${DISTRO_NAME}"
> +export VERSION = "${DISTRO_VERSION}${@' (%s)' % DISTRO_CODENAME if 'DISTRO_CODENAME' in d else ''}"
> +export VERSION_ID = "${DISTRO_VERSION}"
> +export PRETTY_NAME = "${DISTRO_NAME} ${VERSION}"
> +
> +export BUILD_ID ?= "${DATETIME}"
> +export ID_LIKE
> +export ANSI_COLOR
> +export CPE_NAME
> +export HOME_URL
> +export SUPPORT_URL
> +export BUG_REPORT_URL
> +
> +do_compile () {
> +    for field in ${OS_RELEASE_FIELDS}; do
> +        if eval "test -n \"\$$field\""; then
> +            eval "printf \"%s=%s\n\" \"\$field\" \"\$$field\""
> +        fi
> +    done >os-release
> +}
> +do_compile[vardeps] += "${OS_RELEASE_FIELDS}"

Isn't this dependency picked automatically?

> +do_install () {
> +    install -d ${D}${sysconfdir}
> +    install -m 0644 os-release ${D}${sysconfdir}/
> +}
> -- 
> 1.8.3.4
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20131213/3abe054e/attachment-0002.sig>


More information about the Openembedded-core mailing list