Am 10.01.2012 16:19, schrieb [email protected]:
> From: Cong Wang <[email protected]>
>
> ssh-client module needs a specific parameter, --ssh-key, but
> this parameter is totally useless for other modules. So, introduce
> a way to let users to pass module-specific parameters, that is,
> using colons to separate module name and its parameters, like,
>
> --add ssh-client:sshkey=/root/.ssh/kdump_id_rsa.pub
>
> Cc: [email protected]
> Signed-off-by: Cong Wang <[email protected]>
> ---
> dracut | 30 ++++++++++++++++++++++++++----
> dracut-functions | 14 ++++++++++++--
> dracut.8.xml | 22 ++++++++++++++++++----
> 3 files changed, 56 insertions(+), 10 deletions(-)
Hmm, I would envision another strategy here. Modules could provide a function
for command line parsing.
We could source each module-setup.sh and rename the functions prefixed with the
module name and store them in an array.
Function renaming could be done via:
$ theirfunc() { echo "do their thing"; }
$ eval "$(echo "orig_theirfunc()"; declare -f theirfunc | tail -n +2)"
$ theirfunc() { echo "do my thing"; orig_theirfunc; }
$ theirfunc
do my thing
do their thing
What do you think?
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html