This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from pohly/meta-swupd
meta-swupd
- Loading branch information
Showing
36 changed files
with
672 additions
and
967 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
346 changes: 254 additions & 92 deletions
346
...ostro/recipes-image/images/ostro-image.bb → meta-ostro/classes/ostro-image.bbclass
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# This code only runs in recipes which inherit update-alternatives.bbclass. | ||
# It manipulates the postinst scripts created by update-alternatives.bbclass | ||
# so that "update-alternatives --install" calls take | ||
# ${ALTERNATIVE_PRIORITY_<package name in upper case and with underscores>:-<def priority>} | ||
# as priority parameter, i.e. it becomes possible to override the default priority | ||
# set in the recipe at install time via env variables. | ||
def ostro_manipulate_postinst_alternatives(d): | ||
import re | ||
|
||
pn = d.getVar('BPN', True) | ||
suffix = (''.join([x if x.isalnum() else '_' for x in pn])).upper() | ||
replacements = set() | ||
def new_alt_priority(m): | ||
replacement = '${ALTERNATIVE_PRIORITY_%s:-%s}' % ( | ||
suffix, | ||
m.group(2), | ||
) | ||
if not replacement in replacements: | ||
bb.note('adding support for %s update-alternatives image variable' % replacement) | ||
replacements.add(replacement) | ||
return m.group(1) + replacement | ||
|
||
regex = re.compile(r'''(update-alternatives\s+--install\s+\S+\s+\S+\s+\S+\s+)(\S+)''') | ||
for pkg in (d.getVar('PACKAGES', True) or "").split(): | ||
postinst = d.getVar('pkg_postinst_%s' % pkg, True) | ||
if postinst: | ||
postinst = regex.sub(new_alt_priority, postinst) | ||
d.setVar('pkg_postinst_%s' % pkg, postinst) | ||
|
||
python populate_packages_updatealternatives_append () { | ||
ostro_manipulate_postinst_alternatives(d) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,52 @@ SDK_UPDATE_URL = "\ | |
${MACHINE}\ | ||
" | ||
|
||
# When building in a CI system with swupd enabled, OS_VERSION must be | ||
# set to a consistent value for all builds. See ostroproject-ci.inc | ||
# for an example how that works with Jenkins. | ||
# | ||
# In local builds, we only have ${DATETIME} as something that | ||
# increments automatically, but it is too large for an integer number | ||
# on 32 bit systems. Therefore we substract the 2016 as the initial | ||
# year in which Ostro OS started using swupd (assumes a 64 build host, | ||
# to avoid integer overflows in Python itself) and ignore the | ||
# seconds. | ||
# | ||
# The default behavior is to not rebuild just because OS_VERSION | ||
# changed. If that is desired, include in local.conf: | ||
# VERSION_ID = "${OS_VERSION}" | ||
# This will cause the os-release package to be rebuilt each time | ||
# OS_VERSION changes, and that in turn causes an image and bundle | ||
# rebuild. | ||
# | ||
# For more predictable results is possible to set OS_RELEASE manually, | ||
# either in local.conf or in the environment like this: | ||
# BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE OS_VERSION" OS_VERSION=110 bitbake ... | ||
OS_VERSION ?= "${@ str(((int('${DATETIME}') - 20160000000000) / 100) * 10) }" | ||
OS_VERSION[vardepsexclude] += "DATETIME" | ||
|
||
# Ostro OS tries to build minimal images and thus prefers Busybox or | ||
# Toybox over coreutils or any other package providing similar | ||
# functionality. For technical reasons, this is crucial when building | ||
# swupd bundles: Busybox/Toybox must be picked consistently, even when | ||
# a bundle pulls in alternatives like coreutils which normally would | ||
# have a higher priority. | ||
# | ||
# This gets achieved in two ways: | ||
# 1. via ostro-update-alternatives.bbclass we modify all packages | ||
# so that their update-alternatives priority can be modified | ||
# during install time | ||
# 2. in ostro-image.bbclass we reconfigure those priorities | ||
# as necessary | ||
# | ||
# This is still a change that is done consistently for all images, | ||
# whether they use swupd or not, to ensure that the result is | ||
# identical. Doing it at image creation time reduces the need | ||
# for recompilations of packages and opens up the possibility | ||
# for downstream developers to override the defaults while | ||
# reusing pre-compiled binaries from our sstate. | ||
INHERIT += "ostro-update-alternatives" | ||
|
||
MAINTAINER = "Ostro Dev <[email protected]>" | ||
|
||
TARGET_VENDOR = "-ostro" | ||
|
@@ -58,12 +104,24 @@ DISTRO_FEATURES_DEFAULT_remove = "x11 3g" | |
|
||
DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC} ${OSTRO_DEFAULT_DISTRO_FEATURES}" | ||
|
||
# Currently Ostro OS is still using swupd 2.x because that is what | ||
# has been tested with most. The newer 3.x will be tested right after | ||
# the initial swupd integration. | ||
PREFERRED_VERSION_swupd-client ?= "2.%" | ||
PREFERRED_VERSION_swupd-client-native ?= "2.%" | ||
PREFERRED_VERSION_swupd-server ?= "2.%" | ||
PREFERRED_VERSION_swupd-server-native ?= "2.%" | ||
|
||
# Use 4.4 kernel for meta-intel BSP MACHINEs | ||
# BeagleBone is still on 4.1 until meta-yocto-bsp switches it over | ||
PREFERRED_VERSION_linux-yocto_intel-corei7-64 ?= "4.4%" | ||
PREFERRED_VERSION_linux-yocto_intel-quark ?= "4.4%" | ||
PREFERRED_VERSION_linux-yocto_beaglebone ?= "4.1%" | ||
|
||
# Use UEFI-based "dsk" image format for machines supporting UEFI. | ||
# Defined here because it influences several different recipes. | ||
OSTRO_USE_DSK_IMAGES ?= "${@bb.utils.contains_any('MACHINE', 'intel-core2-32 intel-corei7-64 intel-quark', 'True', 'False', d)}" | ||
|
||
DISTRO_EXTRA_RDEPENDS += " ${OSTRO_DEFAULT_EXTRA_RDEPENDS}" | ||
DISTRO_EXTRA_RRECOMMENDS += " ${OSTRO_DEFAULT_EXTRA_RRECOMMENDS}" | ||
|
||
|
@@ -82,8 +140,6 @@ DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit" | |
require conf/distro/include/ostro_security_flags.inc | ||
require conf/distro/include/ostro-x11.inc | ||
|
||
OS_RELEASE_FIELDS_append = " BUILD_ID" | ||
|
||
# QA check settings - a little stricter than the OE-Core defaults | ||
WARN_TO_ERROR_QA = "already-stripped compile-host-path install-host-path \ | ||
installed-vs-shipped ldflags pn-overrides rpaths staticdev \ | ||
|
@@ -145,16 +201,24 @@ PNWHITELIST_meta-python += " \ | |
" | ||
PNWHITELIST_multimedia-layer += "" | ||
PNWHITELIST_networking-layer += " \ | ||
iftop \ | ||
lowpan-tools \ | ||
traceroute \ | ||
" | ||
PNWHITELIST_openembedded-layer += " \ | ||
gmock \ | ||
gtest \ | ||
libsocketcan \ | ||
atop \ | ||
can-utils \ | ||
dash \ | ||
giflib \ | ||
gmock \ | ||
gtest \ | ||
htop \ | ||
iotop \ | ||
krb5 \ | ||
libmicrohttpd \ | ||
libsocketcan \ | ||
pkcs11-helper \ | ||
vim \ | ||
" | ||
PNWHITELIST_perl-layer += "" | ||
PNWHITELIST_ruby-layer += "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# In Ostro OS We only put mostly static values into the os-release | ||
# package. That avoids unnecessary recompilations. Dynamic values | ||
# like DISTRO_VERSION (which in our case contain ${DATE}) and BUILD_ID | ||
# (includes ${DATETIME}) get patched to the current values in | ||
# ostro-image.bbclass. | ||
|
||
DISTRO_VERSION = "distro-version-to-be-added-during-image-creation" | ||
BUILD_ID = "build-id-to-be-added-during-image-creation" | ||
OS_RELEASE_FIELDS += "BUILD_ID" |
30 changes: 30 additions & 0 deletions
30
meta-ostro/recipes-core/packagegroups/packagegroup-tools-interactive.bb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
SUMMARY = "Tools expected in an interactive shell" | ||
DESCRIPTION = "Tools listed here are meant to be useful when logged into a device \ | ||
and working in the shell interactively or with some custom scripts. In production \ | ||
images without shell access they are optional. Tools with a specific purpose like \ | ||
development, profiling or program debugging are listed in separate package groups. \ | ||
" | ||
LICENSE = "MIT" | ||
|
||
inherit packagegroup | ||
|
||
RDEPENDS_${PN} = " \ | ||
atop \ | ||
curl \ | ||
gawk \ | ||
htop \ | ||
iftop \ | ||
iotop \ | ||
iputils-arping \ | ||
iputils-clockdiff \ | ||
iputils-ping \ | ||
iputils-ping6 \ | ||
iputils-tracepath \ | ||
iputils-tracepath6 \ | ||
iputils-traceroute6 \ | ||
procps \ | ||
rsync \ | ||
traceroute \ | ||
vim \ | ||
wget \ | ||
" |
Oops, something went wrong.