)
with (
- mount_build_overlay(state),\
- mount_volatile_overlay(state),\
- finalize_chroot_scripts(state) as cd\
+ mount_build_overlay(state),
+ mount_volatile_overlay(state),
+ finalize_chroot_scripts(state) as cd,
):
for script in state.config.build_scripts:
chroot = chroot_cmd(
cmdline = state.args.cmdline if state.args.verb == Verb.build else []
with (
- finalize_host_scripts(state, chroot) as hd,\
- complete_step(f"Running build script {script}…")\
+ finalize_host_scripts(state, chroot) as hd,
+ complete_step(f"Running build script {script}…"),
):
bwrap(
script_maybe_chroot(script, "/work/build-script") + cmdline,
)
with (
- finalize_host_scripts(state, chroot) as hd,\
- complete_step(f"Running postinstall script {script}…")\
+ finalize_host_scripts(state, chroot) as hd,
+ complete_step(f"Running postinstall script {script}…"),
):
bwrap(
script_maybe_chroot(script, "/work/postinst") + ["final"],
)
with (
- finalize_host_scripts(state, chroot) as hd,\
- complete_step(f"Running finalize script {script}…")\
+ finalize_host_scripts(state, chroot) as hd,
+ complete_step(f"Running finalize script {script}…"),
):
bwrap(
script_maybe_chroot(script, "/work/finalize"),
continue
with (
- complete_step(f"Building {config.image or 'default'} image"),\
- mount_tools(config.tools_tree),\
- prepend_to_environ_path(config)\
+ complete_step(f"Building {config.image or 'default'} image"),
+ mount_tools(config.tools_tree),
+ prepend_to_environ_path(config),
):
# After tools have been mounted, check if we have what we need
check_tools(args, config)
return
with (
- mount_usr(last.tools_tree),\
- mount_passwd(),\
- prepend_to_environ_path(last)\
+ mount_usr(last.tools_tree),
+ mount_passwd(),
+ prepend_to_environ_path(last),
):
check_tools(args, last)
# We create the socket ourselves and pass the fd to virtiofsd to avoid race conditions where we start qemu
# before virtiofsd has had the chance to create the socket (or where we try to chown it first).
with (
- tempfile.TemporaryDirectory(prefix="mkosi-virtiofsd") as state,\
- socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as sock\
+ tempfile.TemporaryDirectory(prefix="mkosi-virtiofsd") as state,
+ socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as sock,
):
# Make sure qemu can access the virtiofsd socket in this directory.
os.chown(state, INVOKING_USER.uid, INVOKING_USER.gid)