util/chroot: rename context class to ChrootProcDevSys

Rename the context class to better describe what it's doing.  It doesn't
run anything in a chroot, but it prepares the tree for it.
This commit is contained in:
Achilleas Koutsou 2024-08-21 15:11:17 +02:00 committed by Tomáš Hozza
parent 618ec9db2c
commit 69625505cf
3 changed files with 5 additions and 5 deletions

View file

@ -2,7 +2,7 @@ import os
import subprocess
class Chroot:
class ChrootProcDevSys:
"""
Sets up mounts for the virtual filesystems inside a root tree, preparing it for running commands using chroot. This
should be used whenever a stage needs to run a command against the root tree but doesn't support a --root option or

View file

@ -3,7 +3,7 @@ import subprocess
import sys
import osbuild.api
from osbuild.util.chroot import Chroot
from osbuild.util.chroot import ChrootProcDevSys
def yesno(name: str, value: bool) -> str:
@ -83,7 +83,7 @@ def main(tree, options):
if initoverlayfs:
initfs_bin = "/usr/bin/initoverlayfs-install"
with Chroot(tree):
with ChrootProcDevSys(tree):
subprocess.run(["/usr/sbin/chroot", tree, initfs_bin,
"--no-hostonly",
"--kver", kver]

View file

@ -3,13 +3,13 @@ import subprocess
import sys
from osbuild import api
from osbuild.util.chroot import Chroot
from osbuild.util.chroot import ChrootProcDevSys
def main(tree, options):
policy = options["policy"]
with Chroot(tree):
with ChrootProcDevSys(tree):
# update-crypto-polciies uses /proc/self/mountinfo to find and verify that fips paths have been mounted to their
# expected locations by searching for the following path suffixes:
# /crypto-policies/default-fips-config