Re: [PATCH V2 dracut 2/2] watchdog: install module for active watchdog

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

 



On 03/04/16 at 09:45am, Pratyush Anand wrote:
> Hi Dave,
> 
> On 04/03/2016:11:13:34 AM, Dave Young wrote:
> > Hi, Pratyush
> > 
> > [snip]
> > > 
> > > Signed-off-by: Pratyush Anand <panand@xxxxxxxxxx>
> > > Cc: Dave Young <dyoung@xxxxxxxxxx>
> > > Cc: Don Zickus <dzickus@xxxxxxxxxx>
> > > Cc: Harald Hoyer <harald@xxxxxxxxxx>
> > > ---
> > >  modules.d/04watchdog/module-setup.sh | 33 +++++++++++++++++++++++++++++++++
> > >  1 file changed, 33 insertions(+)
> > > 
> > > diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh
> > > index 7ec757aec032..6232afb0d9ca 100755
> > > --- a/modules.d/04watchdog/module-setup.sh
> > > +++ b/modules.d/04watchdog/module-setup.sh
> > > @@ -32,3 +32,36 @@ install() {
> > >      inst_multiple -o wdctl
> > >  }
> > >  
> > > +installkernel() {
> > > +    cd /sys/class/watchdog
> > > +    for dir in */; do
> > > +	    cd $dir
> > > +	    active=`[ -f state ] && cat state`
> > > +	    if [ "$active" =  "active" ]; then
> > > +		    # applications like kdump need to know that, which
> > > +		    # watchdog modules have been added into initramfs
> > > +		    echo `cat identity` >> "$initdir/tmp/active-watchdogs"
> > > +		    # device/modalias will return driver of this device
> > 
> > Seems I do not find where the identiy being used..
> 
> Yes, as stated in comment it is being used by kdump.
> https://github.com/pratyushanand/kexec-tools/commit/88c2c9c931c6d2acc68bdd0adf9ac04a93a1a864#diff-c8f5f515755d435842acf0793a131c28R345
> 
> > 
> > OTOH if we use it in kdump module, we should find it in kdump module code instead
> > of depending on the tmp file created by wdt module.
> 
> Unfortunately, I do not see any nice way to do it in kdump until we replicate
> almost all of this code (except module installation) again in kdump. In kdump
> dracut module we will have to parse each directory in sysfs again to determine
> active watchdogs, and then putting all this stuff in watchdog dracut is almost
> useless for kdump.
> 
> Another implementation which has occurred to me was as follows:
> is_wdt_modified() of kdump can rely on "driver name" instead of "identity". For
> example if watchdog module installs mei_me then is_wdt_modified() just looks for
> a filename  in initrd having "mei_me" string in it. But I am not sure about it.
> Same string might be present in other name as well. 
> 
> However, if we can get full path of ".ko" from module name easily, that would be
> helpful.

Ok, got it. But from design point of view is sounds odd. Maybe adding a function
to dracut-functions.sh will help us? Previously we changed dracut-functions.shso
that it can be used other external scripts, see below dracut commit:
777f2db0373ccbc1a44fc2d960ecefbe50195055

Thanks
Dave
--
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