On 07/15/16 at 02:57pm, Pratyush Anand wrote:
On 15/07/2016:04:16:17 PM, Xunlei Pang wrote:
> On 2016/07/12 at 13:24, Pratyush Anand wrote:
> > Hi Xunlei,
> >
> > Thanks for your comment.
> >
> > On 11/07/2016:08:42:49 PM, Xunlei Pang wrote:
> >> On 2016/07/11 at 10:47, Pratyush Anand wrote:
> >>> If state of a watchdog device is changed by an user after kdumpctl
restart
> >>> then initramfs must be rebuilt on the basis of new watchdog status.
> >>>
> >>> Testing:
> >>> -------------------------------------------------------
> >>> Initramfs wdt state
> >>> Prev Current Result
> >>> -------------------------------------------------------
> >>> Not Exist NA X Rebuild
> >>> Exist Inact Inact No Rebuild
> >>> Exist Inact Act Force Rebuild
> >>> Exist Act Inact Force Rebuild
> >>> Exist Act Act(Same wdt) No Rebuild
> >>> Exist Act Act(Diff wdt) Force Rebuild
> >>>
> >>> Signed-off-by: Pratyush Anand <panand(a)redhat.com>
> >>> Acked-by: Dave Young <dyoung(a)redhat.com>
> >>> ---
> >>> kdumpctl | 32 ++++++++++++++++++++++++++++++++
> >>> 1 file changed, 32 insertions(+)
> >>>
> >>> diff --git a/kdumpctl b/kdumpctl
> >>> index c8fc54fc7677..12e7aa005c5d 100755
> >>> --- a/kdumpctl
> >>> +++ b/kdumpctl
> >>> @@ -427,6 +427,32 @@ check_dump_fs_modified()
> >>> return 1
> >>> }
> >>>
> >>> +check_wdt_modified()
> >>> +{
> >>> + NOWDT=$(grep ^nowdt $KDUMP_CONFIG_FILE | cut -d' ' -f2)
> >>> + [[ -z $NOWDT ]] || return 0
> >>> + [[ -d /sys/class/watchdog/ ]] || return 0
> >>> +
> >>> + for dir in /sys/class/watchdog/*; do
> >>> + [[ -d "$dir" ]] || continue
> >> If the wdt module was unloaded leaving an empty /sys/class/watchdog/, it
will hit here and return,
> >> then if the initramfs contains any wdt, I think we will miss a necessary
rebuild.
> > Yes, you are right, I did not consider this test case. But not sure, how to
> > check that. Because, when there was not any directory in /sys/class/watchdog/,
> > then we must rebuild if there is any watchdog driver in kdump kernel initrd,
> > which is not easy to check.
> > So, either we need to keep a variable in initrd which tells us that there
> > exists atleast one watchdog module in initrd.
> > OR, we can leave it as it is, because I do not see any disadvantage even when
a
> > watchdog module is added for inactive wdt (In fact we add iTCO_wdt currently
> > without checking its state).
>
>
> Can we utilize "etc/cmdline.d/00-watchdog.conf" to achieve this?
I think yes. A non-empty etc/cmdline.d/00-watchdog.conf or even its existence
will reflect that there is atleast one active wdt.
Thanks!! Will send a topup patch.
Pratyush, if you will send a new version, care to update the depends() in
module-setup.sh so that we can depends on wdt only when we need instead of
always add wdt dracut module? Though it only adds several hundreds Kb but
ideally we should only add it when we need it.
Thanks
Dave