FS#14569 - [initscripts] Modular rc.sysinit
Attached to Project:
Arch Linux
Opened by Elifarley (elifarley) - Monday, 04 May 2009, 03:37 GMT
Last edited by Aaron Griffin (phrakture) - Monday, 18 January 2010, 23:26 GMT
Opened by Elifarley (elifarley) - Monday, 04 May 2009, 03:37 GMT
Last edited by Aaron Griffin (phrakture) - Monday, 18 January 2010, 23:26 GMT
|
Details
I have a suggestion that may simplify modifying system
initialization, by using something we could call SIMs (for
SysInit Modules).
A SIM could simplify system initialization by spliting file rc.sysinit into modules, which could then be enabled or disabled in rc.conf. By having system initialization modules as separate files, it could be easier for people to improve the overall process. I have attached the relevant files (which I'm using in my ArchLinux installation) so that you guys can have a hands-on experience. |
This task depends upon
Closed by Aaron Griffin (phrakture)
Monday, 18 January 2010, 23:26 GMT
Reason for closing: Implemented
Additional comments about closing: Somewhat covered by the initscripts hook system.
Monday, 18 January 2010, 23:26 GMT
Reason for closing: Implemented
Additional comments about closing: Somewhat covered by the initscripts hook system.
This would make hooking in stuff like Fbsplash and similar much more clean and easy. Looking forward for this... :)
The fbsplash overriding was expected to be done via functions in functions.d - if we need more things split into functions, that would be a better approach.
But this scheme seems like overkill. Now, *some* modularity wouldn't be a bad thing, but I don't want to turn all of sysinit into individual modules that people can disable willy-nilly like this
We need to check against various stat_busy message texts there to start/control/stop the daemon. Additionally I needed to duplicate the CONSOLEFONT stuff to move it at the end of the boot because it destroys the splash screen.
When talking about a 'simple progress bar' I would agee, bit it isn't a 'simple progress bar', it is Fbsplash ! All the script does is hooking into splash-functions.sh from upstream which provides a sophisticated event framework with things like a message log within the splash screen which can be toggled using the keyboard, drawing icons for services starting/stopping/failing, event hooks for scripts provided by the themes and such. The additional complexity was introduced for some kind of translation or abstraction, because there are no real services to hook in on ArchLinux, just rc scripts containing any number of stat_{busy,done,fail}. The rest are some options I added - freedom of art ;) - and some workarounds. I like ArchLinux because it's simple and that means it's even simple to get complex and broken stuff to run on it. (... like some bloated broken DEs, but thats a different story ;)
On the one hand I understand your concerns about people fiddling with sysinit modules but on the other hand the only thing they have to do by now to mess up sysint is to go into the wiki, search for 'faster boot' and start editing rc.sysinit. So why not give them more freedom ?
I see that this would be useful to fbsplash, but that's it - it's only useful to fbsplash. In all other cases, it's unneeded complexity.
I'd like to see some middle ground here, perhaps by simply adding some sort of "event hooks" into the existing rc.sysinit that would help out fbsplash, but also not overcomplicate the boot process (one the the things the reviews always seem to praise about Arch is the simplistic boot process)
When it comes to Fbsplash we would need to add event hooks at the following points AFAIKS:
in rc.sysinit:
- After proc is mounted and before the first stat_busy to be able to parse the kernel cmdline, mount a tmpfs and cache any messages/fails until the daemon can be started.
- Right after starting udevd to be able to trigger and settle the tty and graphics stuff and start up the daemon early.
- After all udev uevents are triggered and settled to get the keyboard event device.
in rc.shutdown:
- When sending sigterm to be able to restart the daemon.
- When sending sigkill for the same reason.
- Before remounting the root fs readonly to be able to save some info if needed.
- Before the actual power off or reboot to be able to shutdown the splash with a nice fadeout effect.
* Everything on by default. I don't like the list in rc.conf - perhaps just some way to disable or replace existing modules? Or just use everything in a given directory?
* Less modules, coarser grained
Lets see where we get with that. I would like to get something like this into the initscripts, but the existing implementation seems to go a little crazy :)