env=env | config.environment,
sandbox=config.sandbox(
binary=None,
- vartmp=True,
options=[
"--dir", "/work/src",
"--chdir", "/work/src",
sandbox=config.sandbox(
binary=None,
network=True,
- vartmp=True,
options=options,
sandbox_tree=Path(sandbox_tree),
),
with context.sandbox(
binary=None,
network=network,
- vartmp=True,
options=[
*options,
"--bind", context.root, "/buildroot",
env=env | context.config.environment,
sandbox=context.sandbox(
binary=None,
- vartmp=True,
# postoutput scripts should run as (fake) root so that file ownership is always recorded as if
# owned by root.
options=[
not context.config.repart_offline or
context.config.verity_key_source.type != KeySourceType.file
),
- vartmp=True,
options=options,
),
).stdout
not context.config.repart_offline or
context.config.verity_key_source.type != KeySourceType.file
),
- vartmp=True,
options=options,
),
).stdout
def sandbox(
*,
binary: Optional[PathString],
- vartmp: bool = False,
options: Sequence[PathString] = (),
) -> AbstractContextManager[list[PathString]]:
- return config.sandbox(binary=binary, vartmp=vartmp, options=[*options, *exclude])
+ return config.sandbox(binary=binary, options=[*options, *exclude])
copy_tree(src, subdst, preserve=False, sandbox=sandbox)
binary="systemd-repart",
network=True,
devices=True,
- vartmp=True,
options=["--bind", fname, fname],
),
)
env=env | config.environment,
sandbox=config.sandbox(
binary=None,
- vartmp=True,
tools=False,
options=[
"--dir", "/work/src",
binary: Optional[PathString],
network: bool = False,
devices: bool = False,
- vartmp: bool = False,
relaxed: bool = False,
tools: bool = True,
scripts: Optional[Path] = None,
return sandbox_cmd(
network=network,
devices=devices,
- vartmp=vartmp,
relaxed=relaxed,
scripts=scripts,
tools=self.tools() if tools else Path("/"),
binary: Optional[PathString],
network: bool = False,
devices: bool = False,
- vartmp: bool = False,
scripts: Optional[Path] = None,
options: Sequence[PathString] = (),
) -> AbstractContextManager[list[PathString]]:
binary=binary,
network=network,
devices=devices,
- vartmp=vartmp,
scripts=scripts,
sandbox_tree=self.sandbox_tree,
options=options,
return context.sandbox(
binary=cls.executable(context.config),
network=True,
- vartmp=True,
options=[
"--bind", context.root, "/buildroot",
*cls.mounts(context),
],
sandbox=config.sandbox(
binary="systemd-repart",
- vartmp=True,
options=[
"--bind", fname.parent, workdir(fname.parent),
"--ro-bind", src, workdir(src),
self,
*,
binary: Optional[PathString],
- vartmp: bool = False,
options: Sequence[PathString] = (),
) -> AbstractContextManager[list[PathString]]: ...
def nosandbox(
*,
binary: Optional[PathString],
- vartmp: bool = False,
options: Sequence[PathString] = (),
) -> AbstractContextManager[list[PathString]]:
return contextlib.nullcontext([])
*,
network: bool = False,
devices: bool = False,
- vartmp: bool = False,
scripts: Optional[Path] = None,
tools: Path = Path("/"),
relaxed: bool = False,
if scripts:
cmdline += ["--ro-bind", scripts, "/scripts"]
- with vartmpdir(condition=vartmp and not relaxed) as dir:
+ with vartmpdir(condition=not relaxed) as dir:
if dir:
cmdline += ["--bind", dir, "/var/tmp"]