Skip to content

Commit

Permalink
rpm-ostree: Setup readonly sysroot for ostree & rw karg
Browse files Browse the repository at this point in the history
- Enable read only sysroot in the ostree repo config.
- Add `rw` to the kernel arguments to keep statefull parts of the system
  (/var & /etc) writable.

See: https://fedoraproject.org/wiki/Changes/Silverblue_Kinoite_readonly_sysroot
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2086489
  • Loading branch information
travier committed Jul 27, 2022
1 parent 24a7a5f commit 4024c32
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pyanaconda/modules/payloads/payload/rpm_ostree/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ def _set_kargs(self):
if root_data.type == "btrfs subvolume":
set_kargs_args.append("rootflags=subvol=" + root_name)

set_kargs_args.append("rw")

safe_exec_with_redirect("ostree", set_kargs_args, root=self._sysroot)


Expand Down Expand Up @@ -520,6 +522,17 @@ def run(self):
self._data.remote + ':' + ref]
)

log.info("ostree config set sysroot.readonly true")

safe_exec_with_redirect(
"ostree",
["config",
"--repo=" + self._physroot + "/ostree/repo",
"set",
"sysroot.readonly",
"true"]
)

log.info("ostree admin deploy complete")
self.report_progress(_("Deployment complete: {}").format(ref))

Expand Down

0 comments on commit 4024c32

Please sign in to comment.