Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ URI: git://git.openembedded.org/openembedded-core
branch: master
revision: HEAD

CVE checking
------------

The layer no longer ships a CVE filter class: OE-Core dropped the
cve-check class it relied on. Use OE-Core's SBOM-based checker instead,
which reads the image SPDX and writes VEX-aware reports to the deploy
directory:

bitbake-config-build enable-fragment core/yocto/sbom-cve-check

or, in local.conf:

OE_FRAGMENTS += "core/yocto/sbom-cve-check"

Contributing
------------

Expand Down
109 changes: 0 additions & 109 deletions classes/cve-filter.bbclass

This file was deleted.

23 changes: 0 additions & 23 deletions classes/mirrors.bbclass

This file was deleted.

32 changes: 0 additions & 32 deletions classes/restore-dumped-headrevs.bbclass

This file was deleted.

19 changes: 4 additions & 15 deletions conf/distro/include/oel.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,12 @@ TARGET_VENDOR = "-oel"

SDKMACHINE ?= "x86_64"

# Paths
OELDIR ?= "${COREBASE}/.."

SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}"
SDKPATHINSTALL = "/opt/${DISTRO}/${SDK_VERSION}"

# Move the persist db up out of TMPDIR so it survives its removal
PERSISTENT_DIR = "${TOPDIR}/db"

# Restore any available saved headrevs
DUMP_HEADREVS_DB ?= '${OELDIR}/${MACHINE}/saved_persist_data.db'
INHERIT += "restore-dumped-headrevs"

# Share the hashserv DB across builds using the same SSTATE_DIR. Weakest
# assignment so a local.conf/site.conf ?= still wins.
BB_HASHSERVE_DB_DIR ??= "${SSTATE_DIR}"
Expand Down Expand Up @@ -76,11 +69,10 @@ INIT_MANAGER ?= "systemd"

DISTRO_EXTRA_RDEPENDS += "${OEL_DEFAULT_EXTRA_RDEPENDS}"

DISTRO_FEATURES_OPTED_OUT ?= " \
acl alsa bluetooth debuginfod ext2 \
wifi xattr nfs zeroconf pci 3g nfc x11 vfat seccomp pulseaudio \
gobject-introspection-data ldconfig opengl ptest multiarch wayland vulkan \
"
# Opt in to OE-Core's default features explicitly instead of opting out of
# the rest: a feature OE-Core later adds to its defaults stays off in oel
# until it is listed here.
DISTRO_FEATURES_DEFAULTS ?= "ipv4 ipv6"

# Exclude DATE from DISTRO/SDK_VERSION checksums
DISTRO_VERSION[vardepsexclude] = "DATE"
Expand Down Expand Up @@ -140,9 +132,6 @@ DISTRO_EXTRA_RRECOMMENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd',
#### Workarounds & Overrides
####

# Work around missing vardep bug in bitbake
sstate_stage_all[vardeps] += "sstate_stage_dirs"

# Layer name and path for the recipe
RECIPE_LAYERNAME = "${@bb.utils.get_file_layer('${FILE}', d) or 'UNKNOWN'}"
RECIPE_LAYERDIR = "${LAYERDIR_${RECIPE_LAYERNAME}}"
Expand Down
9 changes: 7 additions & 2 deletions conf/distro/oel-tiny.conf
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ DISTRO_FEATURES = " \
${DISTRO_FEATURES_WIFI} \
"

DISTRO_FEATURES:class-native = "${DISTRO_FEATURES_DEFAULTS} ${OEL_DEFAULT_DISTRO_FEATURES}"
DISTRO_FEATURES:class-nativesdk = "${DISTRO_FEATURES_DEFAULTS} ${OEL_DEFAULT_DISTRO_FEATURES}"
# Native and nativesdk recipes take only the DISTRO_FEATURES_FILTER_NATIVE{,SDK}
# features from here (debuginfod opengl wayland), on top of
# DISTRO_FEATURES_NATIVE{,SDK}. Keep the ones OE-Core enables by default, as
# oel's DISTRO_FEATURES_DEFAULTS no longer carries them.
DISTRO_FEATURES_TINY_NATIVE = "debuginfod opengl wayland ${OEL_DEFAULT_DISTRO_FEATURES}"
DISTRO_FEATURES:class-native = "${DISTRO_FEATURES_TINY_NATIVE}"
DISTRO_FEATURES:class-nativesdk = "${DISTRO_FEATURES_TINY_NATIVE}"

# Use tmpdevfs and the busybox runtime services
VIRTUAL-RUNTIME_dev_manager = ""
Expand Down
2 changes: 0 additions & 2 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ BBFILE_PATTERN_ossystems-base := "^${LAYERDIR}/"
BBFILE_PRIORITY_ossystems-base = "8"
LAYERDEPENDS_ossystems-base = "core"

addpylib ${LAYERDIR}/lib ossystems

LAYERSERIES_COMPAT_ossystems-base = "blacksail"

LICENSE_PATH += "${LAYERDIR}/conf/licenses"
Expand Down
56 changes: 56 additions & 0 deletions lib/oeqa/runtime/cases/ossystems_easysplash.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#
# Copyright (C) 2026 O.S. Systems Software LTDA.
#
# SPDX-License-Identifier: MIT
#

from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.data import skipIfNotFeature
from oeqa.runtime.decorator.package import OEHasPackage

RUNDIR = '/tmp/oeqa-easysplash'


class EasySplashTest(OERuntimeTestCase):
"""easysplash: units installed and the open/client protocol works headless."""

def run_ok(self, cmd, timeout=None):
status, output = self.target.run(cmd, timeout=timeout)
self.assertEqual(status, 0, msg='%s\n%s' % (cmd, output))
return output

@OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['easysplash'])
@skipIfNotFeature('systemd', 'Test requires systemd in DISTRO_FEATURES')
def test_easysplash_units(self):
for unit in ('easysplash-start.service', 'easysplash-quit.service'):
self.assertEqual(self.run_ok('systemctl is-enabled %s' % unit).strip(), 'enabled')

@OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['easysplash'])
def test_easysplash_open_stop(self):
"""Play the installed animation into fakesink, then stop it as a client."""
status, _ = self.target.run('test -e /usr/lib/easysplash/animation/animation.toml')
if status != 0:
self.skipTest('no animation installed')
try:
self.run_ok('rm -rf %s && mkdir -p %s' % (RUNDIR, RUNDIR))
self.run_ok("(easysplash open --video-sink fakesink --runtime-dir %s/run "
"--log debug /usr/lib/easysplash/animation > %s/log 2>&1; "
"echo $? > %s/rc) > /dev/null 2>&1 &" % (RUNDIR, RUNDIR, RUNDIR))

# The server binds its socket only after the animation was loaded.
status, output = self.target.run(
'for i in $(seq 1 60); do [ -S %s/run/ipc.socket ] && break; '
'[ -e %s/rc ] && break; sleep 1; done; cat %s/log'
% (RUNDIR, RUNDIR, RUNDIR), timeout=90)
self.assertNotEqual(self.target.run('test -e %s/rc' % RUNDIR)[0], 0,
msg='easysplash exited before being stopped:\n%s' % output)

self.run_ok('easysplash client --stop --runtime-dir %s/run' % RUNDIR)
output = self.run_ok('for i in $(seq 1 60); do [ -e %s/rc ] && break; sleep 1; done; '
'cat %s/log; cat %s/rc' % (RUNDIR, RUNDIR, RUNDIR), timeout=90)
self.assertEqual(output.splitlines()[-1].strip(), '0', msg=output)
finally:
self.target.run('killall easysplash 2>/dev/null; rm -rf %s' % RUNDIR)
80 changes: 80 additions & 0 deletions lib/oeqa/runtime/cases/ossystems_factory_defaults.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#
# Copyright (C) 2026 O.S. Systems Software LTDA.
#
# SPDX-License-Identifier: MIT
#

from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.data import skipIfNotFeature
from oeqa.runtime.decorator.package import OEHasPackage


class FactoryDefaultsTest(OERuntimeTestCase):
"""ossystems-factory-defaults: restore /data from the factory copy once."""

@classmethod
def setUpClass(cls):
td = cls.td
cls.runtime_dir = td.get('OSSYSTEMS_FACTORY_DEFAULTS_RUNTIME_DIR') or '/data'
cls.factory_dir = td.get('OSSYSTEMS_FACTORY_DEFAULTS_DIR') or '/usr/share/factory-defaults'
cls.hooks_dir = td.get('OSSYSTEMS_FACTORY_DEFAULTS_HOOKS_DIR') or '/etc/factory-defaults.d'
cls.anchor = cls.runtime_dir + '/.factory-defaults'
if 'systemd' in td.get('DISTRO_FEATURES', '').split():
cls.program = '/usr/bin/factory-defaults'
else:
cls.program = '/etc/init.d/factory-defaults'

def run_ok(self, cmd):
status, output = self.target.run(cmd)
self.assertEqual(status, 0, msg='%s\n%s' % (cmd, output))
return output

@OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['ossystems-factory-defaults'])
def test_factory_defaults_ran_at_boot(self):
status, output = self.target.run('test -e %s' % self.anchor)
self.assertEqual(status, 0,
msg='%s missing: factory-defaults did not complete at boot' % self.anchor)

@OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['ossystems-factory-defaults'])
@skipIfNotFeature('systemd', 'Test requires systemd in DISTRO_FEATURES')
def test_factory_defaults_unit(self):
unit = 'ossystems-factory-defaults.service'
self.assertEqual(self.run_ok('systemctl is-enabled %s' % unit).strip(), 'enabled')
output = self.run_ok('systemctl show -p Result -p ExecMainStatus %s' % unit)
props = dict(l.split('=', 1) for l in output.splitlines() if '=' in l)
self.assertEqual(props.get('Result'), 'success', msg=output)
self.assertEqual(props.get('ExecMainStatus'), '0', msg=output)

@OETestDepends(['ossystems_factory_defaults.FactoryDefaultsTest.test_factory_defaults_ran_at_boot'])
def test_factory_defaults_restore(self):
"""Removing the anchor restores the factory files and runs the hooks, once."""
probe = 'oeqa-factory-probe'
hook = self.hooks_dir + '/zz-oeqa'
marker = '/tmp/oeqa-factory-hook-ran'
setup = ' && '.join([
'mkdir -p %s %s' % (self.factory_dir, self.hooks_dir),
'echo factory > %s/%s' % (self.factory_dir, probe),
'printf "#!/bin/sh\\ntouch %s\\n" > %s' % (marker, hook),
'chmod 0755 %s' % hook,
'rm -f %s %s %s/%s' % (self.anchor, marker, self.runtime_dir, probe),
])
cleanup = 'rm -f %s %s %s/%s %s/%s; touch %s' % (
hook, marker, self.factory_dir, probe, self.runtime_dir, probe, self.anchor)
try:
self.run_ok(setup)
self.run_ok(self.program)
self.assertEqual(self.run_ok('cat %s/%s' % (self.runtime_dir, probe)).strip(), 'factory')
self.run_ok('test -e %s' % marker)
self.run_ok('test -e %s' % self.anchor)

# With the anchor in place a second run must leave /data alone.
self.run_ok('rm -f %s && echo changed > %s/%s' % (marker, self.runtime_dir, probe))
self.run_ok(self.program)
self.assertEqual(self.run_ok('cat %s/%s' % (self.runtime_dir, probe)).strip(), 'changed')
status, _ = self.target.run('test -e %s' % marker)
self.assertNotEqual(status, 0, msg='hooks ran again although the anchor exists')
finally:
self.target.run(cleanup)
Loading
Loading