From bc58165439bfbd430435b60be12b639076188a7c Mon Sep 17 00:00:00 2001 From: Alfredo Mazzinghi Date: Wed, 12 Jan 2022 16:54:48 +0000 Subject: [PATCH 1/5] Add option to build extra CheriBSD kernels. Add the --extra-kernel-configs option to build other kernel configurations that are not registered within cheribuild. This is useful to build local variants of kernel configurations in addition to the default ones. --- pycheribuild/projects/cross/cheribsd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pycheribuild/projects/cross/cheribsd.py b/pycheribuild/projects/cross/cheribsd.py index 07711b71a..31643cc74 100644 --- a/pycheribuild/projects/cross/cheribsd.py +++ b/pycheribuild/projects/cross/cheribsd.py @@ -1587,6 +1587,9 @@ def setup_config_options(cls, kernel_only_target=False, install_directory_help=N "caprevoke-kernel", show_help=True, _allow_unknown_targets=True, only_add_for_targets=CompilationTargets.ALL_CHERIBSD_CHERI_TARGETS_WITH_HYBRID, help="Build kernel with caprevoke support (experimental)") + + cls.extra_configs = cls.add_config_option("extra-kernel-configs", metavar="CONFIG", default=[], kind=list, + nargs="+", help="Additional kernel configuration files to build") if kernel_only_target: return # The remaining options only affect the userspace build cls.sysroot_only = cls.add_bool_option("sysroot-only", show_help=False, @@ -1599,6 +1602,7 @@ def __init__(self, *args, **kwargs) -> None: configs = self.extra_kernel_configs() self.extra_kernels += [c.kernconf for c in configs if not c.mfsroot] self.extra_kernels_with_mfs += [c.kernconf for c in configs if c.mfsroot] + self.extra_kernels += self.extra_configs def get_default_kernel_abi(self) -> KernelABI: # XXX: Because the config option has _allow_unknown_targets it exists @@ -1676,7 +1680,7 @@ def extra_kernel_configs(self) -> "list[CheriBSDConfig]": def get_kernel_configs(self, platform: "Optional[ConfigPlatform]") -> "list[str]": default = super().get_kernel_configs(platform) extra = filter_kernel_configs(self.extra_kernel_configs(), platform=platform, kABI=None) - return default + [c.kernconf for c in extra] + return default + [c.kernconf for c in extra] + self.extra_configs def setup(self) -> None: super().setup() From b6fbbe1deb77400df2bd52414e138259b7c816b2 Mon Sep 17 00:00:00 2001 From: Alfredo Mazzinghi Date: Tue, 10 May 2022 15:41:58 +0100 Subject: [PATCH 2/5] Honor extra CheriBSD kernel config for MFS root target. --- pycheribuild/projects/cross/cheribsd.py | 4 ++-- tests/test_argument_parsing.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pycheribuild/projects/cross/cheribsd.py b/pycheribuild/projects/cross/cheribsd.py index 31643cc74..f59e71649 100644 --- a/pycheribuild/projects/cross/cheribsd.py +++ b/pycheribuild/projects/cross/cheribsd.py @@ -1821,9 +1821,9 @@ def default_kernel_config(self, platform: ConfigPlatform = None, **filter_kwargs def get_kernel_configs(self, platform: "Optional[ConfigPlatform]") -> "typing.List[str]": if self.kernel_config is not None: - return [self.kernel_config] + return [self.kernel_config] + self.extra_configs configs = self._get_all_kernel_configs() - return [c.kernconf for c in filter_kernel_configs(configs, platform=platform, kABI=None)] + return [c.kernconf for c in filter_kernel_configs(configs, platform=platform, kABI=None)] + self.extra_configs def get_kernel_install_path(self, kernconf: str = None) -> Path: """ Get the installed kernel path for an MFS kernel config that has been built. """ diff --git a/tests/test_argument_parsing.py b/tests/test_argument_parsing.py index b400b13bd..26b49f9c0 100644 --- a/tests/test_argument_parsing.py +++ b/tests/test_argument_parsing.py @@ -953,7 +953,7 @@ def test_mfs_root_kernel_config_options(): assert config_options == ["_initial_source_dir", "_install_dir", "_linkage", "auto_var_init", "build_alternate_abi_kernels", "build_bench_kernels", "build_dir", "build_fett_kernels", "build_fpga_kernels", - "build_type", "caprevoke_kernel", "debug_kernel", "default_kernel_abi", + "build_type", "caprevoke_kernel", "debug_kernel", "default_kernel_abi", "extra_configs", "extra_make_args", "fast_rebuild", "force_configure", "kernel_config", "mfs_root_image", "skip_update", "use_ccache", "use_lto", "with_clean", "with_debug_files", "with_debug_info"] From 96b2fa38741b8abb300f6a94a3cad62423ce0530 Mon Sep 17 00:00:00 2001 From: Alfredo Mazzinghi Date: Tue, 22 Nov 2022 13:57:35 +0000 Subject: [PATCH 3/5] Mop up unused global --kernel-config option. Now we should always use the prefixed kernel-config options. --- pycheribuild/config/chericonfig.py | 3 -- pycheribuild/projects/cross/cheribsd.py | 10 ++--- tests/test_argument_parsing.py | 52 ------------------------- 3 files changed, 5 insertions(+), 60 deletions(-) diff --git a/pycheribuild/config/chericonfig.py b/pycheribuild/config/chericonfig.py index 61f697916..a57f55953 100644 --- a/pycheribuild/config/chericonfig.py +++ b/pycheribuild/config/chericonfig.py @@ -193,9 +193,6 @@ def __init__(self, loader, action_class) -> None: self.skip_kernel = loader.add_bool_option( "skip-kernel", "-skip-buildkernel", group=loader.freebsd_group, help="Skip the buildkernel step when building FreeBSD or CheriBSD") - self.freebsd_kernconf = loader.add_commandline_only_option( - "kernel-config", "-kernconf", group=loader.freebsd_group, help_hidden=True, - help="Override the default FreeBSD/CheriBSD kernel config.") self.freebsd_subdir = loader.add_commandline_only_option( "freebsd-subdir", "-subdir", group=loader.freebsd_group, type=list, metavar="SUBDIRS", help="Only build subdirs SUBDIRS of FreeBSD/CheriBSD instead of the full tree. Useful for quickly " diff --git a/pycheribuild/projects/cross/cheribsd.py b/pycheribuild/projects/cross/cheribsd.py index f59e71649..859c39ca4 100644 --- a/pycheribuild/projects/cross/cheribsd.py +++ b/pycheribuild/projects/cross/cheribsd.py @@ -1588,7 +1588,7 @@ def setup_config_options(cls, kernel_only_target=False, install_directory_help=N only_add_for_targets=CompilationTargets.ALL_CHERIBSD_CHERI_TARGETS_WITH_HYBRID, help="Build kernel with caprevoke support (experimental)") - cls.extra_configs = cls.add_config_option("extra-kernel-configs", metavar="CONFIG", default=[], kind=list, + cls.external_configs = cls.add_config_option("extra-kernel-configs", metavar="CONFIG", default=[], kind=list, nargs="+", help="Additional kernel configuration files to build") if kernel_only_target: return # The remaining options only affect the userspace build @@ -1602,7 +1602,7 @@ def __init__(self, *args, **kwargs) -> None: configs = self.extra_kernel_configs() self.extra_kernels += [c.kernconf for c in configs if not c.mfsroot] self.extra_kernels_with_mfs += [c.kernconf for c in configs if c.mfsroot] - self.extra_kernels += self.extra_configs + self.extra_kernels += self.external_configs def get_default_kernel_abi(self) -> KernelABI: # XXX: Because the config option has _allow_unknown_targets it exists @@ -1680,7 +1680,7 @@ def extra_kernel_configs(self) -> "list[CheriBSDConfig]": def get_kernel_configs(self, platform: "Optional[ConfigPlatform]") -> "list[str]": default = super().get_kernel_configs(platform) extra = filter_kernel_configs(self.extra_kernel_configs(), platform=platform, kABI=None) - return default + [c.kernconf for c in extra] + self.extra_configs + return default + [c.kernconf for c in extra] + self.external_configs def setup(self) -> None: super().setup() @@ -1821,9 +1821,9 @@ def default_kernel_config(self, platform: ConfigPlatform = None, **filter_kwargs def get_kernel_configs(self, platform: "Optional[ConfigPlatform]") -> "typing.List[str]": if self.kernel_config is not None: - return [self.kernel_config] + self.extra_configs + return [self.kernel_config] + self.external_configs configs = self._get_all_kernel_configs() - return [c.kernconf for c in filter_kernel_configs(configs, platform=platform, kABI=None)] + self.extra_configs + return [c.kernconf for c in filter_kernel_configs(configs, platform=platform, kABI=None)] + self.external_configs def get_kernel_install_path(self, kernconf: str = None) -> Path: """ Get the installed kernel path for an MFS kernel config that has been built. """ diff --git a/tests/test_argument_parsing.py b/tests/test_argument_parsing.py index 26b49f9c0..2f01e1de2 100644 --- a/tests/test_argument_parsing.py +++ b/tests/test_argument_parsing.py @@ -391,58 +391,6 @@ def test_cheribsd_purecap_inherits_config_from_cheribsd(): assert not cheribsd_riscv_hybrid.debug_kernel, "riscv64-hybrid should have a JSON false override for debug-kernel" -def test_kernconf(): - # The kernel-config command line option is special: There is a global (command-line-only) flag that is used - # as the default, but otherwise there should be no inheritance - config = _parse_arguments([]) - cheribsd_riscv_hybrid = _get_cheribsd_instance("cheribsd-riscv64-hybrid", config) - cheribsd_riscv = _get_cheribsd_instance("cheribsd-riscv64", config) - freebsd_riscv = _get_target_instance("freebsd-riscv64", config, BuildFreeBSD) - freebsd_native = _get_target_instance("freebsd-amd64", config, BuildFreeBSD) - assert config.freebsd_kernconf is None - assert freebsd_riscv.kernel_config == "QEMU" - assert cheribsd_riscv_hybrid.kernel_config == "CHERI-QEMU" - assert freebsd_native.kernel_config == "GENERIC" - - # Check that --kernconf is used as the fallback - config = _parse_arguments(["--kernconf=LINT", "--freebsd-riscv64/kernel-config=FOO"]) - assert config.freebsd_kernconf == "LINT" - attr = inspect.getattr_static(freebsd_riscv, "kernel_config") - # previously we would replace the command line attribute with a string -> check this is no longer true - assert isinstance(attr, JsonAndCommandLineConfigOption) - assert freebsd_riscv.kernel_config == "FOO" - assert cheribsd_riscv_hybrid.kernel_config == "LINT" - assert freebsd_native.kernel_config == "LINT" - - config = _parse_arguments(["--kernconf=LINT", "--cheribsd-riscv64-hybrid/kernel-config=SOMETHING"]) - assert config.freebsd_kernconf == "LINT" - assert freebsd_riscv.kernel_config == "LINT" - assert cheribsd_riscv_hybrid.kernel_config == "SOMETHING" - assert freebsd_native.kernel_config == "LINT" - - config = _parse_config_file_and_args(b'{ "cheribsd-riscv64/kernel-config": "RISCV64_CONFIG" }', - "--kernconf=GENERIC") - assert config.freebsd_kernconf == "GENERIC" - assert cheribsd_riscv_hybrid.kernel_config == "GENERIC" - assert cheribsd_riscv.kernel_config == "RISCV64_CONFIG" - assert freebsd_riscv.kernel_config == "GENERIC" - assert freebsd_native.kernel_config == "GENERIC" - - # kernel-config/--kernconf should only be valid on the command line: - with pytest.raises(ValueError, match="^Unknown config option 'freebsd/kernel-config'$"): - _parse_config_file_and_args(b'{ "freebsd/kernel-config": "GENERIC" }') - # kernel-config/--kernconf should only be valid on the command line: - with pytest.raises(ValueError, match="^Option 'kernel-config' cannot be used in the config file$"): - _parse_config_file_and_args(b'{ "kernel-config": "GENERIC" }') - with pytest.raises(ValueError, match="^Option 'kernconf' cannot be used in the config file$"): - _parse_config_file_and_args(b'{ "kernconf": "GENERIC" }') - - # There should not be any unsuffixed kernel-config options: - for tgt in ("cheribsd", "freebsd", "cheribsd-mfs-root-kernel"): - with pytest.raises(KeyError, match=r"error: unknown argument '--[\w-]+/kernel-config'"): - _parse_arguments(["--" + tgt + "/source-directory=/foo", "--" + tgt + "/kernel-config", "ABC"]) - - def test_duplicate_key(): with pytest.raises(SyntaxError, match="duplicate key: 'output-root'"): _parse_config_file_and_args(b'{ "output-root": "/foo", "some-other-key": "abc", "output-root": "/bar" }') From c387625a66c48549e5d2d804d1e6104e03c0066a Mon Sep 17 00:00:00 2001 From: Alfredo Mazzinghi Date: Tue, 22 Nov 2022 15:33:45 +0000 Subject: [PATCH 4/5] Allow to pass multiple kernel configurations to --/kernel-config. This allows to specify multiple custom kernels to build. Note that this differs from --/extra-kernel-configs in that extra-kernel-configs always appends to any kernel that cheribuild chooses to build, while the kernel-config option should override the entire build list. The first kernel given to --/kernel-config is treated as the default kernel, installed in /boot/kernel. --- pycheribuild/projects/cross/cheribsd.py | 35 ++++++++++++++++++------- tests/test_argument_parsing.py | 21 +++++++++++++++ 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/pycheribuild/projects/cross/cheribsd.py b/pycheribuild/projects/cross/cheribsd.py index 859c39ca4..2db3df1eb 100644 --- a/pycheribuild/projects/cross/cheribsd.py +++ b/pycheribuild/projects/cross/cheribsd.py @@ -525,13 +525,12 @@ def setup_config_options(cls, bootstrap_toolchain=False, use_upstream_llvm: bool kernel_only_target=False, **kwargs) -> None: super().setup_config_options(kernel_only_target=kernel_only_target, **kwargs) if cls._xtarget: - # KERNCONF always depends on the target, so we don't inherit this config option. The only exception is - # the global --kernel-config option that is provided for convenience and backwards compat. - cls.kernel_config = cls.add_config_option( - "kernel-config", metavar="CONFIG", show_help=True, extra_fallback_config_names=["kernel-config"], + # KERNCONF always depends on the target, so we don't inherit this config option. + cls.option_kernel_config = cls.add_config_option( + "kernel-config", metavar="CONFIG", show_help=True, nargs="+", kind=list, default=ComputedDefaultValue( function=lambda _, p: - p.default_kernel_config() if p.has_default_buildkernel_kernel_config else None, + [p.default_kernel_config()] if p.has_default_buildkernel_kernel_config else None, as_string="target-dependent, usually GENERIC"), use_default_fallback_config_names=False, # help="The kernel configuration to use for `make buildkernel`") # type: str @@ -750,10 +749,23 @@ def __init__(self, *args, **kwargs) -> None: self._install_prefix = Path("/") self.kernel_toolchain_exists: bool = False self.cross_toolchain_config = MakeOptions(MakeCommandKind.BsdMake, self) + # This is the kernel configuration to be used as the default kernel + self.kernel_config = None + # Additional kernel configurations to build + self.extra_kernels = [] + if self.option_kernel_config: + # We have either the default kernel or a list of kernel configuration overrides + self.kernel_config = self.option_kernel_config[0] + self.extra_kernels += self.option_kernel_config[1:] + # Remember whether the kernel config list was forced from command line + self._has_override_kernel_configs = False if self.has_default_buildkernel_kernel_config: - assert self.kernel_config is not None + assert self.option_kernel_config, "Missing default kernel_config" + self._has_override_kernel_configs = (len(self.option_kernel_config) > 1 or + self.kernel_config != self.default_kernel_config()) + else: + self._has_override_kernel_configs = (self.option_kernel_config is not None) self.make_args.set(**self.arch_build_flags) - self.extra_kernels = [] if self.subdir_override: # build only part of the tree @@ -1589,7 +1601,7 @@ def setup_config_options(cls, kernel_only_target=False, install_directory_help=N help="Build kernel with caprevoke support (experimental)") cls.external_configs = cls.add_config_option("extra-kernel-configs", metavar="CONFIG", default=[], kind=list, - nargs="+", help="Additional kernel configuration files to build") + nargs="+", help="Additional kernel configuration files to build") if kernel_only_target: return # The remaining options only affect the userspace build cls.sysroot_only = cls.add_bool_option("sysroot-only", show_help=False, @@ -1631,6 +1643,9 @@ def _get_config_variants(self, platforms: "set[ConfigPlatform]", kernABIs: "list def _get_kABIs_to_build(self) -> "list[KernelABI]": default_kABI = self.get_default_kernel_abi() kernABIs = [default_kABI] + # If we are ovveriding the kernel configurations list, only build the default ABI + if self._has_override_kernel_configs: + return kernABIs # XXX: Because the config option has _allow_unknown_targets it exists # in the base class and thus still inherited by non-purecap-kernel # targets @@ -1823,7 +1838,9 @@ def get_kernel_configs(self, platform: "Optional[ConfigPlatform]") -> "typing.Li if self.kernel_config is not None: return [self.kernel_config] + self.external_configs configs = self._get_all_kernel_configs() - return [c.kernconf for c in filter_kernel_configs(configs, platform=platform, kABI=None)] + self.external_configs + conf_names = [c.kernconf for c in filter_kernel_configs(configs, platform=platform, kABI=None)] + conf_names += self.external_configs + return conf_names def get_kernel_install_path(self, kernconf: str = None) -> Path: """ Get the installed kernel path for an MFS kernel config that has been built. """ diff --git a/tests/test_argument_parsing.py b/tests/test_argument_parsing.py index 2f01e1de2..2f9976f83 100644 --- a/tests/test_argument_parsing.py +++ b/tests/test_argument_parsing.py @@ -639,6 +639,19 @@ def test_disk_image_path(target, expected_name): "CHERI-PURECAP-QEMU", "CHERI-FETT", "CHERI-PURECAP-FETT"]), + pytest.param("cheribsd-riscv64-purecap", + ["--cheribsd-riscv64-purecap/kernel-config", "FOOBAR_KERNEL", + "--cheribsd-riscv64-purecap/no-build-alternate-abi-kernels"], + "FOOBAR_KERNEL", []), + pytest.param("cheribsd-riscv64-purecap", + ["--cheribsd-riscv64-purecap/kernel-config", "FOOBAR_KERNEL", + "--cheribsd-riscv64-purecap/build-alternate-abi-kernels"], + "FOOBAR_KERNEL", []), + pytest.param("cheribsd-riscv64-purecap", + ["--cheribsd-riscv64-purecap/kernel-config", "FOOBAR_KERNEL", + "BAZBAZ_KERNEL", + "--cheribsd-riscv64-purecap/build-alternate-abi-kernels"], + "FOOBAR_KERNEL", ["BAZBAZ_KERNEL"]), # Morello kernconf tests pytest.param("cheribsd-aarch64", [], @@ -652,6 +665,14 @@ def test_disk_image_path(target, expected_name): [], "GENERIC-MORELLO", ["GENERIC-MORELLO-PURECAP"]), + pytest.param("cheribsd-morello-purecap", + ["--cheribsd-morello-purecap/kernel-config", "FOOBAR_KERNEL", + "--cheribsd-morello-purecap/no-build-alternate-abi-kernels"], + "FOOBAR_KERNEL", []), + pytest.param("cheribsd-morello-purecap", + ["--cheribsd-morello-purecap/kernel-config", "FOOBAR_KERNEL", + "--cheribsd-morello-purecap/build-alternate-abi-kernels"], + "FOOBAR_KERNEL", []), # FreeBSD kernel configs pytest.param("freebsd-i386", [], "GENERIC", []), pytest.param("freebsd-aarch64", [], "GENERIC", []), From 9f87896f94404256891b2172be3e3d3504f7224c Mon Sep 17 00:00:00 2001 From: Alfredo Mazzinghi Date: Tue, 22 Nov 2022 16:10:10 +0000 Subject: [PATCH 5/5] Fix kernel_config implementation. Had to move it to a property so that it is dynamically evaluated, as the options are not necessarily stable on __init__(). --- pycheribuild/projects/cross/cheribsd.py | 30 ++++++++++++------------- tests/test_argument_parsing.py | 15 ++++--------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/pycheribuild/projects/cross/cheribsd.py b/pycheribuild/projects/cross/cheribsd.py index 2db3df1eb..eb782e4eb 100644 --- a/pycheribuild/projects/cross/cheribsd.py +++ b/pycheribuild/projects/cross/cheribsd.py @@ -608,6 +608,15 @@ def setup_config_options(cls, bootstrap_toolchain=False, use_upstream_llvm: bool assert not cls._xtarget.is_hybrid_or_purecap_cheri() cls.build_lib32 = False + @property + def kernel_config(self): + # Shorthand to access the default kernel specified by the kernel-config option. + # The configuration option can be a list but the kernel_config is always the default + # kernel configuration to build, whether the option overrides it or it is the default one. + if self.option_kernel_config is None: + return None + return self.option_kernel_config[0] + def get_default_kernel_platform(self) -> ConfigPlatform: if self.crosscompile_target.is_aarch64(include_purecap=True): return ConfigPlatform.FVP @@ -749,22 +758,13 @@ def __init__(self, *args, **kwargs) -> None: self._install_prefix = Path("/") self.kernel_toolchain_exists: bool = False self.cross_toolchain_config = MakeOptions(MakeCommandKind.BsdMake, self) - # This is the kernel configuration to be used as the default kernel - self.kernel_config = None - # Additional kernel configurations to build + if self.has_default_buildkernel_kernel_config: + assert self.option_kernel_config is not None self.extra_kernels = [] - if self.option_kernel_config: - # We have either the default kernel or a list of kernel configuration overrides - self.kernel_config = self.option_kernel_config[0] + if self.option_kernel_config is not None: + # The first kernel configuration is the default one, all the others are new extra configs. + # This will be non-empty when the kernel-config list is overridden from cheribuild configuration. self.extra_kernels += self.option_kernel_config[1:] - # Remember whether the kernel config list was forced from command line - self._has_override_kernel_configs = False - if self.has_default_buildkernel_kernel_config: - assert self.option_kernel_config, "Missing default kernel_config" - self._has_override_kernel_configs = (len(self.option_kernel_config) > 1 or - self.kernel_config != self.default_kernel_config()) - else: - self._has_override_kernel_configs = (self.option_kernel_config is not None) self.make_args.set(**self.arch_build_flags) if self.subdir_override: @@ -1644,7 +1644,7 @@ def _get_kABIs_to_build(self) -> "list[KernelABI]": default_kABI = self.get_default_kernel_abi() kernABIs = [default_kABI] # If we are ovveriding the kernel configurations list, only build the default ABI - if self._has_override_kernel_configs: + if self.kernel_config and self.kernel_config != self.default_kernel_config(): return kernABIs # XXX: Because the config option has _allow_unknown_targets it exists # in the base class and thus still inherited by non-purecap-kernel diff --git a/tests/test_argument_parsing.py b/tests/test_argument_parsing.py index 2f9976f83..0d5b83bee 100644 --- a/tests/test_argument_parsing.py +++ b/tests/test_argument_parsing.py @@ -922,10 +922,10 @@ def test_mfs_root_kernel_config_options(): assert config_options == ["_initial_source_dir", "_install_dir", "_linkage", "auto_var_init", "build_alternate_abi_kernels", "build_bench_kernels", "build_dir", "build_fett_kernels", "build_fpga_kernels", - "build_type", "caprevoke_kernel", "debug_kernel", "default_kernel_abi", "extra_configs", - "extra_make_args", "fast_rebuild", "force_configure", "kernel_config", - "mfs_root_image", "skip_update", "use_ccache", "use_lto", "with_clean", - "with_debug_files", "with_debug_info"] + "build_type", "caprevoke_kernel", "debug_kernel", "default_kernel_abi", + "external_configs", "extra_make_args", "fast_rebuild", "force_configure", + "mfs_root_image", "option_kernel_config", "skip_update", "use_ccache", + "use_lto", "with_clean", "with_debug_files", "with_debug_info"] def test_mfs_root_kernel_inherits_defaults_from_cheribsd(): @@ -976,13 +976,6 @@ def test_mfs_root_kernel_inherits_defaults_from_cheribsd(): assert cheribsd_riscv64_hybrid.kernel_config == "CHERI-QEMU" assert mfs_riscv64.kernel_config is None assert mfs_riscv64_hybrid.kernel_config == "MFS_CONFIG_RISCV64_HYBRID" - _parse_arguments(["--kernel-config=CONFIG_DEFAULT", - "--cheribsd-riscv64-purecap/kernel-config=BASE_CONFIG_RISCV64", - "--cheribsd-mfs-root-kernel-riscv64-hybrid/kernel-config=MFS_CONFIG_RISCV64_HYBRID"]) - assert cheribsd_riscv64_purecap.kernel_config == "BASE_CONFIG_RISCV64" - assert cheribsd_riscv64_hybrid.kernel_config == "CONFIG_DEFAULT" - assert mfs_riscv64.kernel_config == "CONFIG_DEFAULT" - assert mfs_riscv64_hybrid.kernel_config == "MFS_CONFIG_RISCV64_HYBRID" def test_relative_paths_in_config():