Re: [RFC PATCH 1/2] support adding module-specific parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 10.01.2012 16:19, schrieb xiyou.wangcong@xxxxxxxxx:
> From: Cong Wang <xiyou.wangcong@xxxxxxxxx>
> 
> 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: harald@xxxxxxxxxx
> Signed-off-by: Cong Wang <xiyou.wangcong@xxxxxxxxx>
> ---
>  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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux