`build`
: This builds the image, based on the settings passed in on the
- command line or read from a `mkosi.default` file. This
+ command line or read from a `mkosi.conf` file. This
verb is the default if no verb is explicitly specified. This command
must be executed as `root`. Any arguments passed after `build` are
passed as arguments to the build script (if there is one).
`summary`
: Outputs a human-readable summary of all options used for building an
- image. This will parse the command line and `mkosi.default` file as it
+ image. This will parse the command line and `mkosi.conf` file as it
would do on `build`, but only output what it is configured for and not
actually build anything.`
images. By default command line arguments get appended. To remove all
arguments from the current list pass "!\*". To remove specific arguments
add a space separated list of "!" prefixed arguments.
- For example adding "!\* console=ttyS0 rw" to a `mkosi.default` file or the
+ For example adding "!\* console=ttyS0 rw" to a `mkosi.conf` file or the
command line arguments passes "console=ttyS0 rw" to the kernel in any
case. Just adding "console=ttyS0 rw" would append these two arguments
to the kernel command line created by lower priority configuration
version and/or architecture, package name globs, paths to packages in the
file system, package groups, and virtual provides, including file paths.
-: To remove a package e.g. added by a `mkosi.default` configuration
+: To remove a package e.g. added by a `mkosi.conf` configuration
file prepend the package name with `!`. For example -p "!apache2"
would remove the apache2 package. To replace the apache2 package by
the httpd package just add -p "!apache2,httpd" to the command line
option is an effective way to build a project located in a specific
directory.
-`--default=`
+`--config=`
: Loads additional settings from the specified settings file. Most
command line options may also be configured in a settings file. See
the table below to see which command line options match which
settings file option. If this option is not used, but a file
- `mkosi.default` is found in the local directory it is automatically
+ `mkosi.conf` is found in the local directory it is automatically
used for this purpose. If a setting is configured both on the
command line and in the settings file, the command line generally
wins, except for options taking lists in which case both lists are
`--all`, `-a`
: Iterate through all files `mkosi.*` in the `mkosi.files/`
- subdirectory, and build each as if `--default=mkosi.files/mkosi.…`
+ subdirectory, and build each as if `--config=mkosi.files/mkosi.…`
was invoked. This is a quick way to build a large number of images
in one go. Any additional specified command line arguments override
the relevant options in all files processed this way.
tree. Specifically, the following files are used if they exist in the
local directory:
-* The **`mkosi.default`** file provides the default configuration for
+* The **`mkosi.conf`** file provides the default configuration for
the image building process. For example, it may specify the
distribution to use (`fedora`, `ubuntu`, `debian`, `arch`,
`opensuse`, `mageia`, `openmandriva`, `gentoo`) for the image, or additional
`mkosi` without further parameters in your *source* tree is enough
to get the right image of your choice set up.
- Additionally, if a *`mkosi.default.d/`* directory exists, each file
+ Additionally, if a *`mkosi.conf.d/`* directory exists, each file
in it is loaded in the same manner adding/overriding the values
- specified in `mkosi.default`. If `mkosi.default.d/` contains a
+ specified in `mkosi.conf`. If `mkosi.conf.d/` contains a
directory named after the distribution being built, each file in
that directory is also processed.
via `.gitignore` entries is to use the `mkosi.output/` directory,
which is an easy way to exclude all build artifacts.
- The `$MKOSI_DEFAULT` environment variable will be set inside of this
- script so that you know which `mkosi.default` (if any) was passed
+ The `$MKOSI_CONFIG` environment variable will be set inside of this
+ script so that you know which `mkosi.conf` (if any) was passed
in.
* The **`mkosi.prepare`** script is invoked directly after the
Note that the location of all these files may also be configured
during invocation via command line switches, and as settings in
-`mkosi.default`, in case the default settings are not acceptable for a
+`mkosi.conf`, in case the default settings are not acceptable for a
project.
# BUILD PHASES
state:
```bash
-# cat >mkosi.default <<EOF
+# cat >mkosi.conf <<EOF
[Distribution]
Distribution=fedora
Release=24
Also you could set hostname in configuration file:
```bash
-# cat mkosi.default
+# cat mkosi.conf
...
[Output]
Hostname=image
for line in lines))
class ArgumentParserMkosi(argparse.ArgumentParser):
- """ArgumentParser with support for mkosi.defaults file(s)
+ """ArgumentParser with support for mkosi configuration file(s)
This derived class adds a simple ini file parser to python's ArgumentParser features.
Each line of the ini file is converted to a command line argument. Example:
configuration file paths. The settings of each file are parsed and returned as
command line arguments.
Example:
- The following mkosi.default is loaded.
+ The following mkosi config is loaded.
[Distribution]
Distribution=fedora
mkosi is called like: mkosi -p httpd
- arg_strings: ['@mkosi.default', '-p', 'httpd']
+ arg_strings: ['@mkosi.conf', '-p', 'httpd']
return value: ['--distribution', 'fedora', '-p', 'httpd']
"""
metavar="PATH",
)
group.add_argument(
- "--default",
- dest="default_path",
+ "--config",
+ dest="config_path",
help="Read configuration data from file",
type=Path,
metavar="PATH",
)
+ group.add_argument(
+ "--default",
+ dest="config_path",
+ help=argparse.SUPPRESS,
+ type=Path,
+ metavar="PATH",
+ )
group.add_argument(
"-a", "--all",
action="store_true",
def parse_args(argv: Optional[Sequence[str]] = None) -> Dict[str, argparse.Namespace]:
- """Load default values from files and parse command line arguments
+ """Load config values from files and parse command line arguments
- Do all about default files and command line arguments parsing. If --all argument is passed
+ Do all about config files and command line arguments parsing. If --all argument is passed
more than one job needs to be processed. The returned tuple contains MkosiArgs
valid for all jobs as well as a dict containing the arguments per job.
"""
argv = sys.argv[1:]
argv = list(argv) # make a copy 'cause we'll be modifying the list later on
- # If ArgumentParserMkosi loads settings from mkosi.default files, the settings from files
+ # If ArgumentParserMkosi loads settings from mkosi configuration files, the settings from files
# are converted to command line arguments. This breaks ArgumentParser's support for default
# values of positional arguments. Make sure the verb command gets explicitly passed.
# Insert a -- before the positional verb argument otherwise it might be considered as an argument of
else:
argv += ["--", "build"]
- # First run of command line arguments parsing to get the directory of mkosi.default file and the verb argument.
+ # First run of command line arguments parsing to get the directory of the config file and the verb argument.
args_pre_parsed, _ = parser.parse_known_args(argv)
if args_pre_parsed.verb == Verb.help:
else:
directory = Path.cwd()
- # Note that directory will be ignored if .all_directory or .default_path are absolute
+ # Note that directory will be ignored if .all_directory or .config_path are absolute
all_directory = directory / (args_pre_parsed.all_directory or "mkosi.files")
- default_path = directory / (args_pre_parsed.default_path or "mkosi.default")
- if args_pre_parsed.default_path and not default_path.exists():
- die(f"No config file found at {default_path}")
+ if args_pre_parsed.config_path and not directory.joinpath(args_pre_parsed.config_path).exists():
+ die(f"No config file found at {directory / args_pre_parsed.config_path}")
+
+ for name in (args_pre_parsed.config_path, "mkosi.conf"):
+ if not name:
+ continue
+
+ config_path = directory / name
+ if config_path.exists():
+ break
+ else:
+ config_path = directory / "mkosi.default"
- if args_pre_parsed.all and args_pre_parsed.default_path:
- die("--all and --default= may not be combined.")
+ if args_pre_parsed.all and args_pre_parsed.config_path:
+ die("--all and --config= may not be combined.")
# Parse everything in --all mode
args_all = {}
args_all[f.name] = args
# Parse everything in normal mode
else:
- args = parse_args_file_group(argv, os.fspath(default_path))
+ args = parse_args_file_group(argv, os.fspath(config_path))
args = load_distribution(args)
if args.distribution:
# Parse again with any extra distribution files included.
- args = parse_args_file_group(argv, os.fspath(default_path), args.distribution)
+ args = parse_args_file_group(argv, os.fspath(config_path), args.distribution)
args_all["default"] = args
return args_all
-def parse_args_file(argv: List[str], default_path: Path) -> argparse.Namespace:
+def parse_args_file(argv: List[str], config_path: Path) -> argparse.Namespace:
"""Parse just one mkosi.* file (--all mode)."""
# Parse all parameters handled by mkosi.
# Parameters forwarded to subprocesses such as nspawn or qemu end up in cmdline_argv.
- argv = argv[:1] + [f"{ArgumentParserMkosi.fromfile_prefix_chars}{default_path}"] + argv[1:]
+ argv = argv[:1] + [f"{ArgumentParserMkosi.fromfile_prefix_chars}{config_path}"] + argv[1:]
return create_parser().parse_args(argv)
def parse_args_file_group(
- argv: List[str], default_path: str, distribution: Optional[Distribution] = None
+ argv: List[str], config_path: str, distribution: Optional[Distribution] = None
) -> argparse.Namespace:
- """Parse a set of mkosi.default and mkosi.default.d/* files."""
+ """Parse a set of mkosi config files"""
# Add the @ prefixed filenames to current argument list in inverse priority order.
- defaults_files = []
+ config_files = []
- if os.path.isfile(default_path):
- defaults_files += [f"{ArgumentParserMkosi.fromfile_prefix_chars}{default_path}"]
+ if os.path.isfile(config_path):
+ config_files += [f"{ArgumentParserMkosi.fromfile_prefix_chars}{config_path}"]
- defaults_dir = "mkosi.default.d"
- if os.path.isdir(defaults_dir):
- for file in sorted(os.listdir(defaults_dir)):
- path = os.path.join(defaults_dir, file)
- if os.path.isfile(path):
- defaults_files += [f"{ArgumentParserMkosi.fromfile_prefix_chars}{path}"]
+ for dropin_dir in ("mkosi.conf.d", "mkosi.default.d"):
+ if os.path.isdir(dropin_dir):
+ for file in sorted(os.listdir(dropin_dir)):
+ path = os.path.join(dropin_dir, file)
+ if os.path.isfile(path):
+ config_files += [f"{ArgumentParserMkosi.fromfile_prefix_chars}{path}"]
if distribution is not None:
- distribution_dir = f"mkosi.default.d/{distribution}"
- if os.path.isdir(distribution_dir):
- for subdir in sorted(os.listdir(distribution_dir)):
- path = os.path.join(distribution_dir, subdir)
- if os.path.isfile(path):
- defaults_files += [f"{ArgumentParserMkosi.fromfile_prefix_chars}{path}"]
+ for distribution_dir in (f"mkosi.conf.d/{distribution}", f"mkosi.default.d/{distribution}"):
+ if os.path.isdir(distribution_dir):
+ for subdir in sorted(os.listdir(distribution_dir)):
+ path = os.path.join(distribution_dir, subdir)
+ if os.path.isfile(path):
+ config_files += [f"{ArgumentParserMkosi.fromfile_prefix_chars}{path}"]
# Parse all parameters handled by mkosi.
# Parameters forwarded to subprocesses such as nspawn or qemu end up in cmdline_argv.
- return create_parser().parse_args(defaults_files + argv)
+ return create_parser().parse_args(config_files + argv)
def parse_bytes(num_bytes: Optional[str]) -> Optional[int]:
if nspawn_knows_arg(console_arg):
cmdline += [console_arg]
- if args.default_path is not None:
- cmdline += [f"--setenv=MKOSI_DEFAULT={args.default_path}"]
+ if args.config_path is not None:
+ cmdline += [
+ f"--setenv=MKOSI_CONFIG={args.config_path}",
+ f"--setenv=MKOSI_DEFAULT={args.config_path}"
+ ]
if args.image_version is not None:
cmdline += [f"--setenv=IMAGE_VERSION={args.image_version}"]
"compress_fs": None,
"compress_output": None,
"debug": [],
- "default_path": None,
+ "config_path": None,
"directory": None,
"distribution": None,
"encrypt": None,
@staticmethod
def write_ini(dname: str, fname: str, config: Dict[str, Any], prio: int = 1000) -> None:
- """Write mkosi.default(.d/*) files"""
+ """Write mkosi.conf(.d/*) files"""
if not os.path.exists(dname):
os.makedirs(dname)
if prio < 1000:
called by pytest for each class derived from this class. These test cases
verify the parse_args function in single image (not --all) mode.
This class implements four functions:
- - prepare_mkosi_default
- - prepare_mkosi_default_d_1
- - prepare_mkosi_default_d_2
+ - prepare_mkosi_conf
+ - prepare_mkosi_conf_d_1
+ - prepare_mkosi_conf_d_2
- prepare_args or prepare_args_short
The purpose of these function is to generate configuration files and sets of command line
function under test.
This allows to write test cases with four steps. The first step generates a reference configuration
- consisting of mkosi.default file only. Therefore prepare_mkosi_default function is is called to
+ consisting of mkosi.conf file only. Therefore prepare_mkosi_conf function is is called to
generate the test configuration. Finally parse_args is called and the configuration returned by
parse_args is compared against the reference_config. The second test step generates a test
- configuration by calling prepare_mkosi_default and prepare_mkosi_default_d_1. This verifies the
- behavior of parse_args is fine for mkosi.default plus one override file. The third test case verifies
- that mkosi.default with two files in mkosi.default.d folder works as expected. The fourth test case
+ configuration by calling prepare_mkosi_conf and prepare_mkosi_conf_d_1. This verifies the
+ behavior of parse_args is fine for mkosi.conf plus one override file. The third test case verifies
+ that mkosi.conf with two files in mkosi.conf.d folder works as expected. The fourth test case
additionally overrides some default values with command line arguments.
Classes derived from this base class should override the mentioned functions to implement specific
"""
def __init__(self) -> None:
- """Add the default mkosi.default config"""
+ """Add the default mkosi.conf config"""
super().__init__()
self.add_reference_config()
- def _prepare_mkosi_default(self, directory: str, config: Dict[str, Any]) -> None:
- MkosiConfig.write_ini(directory, "mkosi.default", config)
+ def _prepare_mkosi_conf(self, directory: str, config: Dict[str, Any]) -> None:
+ MkosiConfig.write_ini(directory, "mkosi.conf", config)
- def _prepare_mkosi_default_d(self, directory: str, config: Dict[str, Any], prio: int = 1000, fname: str = "mkosi.conf") -> None:
- MkosiConfig.write_ini(os.path.join(directory, "mkosi.default.d"), fname, config, prio)
+ def _prepare_mkosi_conf_d(self, directory: str, config: Dict[str, Any], prio: int = 1000, fname: str = "mkosi.conf") -> None:
+ MkosiConfig.write_ini(os.path.join(directory, "mkosi.conf.d"), fname, config, prio)
- def prepare_mkosi_default(self, directory: str) -> None:
- """Generate a mkosi.default defaults file in the working directory"""
+ def prepare_mkosi_conf(self, directory: str) -> None:
+ """Generate a mkosi.conf config file in the working directory"""
pass
- def prepare_mkosi_default_d_1(self, directory: str) -> None:
- """Generate a prio 1 config file in mkosi.default.d
+ def prepare_mkosi_conf_d_1(self, directory: str) -> None:
+ """Generate a prio 1 config file in mkosi.conf.d
The file name should be prefixed with 001_.
"""
pass
- def prepare_mkosi_default_d_2(self, directory: str) -> None:
- """Generate a prio 2 config file in mkosi.default.d
+ def prepare_mkosi_conf_d_2(self, directory: str) -> None:
+ """Generate a prio 2 config file in mkosi.conf.d
The file name should be prefixed with 002_.
"""
"""Minimal test configuration for the distribution parameter
This tests defines the distribution parameter on several configuration priorities:
- - mkosi.default
- - mkosi.default.d/001_mkosi.conf
- - mkosi.default.d/002_mkosi.conf
+ - mkosi.conf
+ - mkosi.conf.d/001_mkosi.conf
+ - mkosi.conf.d/002_mkosi.conf
- --distribution
"""
ref_c["directory"] = self.subdir_name
self.cli_arguments = ["--directory", self.subdir_name, "summary"]
- def prepare_mkosi_default(self, directory: str) -> None:
+ def prepare_mkosi_conf(self, directory: str) -> None:
mk_config = {"Distribution": {"Distribution": "fedora"}}
- self._prepare_mkosi_default(directory, mk_config)
+ self._prepare_mkosi_conf(directory, mk_config)
for ref_c in self.reference_config.values():
ref_c["distribution"] = "fedora"
if self.subdir_name:
if self.subdir_name:
self.cli_arguments = ["--directory", self.subdir_name, "summary"]
- def prepare_mkosi_default_d_1(self, directory: str) -> None:
+ def prepare_mkosi_conf_d_1(self, directory: str) -> None:
mk_config = {"Distribution": {"Distribution": "ubuntu"}}
- self._prepare_mkosi_default_d(directory, mk_config, 1)
+ self._prepare_mkosi_conf_d(directory, mk_config, 1)
for ref_c in self.reference_config.values():
ref_c["distribution"] = "ubuntu"
- def prepare_mkosi_default_d_2(self, directory: str) -> None:
+ def prepare_mkosi_conf_d_2(self, directory: str) -> None:
mk_config = {"Distribution": {"Distribution": "debian"}}
- self._prepare_mkosi_default_d(directory, mk_config, 2)
+ self._prepare_mkosi_conf_d(directory, mk_config, 2)
for ref_c in self.reference_config.values():
ref_c["distribution"] = "debian"
class MkosiConfigManyParams(MkosiConfigOne):
"""Test configuration for most parameters"""
- def prepare_mkosi_default(self, directory: str) -> None:
+ def prepare_mkosi_conf(self, directory: str) -> None:
mk_config = {
"Distribution": {
"Distribution": "fedora",
"Netdev": True,
},
}
- self._prepare_mkosi_default(directory, mk_config)
+ self._prepare_mkosi_conf(directory, mk_config)
for j in self.reference_config:
self._update_ref_from_file(mk_config, j)
- def prepare_mkosi_default_d_1(self, directory: str) -> None:
+ def prepare_mkosi_conf_d_1(self, directory: str) -> None:
mk_config = {
"Distribution": {
"Distribution": "ubuntu",
"Netdev": True,
},
}
- self._prepare_mkosi_default_d(directory, mk_config, 1)
+ self._prepare_mkosi_conf_d(directory, mk_config, 1)
for j in self.reference_config:
self._update_ref_from_file(mk_config, j)
- def prepare_mkosi_default_d_2(self, directory: str) -> None:
+ def prepare_mkosi_conf_d_2(self, directory: str) -> None:
mk_config = {
"Distribution": {
"Distribution": "debian",
"Netdev": True,
},
}
- self._prepare_mkosi_default_d(directory, mk_config, 2)
+ self._prepare_mkosi_conf_d(directory, mk_config, 2)
for j in self.reference_config:
self._update_ref_from_file(mk_config, j)
class MkosiConfigIniLists1(MkosiConfigOne):
"""Manually written ini files with advanced list syntax."""
- def prepare_mkosi_default(self, directory: str) -> None:
+ def prepare_mkosi_conf(self, directory: str) -> None:
ini_lines = [
"[Distribution]",
"Distribution=fedora",
" httpd",
" tar",
]
- with open(os.path.join(directory, "mkosi.default"), "w") as f_ini:
+ with open(os.path.join(directory, "mkosi.conf"), "w") as f_ini:
f_ini.write(os.linesep.join(ini_lines))
self.reference_config[DEFAULT_JOB_NAME]["distribution"] = "fedora"
self.reference_config[DEFAULT_JOB_NAME]["packages"] = ["openssh-clients", "httpd", "tar"]
- def prepare_mkosi_default_d_1(self, directory: str) -> None:
+ def prepare_mkosi_conf_d_1(self, directory: str) -> None:
ini_lines = [
"[Distribution]",
"Distribution=ubuntu",
"[Output]",
"KernelCommandLine=console=ttyS0",
]
- dname = os.path.join(directory, "mkosi.default.d")
+ dname = os.path.join(directory, "mkosi.conf.d")
if not os.path.exists(dname):
os.makedirs(dname)
with open(os.path.join(dname, "1_ubuntu.conf"), "w") as f_ini:
self.reference_config[DEFAULT_JOB_NAME]["packages"].append("apache2")
self.reference_config[DEFAULT_JOB_NAME]["kernel_command_line"].extend(["console=ttyS0"])
- def prepare_mkosi_default_d_2(self, directory: str) -> None:
+ def prepare_mkosi_conf_d_2(self, directory: str) -> None:
ini_lines = [
"[Content]",
"Packages=[ vim,!vi",
"KernelCommandLine=console=ttyS1",
" driver.feature=1",
]
- dname = os.path.join(directory, "mkosi.default.d")
+ dname = os.path.join(directory, "mkosi.conf.d")
if not os.path.exists(dname):
os.makedirs(dname)
with open(os.path.join(dname, "2_additional_stuff.conf"), "w") as f_ini:
class MkosiConfigIniLists2(MkosiConfigIniLists1):
"""Same as MkosiConfigIniLists2 but with clean KernelCommandLine"""
- def prepare_mkosi_default(self, directory: str) -> None:
+ def prepare_mkosi_conf(self, directory: str) -> None:
ini_lines = ["[Output]", "KernelCommandLine=!*"]
- with open(os.path.join(directory, "mkosi.default"), "w") as f_ini:
+ with open(os.path.join(directory, "mkosi.conf"), "w") as f_ini:
f_ini.write(os.linesep.join(ini_lines))
self.reference_config[DEFAULT_JOB_NAME]["kernel_command_line"] = []
def test_def(tested_config: Any, tmpdir: Path) -> None:
- """Generate the mkosi.default file only"""
+ """Generate the mkosi.conf file only"""
with change_cwd(tmpdir):
- tested_config.prepare_mkosi_default(tmpdir)
+ tested_config.prepare_mkosi_conf(tmpdir)
args = mkosi.parse_args(tested_config.cli_arguments)
assert tested_config == args
def test_def_1(tested_config: Any, tmpdir: Path) -> None:
- """Generate the mkosi.default file plus one config file"""
+ """Generate the mkosi.conf file plus one config file"""
with change_cwd(tmpdir):
- tested_config.prepare_mkosi_default(tmpdir)
- tested_config.prepare_mkosi_default_d_1(tmpdir)
+ tested_config.prepare_mkosi_conf(tmpdir)
+ tested_config.prepare_mkosi_conf_d_1(tmpdir)
args = mkosi.parse_args(tested_config.cli_arguments)
assert tested_config == args
def test_def_2(tested_config: Any, tmpdir: Path) -> None:
- """Generate the mkosi.default file plus another config file"""
+ """Generate the mkosi.conf file plus another config file"""
with change_cwd(tmpdir):
- tested_config.prepare_mkosi_default(tmpdir)
- tested_config.prepare_mkosi_default_d_2(tmpdir)
+ tested_config.prepare_mkosi_conf(tmpdir)
+ tested_config.prepare_mkosi_conf_d_2(tmpdir)
args = mkosi.parse_args(tested_config.cli_arguments)
assert tested_config == args
def test_def_1_2(tested_config: Any, tmpdir: Path) -> None:
- """Generate the mkosi.default file plus two config files"""
+ """Generate the mkosi.conf file plus two config files"""
with change_cwd(tmpdir):
- tested_config.prepare_mkosi_default(tmpdir)
- tested_config.prepare_mkosi_default_d_1(tmpdir)
- tested_config.prepare_mkosi_default_d_2(tmpdir)
+ tested_config.prepare_mkosi_conf(tmpdir)
+ tested_config.prepare_mkosi_conf_d_1(tmpdir)
+ tested_config.prepare_mkosi_conf_d_2(tmpdir)
args = mkosi.parse_args(tested_config.cli_arguments)
assert tested_config == args
def test_def_args(tested_config: Any, tmpdir: Path) -> None:
- """Generate the mkosi.default plus command line arguments"""
+ """Generate the mkosi.conf plus command line arguments"""
with change_cwd(tmpdir):
tested_config.prepare_args()
args = mkosi.parse_args(tested_config.cli_arguments)
def test_def_1_args(tested_config: Any, tmpdir: Path) -> None:
- """Generate the mkosi.default plus a config file plus command line arguments"""
+ """Generate the mkosi.conf plus a config file plus command line arguments"""
with change_cwd(tmpdir):
- tested_config.prepare_mkosi_default(tmpdir)
- tested_config.prepare_mkosi_default_d_1(tmpdir)
+ tested_config.prepare_mkosi_conf(tmpdir)
+ tested_config.prepare_mkosi_conf_d_1(tmpdir)
tested_config.prepare_args()
args = mkosi.parse_args(tested_config.cli_arguments)
assert tested_config == args
def test_def_1_2_args(tested_config: Any, tmpdir: Path) -> None:
- """Generate the mkosi.default plus two config files plus command line arguments"""
+ """Generate the mkosi.conf plus two config files plus command line arguments"""
with change_cwd(tmpdir):
- tested_config.prepare_mkosi_default(tmpdir)
- tested_config.prepare_mkosi_default_d_1(tmpdir)
- tested_config.prepare_mkosi_default_d_2(tmpdir)
+ tested_config.prepare_mkosi_conf(tmpdir)
+ tested_config.prepare_mkosi_conf_d_1(tmpdir)
+ tested_config.prepare_mkosi_conf_d_2(tmpdir)
tested_config.prepare_args()
args = mkosi.parse_args(tested_config.cli_arguments)
assert tested_config == args
def test_def_1_2_argssh(tested_config: Any, tmpdir: Path) -> None:
- """Generate the mkosi.default plus two config files plus short command line arguments"""
+ """Generate the mkosi.conf plus two config files plus short command line arguments"""
with change_cwd(tmpdir):
- tested_config.prepare_mkosi_default(tmpdir)
- tested_config.prepare_mkosi_default_d_1(tmpdir)
- tested_config.prepare_mkosi_default_d_2(tmpdir)
+ tested_config.prepare_mkosi_conf(tmpdir)
+ tested_config.prepare_mkosi_conf_d_1(tmpdir)
+ tested_config.prepare_mkosi_conf_d_2(tmpdir)
tested_config.prepare_args_short()
args = mkosi.parse_args(tested_config.cli_arguments)
assert tested_config == args
"""Test --all option with two simple configs"""
def __init__(self) -> None:
- """Add two default mkosi.default configs"""
+ """Add two default mkosi.conf configs"""
super().__init__()
for hostname in ["test1.example.org", "test2.example.org"]:
job_name = "mkosi." + hostname
def test_all_1(tested_config_all: Any, tmpdir: Path) -> None:
- """Generate the mkosi.default plus two config files plus short command line arguments"""
+ """Generate the mkosi.conf plus two config files plus short command line arguments"""
with change_cwd(tmpdir):
tested_config_all.prepare_mkosi_files(tmpdir)
args = mkosi.parse_args(tested_config_all.cli_arguments)