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

[RFC] Boot refactor #138

Merged
merged 9 commits into from
Oct 20, 2020
Merged

[RFC] Boot refactor #138

merged 9 commits into from
Oct 20, 2020

Conversation

wkz
Copy link
Collaborator

@wkz wkz commented Oct 20, 2020

This series refactors the core of Finit with the goal of giving the user more ability to tailor the system to their liking. As a result, it cuts many lines from main(), making it easier to get an overview of the boot process. The big stuff:

  • Generic cleanup/moving around of dead/misplaced code.

  • Remove all automatic mounting of different filesystems at different points in the boot process; just call out to mount -na and let the user decide on the exact set of filesystems and options.

  • Move udev/mdev stuff out to a plugin that can be disabled and replaced with whatever the user needs (or doesn't need).

I would really like some feedback on the series as it is now, so that we can integrate these changes before going further.

Everything else Finit does related to parsing the incoming arguments
is in conf.c, so it makes sense for this block to also reside there.
Upcoming external plugin support means that even though there are no
internal plugins that depend on this hook, there might be external
ones.
Traditionally, Finit has setup _some_ filesystems that are Nice To
Have (tm), using options that do the Right Thing (tm).

On the one hand, this is very convenient for users that don't
necessarily know what a reasonable mode= value is for /tmp etc. (pun
intended).  It also means that mountpoints can be created if they
don't exist.

On the other hand it means that all users are forced to submit to the
choices made by Finit.  Also, different filesystems where spread out
at many different points in `main()`, meaning that the fact that
`/proc` was available at a given hook point did not imply that `/sys`
was, for example.

Instead, defer _all_ filesystem setup to the user by simply calling
`mount -a`.  We then ship an example `fstab` that shows how to
re-create the old behavior.
Instead of heuristically trying to determine the correct hotplug
daemon to use (mdev/udev), defer to the user to specify it in the
configuration.  Same goes for the built-in watchdog.
No other hook is treated in this fashion, so it seems silly to single
out poor HOOK_BASEFS_UP.
The contents of /etc/finit.conf and friends could potentially change
after mounting /etc/fstab. If, for example, /etc was to be re-mounted
from ro to rw using an overlay filesystem, we want any user changes to
the configuration to take effect.
We want plugins to be able to register themselves at the banner hook
point, but that requires that we have actually loaded them before
then.
This way, the default behavior stays the same, but users can opt out
by disabling the plugin.
@troglobit
Copy link
Owner

No feedback, just looks awesome, great work on this! ❤️

@troglobit troglobit merged commit 378456b into troglobit:master Oct 20, 2020
@wkz wkz deleted the boot-refactor branch October 21, 2020 06:20
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