From 5145c01cc18b2ec9c1a6f72002d54b627e19ca2b Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Fri, 6 Nov 2020 15:55:28 -0500 Subject: [PATCH] rpm-ostree-bisect: support read-only /sysroot/ On newer rpm-ostree systems /sysroot can be mounted read-only [1] which means we can't pull commit metadata into the repo. Let's remount it read-write if that's the case. [1] https://github.com/ostreedev/ostree/pull/1767 --- rpm-ostree-bisect | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rpm-ostree-bisect b/rpm-ostree-bisect index 6f8d20c..ba8a43c 100755 --- a/rpm-ostree-bisect +++ b/rpm-ostree-bisect @@ -129,6 +129,18 @@ def get_deployed_base_commit(deployment, repo): commitid = OSTree.commit_get_parent(commit) return commitid +""" + On newer rpm-ostree systems /sysroot has been mounted read-only + which means we can't pull commit metadata into the repo. Let's + remount it read-write if that's the case. +""" +def make_sysroot_readwrite(): + stat = os.statvfs('/sysroot') + readonly = bool(stat.f_flag & os.ST_RDONLY) + if readonly: + cmd = ['/usr/bin/mount', '-o', 'remount,rw', '/sysroot'] + subprocess.call(cmd) + """ Initialize commit info ordered dict. The array will be a list of @@ -433,6 +445,8 @@ def main(): fatal("Not in a booted OSTree system!") _, repo = sysroot.get_repo(None) + make_sysroot_readwrite() + log("Using data file at: %s" % args.datafile) if args.resume: