Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel configuration options still don't quite work as intended #214

Open
nwf opened this issue Jul 12, 2021 · 0 comments
Open

Kernel configuration options still don't quite work as intended #214

nwf opened this issue Jul 12, 2021 · 0 comments
Assignees

Comments

@nwf
Copy link
Member

nwf commented Jul 12, 2021

The boring invocation of cheribuild.py run-riscv64-purecap --list-kernels works fine, but if I have --cheribsd-riscv64-purecap/kernel-config set (to CHERI-CAPREVOKE-QEMU, say) on the command line or in the config json, then --list-kernels explodes:

Traceback (most recent call last):
  File "/cheri/source/cornucopia-modernize/cheribuild/cheribuild.py", line 42, in <module>
    main()
  File "/cheri/source/mainline/cheribuild/pycheribuild/__main__.py", line 258, in main
    run_and_kill_children_on_exit(real_main)
  File "/cheri/source/mainline/cheribuild/pycheribuild/processutils.py", line 717, in run_and_kill_children_on_exit
    fn()
  File "/cheri/source/mainline/cheribuild/pycheribuild/__main__.py", line 248, in real_main
    target_manager.run(cheri_config)
  File "/cheri/source/mainline/cheribuild/pycheribuild/targets.py", line 431, in run
    target.execute(config)
  File "/cheri/source/mainline/cheribuild/pycheribuild/targets.py", line 127, in execute
    self._do_run(config, msg="Built", func=lambda project: project.process())
  File "/cheri/source/mainline/cheribuild/pycheribuild/targets.py", line 112, in _do_run
    func(project)
  File "/cheri/source/mainline/cheribuild/pycheribuild/targets.py", line 127, in <lambda>
    self._do_run(config, msg="Built", func=lambda project: project.process())
  File "/cheri/source/mainline/cheribuild/pycheribuild/projects/run_qemu.py", line 501, in process
    self._list_kernel_configs()
  File "/cheri/source/mainline/cheribuild/pycheribuild/projects/run_qemu.py", line 486, in _list_kernel_configs
    for conf in self._valid_kernel_configs():
  File "/cheri/source/mainline/cheribuild/pycheribuild/projects/run_qemu.py", line 482, in _valid_kernel_configs
    return self.source_project.get_kernel_configs(platform=ConfigPlatform.QEMU)
  File "/cheri/source/mainline/cheribuild/pycheribuild/projects/cross/cheribsd.py", line 1711, in get_kernel_configs
    default = super().get_kernel_configs(**filter_kwargs)
  File "/cheri/source/mainline/cheribuild/pycheribuild/projects/cross/cheribsd.py", line 1451, in get_kernel_configs
    assert config is not None, "Invalid configuration name"
AssertionError: Invalid configuration name

Attempting to run (with the various --[...]-roots set correctly, and not shown) without --list-kernels, i.e., .../cheribuild.py [...] --cheribsd-riscv64-purecap/kernel-config=CHERI-CAPREVOKE-QEMU run-riscv64-purecap, I am told

Fatal error: Dependency for run-riscv64-purecap missing: Loader/kernel is missing: /cheri/out/cornucopia-modernize/rootfs-riscv64-purecap/boot/kernel.CHERI-QEMU/kernel

If I replace --cheribsd-rsicv64-purecap with --run-riscv64-purecap/alternative-kernel (i.e., .../cheribuild.py [...] --run-riscv64-purecap/alternative-kernel=CHERI-CAPREVOKE-QEMU run-riscv64-purecap), then I am instead told

Fatal error: Selected kernel configuration CHERI-CAPREVOKE-QEMU is not available

If I happen to pass both --cheribsd-riscv64-purecap/kernel-config and --run-riscv64-purecap/alternative-kernel, I get a slightly different explosion that happens to point at a hackish edit I can make to be able to run my custom kernel again. Specifically, if I take out the attempt at a preflight check at

if self.kernel_config not in self._valid_kernel_configs():
self.fatal("Selected kernel configuration", self.kernel_config, "is not available")
self._list_kernel_configs()

then everything runs as I expect:

$ [...]/cheribuild.py [...] run-riscv64-purecap --run-riscv64-purecap/alternative-kernel=CHERI-CAPREVOKE-QEMU
[...]
FreeBSD 13.0-CURRENT #0 7cfc5c22594c-c337148(HEAD)-dirty: Mon Jul 12 01:50:45 UTC 2021
    daemon@af8c473f038b:/cheri/build/cornucopia-modernize/cheribsd-riscv64-purecap-build/cheri/source/cornucopia-modernize/cheribsd/riscv.riscv64c/sys/CHERI-CAPREVOKE-QEMU riscv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants