[arch-dev-public] [PATCH] Implement a hook-system that allows to add custom code to the initscripts at certain places

Roman Kyrylych roman.kyrylych at gmail.com
Tue Aug 25 14:02:08 EDT 2009

On Tue, Aug 25, 2009 at 14:03, Thomas Bächler<thomas at archlinux.org> wrote:
> A function add_hook can be called from functions.d to register a hook
> function. The existing hooks are based on suggestions from Michael Towers
> (larch) and on the implementation of initscripts-extras-fbsplash which
> currently uses the strings passed to stat_busy and stat_done for this. More
> hooks can be added if requested.
> The implementation uses associative arrays and will thus only work with bash
> 4 or later.
> The changes have been commited to initscripts.git, but have not yet been
> extensively tested, only basic functionality tests have been performed:
> http://projects.archlinux.org/?p=initscripts.git;a=commitdiff;h=cfabb85924f35c636550609b332d088aaae9941f
> This should make life easier for larch (not exactly sure what they need it
> for) and will make initscripts-extras-fbsplash much cleaner to implement.
> Don't hesitate to request more hooks here.
> A description of the existing hooks is in rc.d/functions.

I don't know much about how larch is going to use this,
but it is certainly the way to go for splash stuff.

Long time ago when I did some work on splash-related stuff
I had a splash branch that added a couple of new stat_* calls
in some extra places (similar to where Thomas' run_hooks are).
These stat_* calls were supposed to be dummy functions
in rc.d/functions and redefined in functions.d/*
which was kind of ugly.

Thomas' proposal looks like a more correct way IMO.

Roman Kyrylych (Роман Кирилич)

More information about the arch-dev-public mailing list