Skip to content

Read config file snippets from limine.d #496

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

Draft
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

marv7000
Copy link
Contributor

This PR adds support for split config files located in a limine.d directory.

TODOs:

  • readdir for FAT
  • readdir for ISO9960
  • readdir for TFTP

@lzcunt
Copy link
Contributor

lzcunt commented Apr 13, 2025

How is config file hash validation going to work with this?

How will entry ordering work, which is also important for setting the default entry? Will global keys set by drop-ins be overwritten by drop-ins with a higher priority? Will drop-ins be able to set global keys at all?

IMO adding a new drop-in should not cause the default entry to change due to all the indexes moving around. The entry index could be scoped to the file to prevent that, but that won't work with a simple concatenation of all files. Maybe the entry index for the default entry could be replaced by a unique entry key/id instead (defaulting to the entry name, but could be overwritten with an entry option)

BTW thanks for this PR, this is something I'm looking forward to

@marv7000
Copy link
Contributor Author

The easiest way would be to just have limine.conf hold a hash that also contains all limine.d entries. That way you can also validate that there aren't any unwanted changes to any of the files.

Drop-ins can set global keys without any problem. That way you could have a file that contains only variable declarations.

Maybe the default entry selection could be done by name rather than by index. But I'm not too sure about that.

@lzcunt
Copy link
Contributor

lzcunt commented Apr 13, 2025

The easiest way would be to just have limine.conf hold a hash that also contains all limine.d entries. That way you can also validate that there aren't any unwanted changes to any of the files.

We could implement that logic in the host tool, rather than polluting limine.conf. As in, the host tool could hash all the drop-ins and the limine.conf file together, then bake that into the EFI executable.

Drop-ins can set global keys without any problem. That way you could have a file that contains only variable declarations.

Cool

Maybe the default entry selection could be done by name rather than by index. But I'm not too sure about that.

By name could cause issues, e.g. sub-entries could reasonably have the same name but different parents. So we should have unique identifiers/keys for entries if we want to do this. I think systemd-boot does it this way too? But they also have a lot more complicated sorting mechanisms.

@marv7000
Copy link
Contributor Author

As in, the host tool could hash all the drop-ins and the limine.conf file together, then bake that into the EFI executable.

Yes, that was what I meant.

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

Successfully merging this pull request may close these issues.

2 participants