mount_build_overlay(state),\
mount_passwd(state.name, state.uid, state.gid, state.root):
bwrap(
- [state.config.build_script],
+ [state.config.build_script, *(state.args.cmdline if state.args.verb == Verb.build else [])],
network=state.config.with_network,
readonly=True,
options=finalize_mounts(state.config),
documentation = enum.auto()
def supports_cmdline(self) -> bool:
- return self in (Verb.shell, Verb.boot, Verb.qemu, Verb.ssh)
+ return self in (Verb.build, Verb.shell, Verb.boot, Verb.qemu, Verb.ssh)
def needs_build(self) -> bool:
return self in (Verb.build, Verb.shell, Verb.boot, Verb.qemu, Verb.serve)
# the synopsis below is supposed to be indented by two spaces
usage="\n " + textwrap.dedent("""\
mkosi [options...] {b}summary{e}
- mkosi [options...] {b}build{e}
+ mkosi [options...] {b}build{e} [command line...]
mkosi [options...] {b}shell{e} [command line...]
mkosi [options...] {b}boot{e} [nspawn settings...]
mkosi [options...] {b}qemu{e} [qemu parameters...]
`mkosi [options…] summary`
-`mkosi [options…] build`
+`mkosi [options…] build [command line…]`
`mkosi [options…] shell [command line…]`
`build`
-: This builds the image based on the settings passed in on the command line or
- read from configuration files. This command is the default if no verb is
- explicitly specified.
+: This builds the image based on the settings passed in on the command
+ line or read from configuration files. This command is the default if
+ no verb is explicitly specified. If any command line arguments are
+ specified, these are passed directly to the build script if one is
+ defined.
`shell`