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

Set fixed conditions in device tree? #311

Closed
hongkongkiwi opened this issue Nov 7, 2022 · 2 comments
Closed

Set fixed conditions in device tree? #311

hongkongkiwi opened this issue Nov 7, 2022 · 2 comments
Assignees
Milestone

Comments

@hongkongkiwi
Copy link
Contributor

hongkongkiwi commented Nov 7, 2022

I would like to set some conditions in finit based on whats in the device tree.

This way certain services can be started based on hardware configuration.

Do you think a finit plugin is the best task for this or do you think it makes sense to have this as a built in feature? If it's in a finit plugin, could you give me a code snipped to set a condition at an early stage? (I would like to set these just after fs are mounted)

e.g. have a finit section in the dtb:

finit {
   conditions={
      conditiona;
      conditionb;
      conditionc;
   };
};
@troglobit
Copy link
Owner

troglobit commented Nov 7, 2022

It could definitely be a plugin, but I don't think you'll need it.

At $OLDJOB we did this, which was pretty neat. The first two links is the common call to set up a static/one-shot condition based on the product model and the third is an example of how to use it:

Remember, static/one-shot conditions are always asserted, following the current configuration generation.

@troglobit troglobit added this to the 4.4 milestone Nov 7, 2022
@troglobit troglobit self-assigned this Nov 7, 2022
@troglobit
Copy link
Owner

I've added this to the v4.4 release with the intent of documenting the above trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants