Skip to content

Commit

Permalink
Bind mount /work into chroot instead of individual files/directories
Browse files Browse the repository at this point in the history
Same effect with less code.
  • Loading branch information
DaanDeMeyer committed Jan 8, 2024
1 parent bc2b6cc commit df045a3
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions mkosi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,7 @@ def run_prepare_scripts(context: Context, build: bool) -> None:
resolve=True,
tools=context.config.tools(),
options=[
"--bind", "/work/prepare", "/work/prepare",
"--bind", "/work/src", "/work/src",
"--bind", "/work/scripts", "/work/scripts",
"--bind", "/work", "/work",
"--chdir", "/work/src",
"--setenv", "BUILDROOT", "/",
],
Expand Down Expand Up @@ -521,16 +519,7 @@ def run_build_scripts(context: Context) -> None:
resolve=context.config.with_network,
tools=context.config.tools(),
options=[
"--bind", "/work/build-script", "/work/build-script",
"--bind", "/work/dest", "/work/dest",
"--bind", "/work/out", "/work/out",
"--bind", "/work/src", "/work/src",
"--bind", "/work/scripts", "/work/scripts",
*(
["--bind", "/work/build", "/work/build"]
if context.config.build_dir
else []
),
"--bind", "/work", "/work",
"--chdir", "/work/src",
"--setenv", "BUILDROOT", "/",
*(["--setenv", "BUILDDIR", "/work/build"] if context.config.build_dir else []),
Expand Down Expand Up @@ -600,10 +589,7 @@ def run_postinst_scripts(context: Context) -> None:
resolve=context.config.with_network,
tools=context.config.tools(),
options=[
"--bind", "/work/postinst", "/work/postinst",
"--bind", "/work/out", "/work/out",
"--bind", "/work/src", "/work/src",
"--bind", "/work/scripts", "/work/scripts",
"--bind", "/work", "/work",
"--chdir", "/work/src",
"--setenv", "BUILDROOT", "/",
],
Expand Down Expand Up @@ -664,10 +650,7 @@ def run_finalize_scripts(context: Context) -> None:
resolve=context.config.with_network,
tools=context.config.tools(),
options=[
"--bind", "/work/finalize", "/work/finalize",
"--bind", "/work/out", "/work/out",
"--bind", "/work/src", "/work/src",
"--bind", "/work/scripts", "/work/scripts",
"--bind", "/work", "/work",
"--chdir", "/work/src",
"--setenv", "BUILDROOT", "/",
],
Expand Down

0 comments on commit df045a3

Please sign in to comment.