Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 916ca81

Browse files
committed
refkit: activate minimal "stateless" changes
This enables the "stateless" distro feature and the "stateless" image for all refkit-image.bbclass images. However, only the changes that do no require upstream source code patching get enabled. For example, systemd configuration gets moved from /etc entirely into /usr. This is a choice we make for the "refkit" distro. "refkit-config.inc" merely activates the base stateless support, without any of the .inc files which actually cause changes. Advanced changes like allowing local user management separately from the system users are not enabled because they depend on patches. Enabling those changes would increase the risk that building IoT Refkit breaks when OE-core gets updated, and at this point it is not certain whether that is a risk worth taking. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
1 parent 07b12fc commit 916ca81

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

meta-refkit-core/classes/refkit-image.bbclass

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ IMAGE_FEATURES[validitems] += " \
8080
# building without swupd), or by defining additional bundles via
8181
# SWUPD_BUNDLES.
8282
IMAGE_FEATURES += " \
83-
${@bb.utils.contains('DISTRO_FEATURES', 'ima', 'ima', '', d)} \
84-
${@bb.utils.contains('DISTRO_FEATURES', 'smack', 'smack', '', d)} \
83+
${@ bb.utils.filter('DISTRO_FEATURES', 'ima', d) } \
84+
${@ bb.utils.filter('DISTRO_FEATURES', 'smack', d) } \
85+
${@ bb.utils.filter('DISTRO_FEATURES', 'stateless', d) } \
8586
${@ 'muted' if (d.getVar('IMAGE_MODE') or 'production') == 'production' else 'autologin' } \
8687
${REFKIT_IMAGE_EXTRA_FEATURES} \
8788
"

meta-refkit-core/conf/distro/include/refkit-config.inc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ REFKIT_DEFAULT_DISTRO_FEATURES += "refkit-config"
5858
# Enable OSTree system update support.
5959
REFKIT_DEFAULT_DISTRO_FEATURES += "ostree"
6060

61+
# Reconfigure and/or patch some recipes to support "stateless" images
62+
# better (stateless = configuration in /etc can be created locally or
63+
# isn't needed at all). Note that the actual changes are defined by
64+
# the stateless*.inc files included by a distro config like
65+
# refkit.conf, i.e. merely including refkit-config.inc does not
66+
# have much effect even when "stateless" is enabled as distro feature.
67+
REFKIT_DEFAULT_DISTRO_FEATURES += "stateless"
68+
require conf/distro/include/stateless.inc
69+
6170
# Remove currently unsupported distro features from global defaults
6271
REFKIT_DEFAULT_DISTRO_FEATURES_REMOVE += "x11 3g"
6372

meta-refkit/conf/distro/refkit.conf

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,30 @@ DISTRO_EXTRA_RRECOMMENDS += " ${REFKIT_DEFAULT_EXTRA_RRECOMMENDS}"
7474
# Distro settings potentially shared with other distros.
7575
require conf/distro/include/no-static-libs.inc
7676
require conf/distro/include/refkit_security_flags.inc
77-
require conf/distro/include/stateless.inc
77+
78+
# Turns build settings in /etc into image settings under /usr,
79+
# without non-upstream patches.
80+
require conf/distro/include/stateless-usr.inc
81+
82+
# NOT used because it depends on non-upstream patches.
83+
# Without this, creating local users conflicts with updating system
84+
# users as part of a system update. Would be very nice to have.
85+
# require conf/distro/include/stateless-nss-altfiles.inc
86+
87+
# NOT used because it depends on non-upstream patches.
88+
# Enables login without some files in /etc. Not so important.
89+
# require conf/distro/include/stateless-login.inc
90+
91+
# NOT used because it depends on non-upstream patches.
92+
# Makes it possible to modify nsswitch.conf without
93+
# conflicting with system settings. Not particularly
94+
# important.
95+
# require conf/distro/include/stateless-nsswitch.inc
96+
97+
# Not used because it renders the /etc handling in OSTree
98+
# and swupd useless: once /etc is populated, it remains
99+
# unchanged even when system defaults change.
100+
# require conf/distro/include/stateless-factory.inc
78101

79102
# Include *and* enabled refkit configuration. Including
80103
# just refkit-config.inc would not enable the configuration

0 commit comments

Comments
 (0)