Am 10.01.2012 16:19, schrieb xiyou.wangc...@gmail.com:
> From: Cong Wang <xiyou.wangc...@gmail.com>
> 
> 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: har...@redhat.com
> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com>
> ---
>  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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to