Skip to content

Commit

Permalink
Merge pull request commontorizon#38 from rborn-tx/TOR-3391
Browse files Browse the repository at this point in the history
Make /etc transient on the secure boot image
  • Loading branch information
jsrc27 authored Mar 8, 2024
2 parents 1c82b87 + ee5b76b commit 953aacb
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 85 deletions.
3 changes: 0 additions & 3 deletions classes/image_type_torizon.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ generate_diff_file () {
fi
}

# Enable composefs on the generated ostree repo (part of the Tezi image).
OSTREE_OTA_REPO_CONFIG:append:cfs-support = " ex-integrity.composefs:true"

IMAGE_DATETIME_FILES ??= " \
${sysconfdir}/issue \
${sysconfdir}/issue.net \
Expand Down
2 changes: 1 addition & 1 deletion conf/distro/include/torizon.inc
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,5 @@ PREFERRED_VERSION_libcurl ?= "${CURLVERSION}"
# would be the case on a secure-boot image. Otherwise, the older battle-tested
# version is selected.
OSTREEVERSION ?= "2021.6"
OSTREEVERSION:cfs-support ?= "2024.1"
OSTREEVERSION:cfs-support ?= "2024.4"
PREFERRED_VERSION_ostree ?= "${OSTREEVERSION}"
20 changes: 2 additions & 18 deletions recipes-core/initramfs-framework/initramfs-framework_1.0.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,7 @@ do_install:append() {
install -m 0755 ${WORKDIR}/kmod ${D}/init.d/01-kmod
}

# Configuration that goes into prepare-root.conf (see ostree-prepare-root manual):
# - PREP_ROOT_ETC_TRANSIENT: whether /etc is transient ("true" or "false")
# - PREP_ROOT_CFS_ENABLED: enabling of composefs ("yes", "no", "maybe" or "signed")
#
# TODO: Set PREP_ROOT_ETC_TRANSIENT to true; at the time of writing this wasn't
# working correctly: /etc does become transient but "ostree admin status" fails
# to detect the current deployment (this may have been solved on newer versions
# of ostree).
PREP_ROOT_ETC_TRANSIENT ?= "false"
PREP_ROOT_CFS_ENABLED ?= "maybe"
PREP_ROOT_CFS_ENABLED:cfs-signed ?= "signed"
require recipes-extended/ostree/ostree-prepare-root.inc

do_install:append:cfs-support() {
# Bundled into initramfs-module-kmod package:
Expand All @@ -72,13 +62,7 @@ do_install:append:cfs-support() {
install -m 0755 ${WORKDIR}/composefs ${D}/init.d/94-composefs
install -d ${D}${nonarch_libdir}/ostree/
install -m 0644 /dev/null ${D}${nonarch_libdir}/ostree/prepare-root.conf
cat >${D}${nonarch_libdir}/ostree/prepare-root.conf <<EOF
[etc]
transient = ${PREP_ROOT_ETC_TRANSIENT}

[composefs]
enabled = ${PREP_ROOT_CFS_ENABLED}
EOF
write_prepare_root_config ${D}${nonarch_libdir}/ostree/prepare-root.conf
}

# Adding modules so plymouth can show the splash screen during boot
Expand Down

This file was deleted.

21 changes: 21 additions & 0 deletions recipes-extended/ostree/ostree-prepare-root.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Configuration that goes into prepare-root.conf (see ostree-prepare-root manual):
#
# - PREP_ROOT_ETC_TRANSIENT: whether /etc is transient ("true" or "false")
# - PREP_ROOT_CFS_ENABLED: enabling of composefs ("yes", "no", "maybe" or "signed")
#
PREP_ROOT_ETC_TRANSIENT ?= "true"
PREP_ROOT_CFS_ENABLED ?= "no"
PREP_ROOT_CFS_ENABLED:cfs-support ?= "yes"
PREP_ROOT_CFS_ENABLED:cfs-signed ?= "signed"

write_prepare_root_config() {
local outfile="${1?Output file name required}"

cat >${outfile} <<EOF
[etc]
transient = ${PREP_ROOT_ETC_TRANSIENT}

[composefs]
enabled = ${PREP_ROOT_CFS_ENABLED}
EOF
}
7 changes: 7 additions & 0 deletions recipes-extended/ostree/ostree-torizon.inc
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,10 @@ do_install:append () {
install -m 0644 ${WORKDIR}/ostree-pending-reboot.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/ostree-pending-reboot.path ${D}${systemd_system_unitdir}
}

require ostree-prepare-root.inc

do_install:append:cfs-support() {
install -m 0644 /dev/null ${D}${nonarch_libdir}/ostree/prepare-root.conf
write_prepare_root_config ${D}${nonarch_libdir}/ostree/prepare-root.conf
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SRC_URI = " \
gitsm://github.com/ostreedev/ostree;branch=main;protocol=https \
file://run-ptest \
"
SRCREV = "3b4f5e36ee6b83313d4a4afc8dacb5bb9367ee2b"
SRCREV = "2d2e0bddf3d4b662ef7f9a3eddb7814b57716cee"

UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+)"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ SRC_URI:append = " \
file://0001-update-default-grub-cfg-header.patch \
file://0002-Add-support-for-the-fdtfile-variable-in-uEnv.txt.patch \
file://0003-ostree-fetcher-curl-set-max-parallel-connections.patch \
file://0001-Expose-MOUNT_ATTR_IDMAP-detection-result-to-C-code.patch \
file://0001-mount-Allow-building-when-macro-MOUNT_ATTR_IDMAP-is-.patch \
file://0002-mount-Allow-building-when-macro-LOOP_CONFIGURE-is-no.patch \
"
Expand Down
5 changes: 2 additions & 3 deletions recipes-support/composefs-tools/composefs-tools_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ SRC_URI = "\
git://github.com/containers/composefs.git;protocol=https;branch=main \
file://0001-mount-Allow-building-when-macro-MOUNT_ATTR_IDMAP-is-.patch \
file://0002-mount-Allow-building-when-macro-LOOP_CONFIGURE-is-no.patch \
file://0001-configure.ac-disable-Werror-unused-result-temporaril.patch \
"

SRCREV = "cca8be49843385ce556fccf51f75821f70fb7769"
PV = "0.1.4+git${SRCPV}"
SRCREV = "2d5cdcb9176cfe4ccf1761ef6d78e1c48de35649"
PV = "1.0.3+git${SRCPV}"

S = "${WORKDIR}/git"

Expand Down

This file was deleted.

0 comments on commit 953aacb

Please sign in to comment.