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

Commit 7e5be19

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. 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 7e5be19

3 files changed

Lines changed: 37 additions & 2 deletions

File tree

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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ 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.
67+
REFKIT_DEFAULT_DISTRO_FEATURES += "stateless"
68+
6169
# Remove currently unsupported distro features from global defaults
6270
REFKIT_DEFAULT_DISTRO_FEATURES_REMOVE += "x11 3g"
6371

meta-refkit/conf/distro/refkit.conf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,34 @@ 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+
78+
# Base stateless support.
7779
require conf/distro/include/stateless.inc
7880

81+
# Turns build settings in /etc into image settings under /usr,
82+
# without non-upstream patches.
83+
require conf/distro/include/stateless-usr.inc
84+
85+
# NOT used because it depends on non-upstream patches.
86+
# Without this, creating local users conflicts with updating system
87+
# users as part of a system update. Would be very nice to have.
88+
# require conf/distro/include/stateless-nss-altfiles.inc
89+
90+
# NOT used because it depends on non-upstream patches.
91+
# Enables login without some files in /etc. Not so important.
92+
# require conf/distro/include/stateless-login.inc
93+
94+
# NOT used because it depends on non-upstream patches.
95+
# Makes it possible to modify nsswitch.conf without
96+
# conflicting with system settings. Not particularly
97+
# important.
98+
# require conf/distro/include/stateless-nsswitch.inc
99+
100+
# Not used because it renders the /etc handling in OSTree
101+
# and swupd useless: once /etc is populated, it remains
102+
# unchanged even when system defaults change.
103+
# require conf/distro/include/stateless-factory.inc
104+
79105
# Include *and* enabled refkit configuration. Including
80106
# just refkit-config.inc would not enable the configuration
81107
# changes.

0 commit comments

Comments
 (0)