On Wed, Mar 27, 2019 at 11:28 AM Dave Young <dyoung(a)redhat.com> wrote:
Hi Hari,
On 03/26/19 at 11:23pm, Hari Bathini wrote:
> Hi Dave,
>
>
> On 25/03/19 11:17 AM, Dave Young wrote:
> > Ccing Hari for the dump mode issue.
> >
> > On 03/13/19 at 08:28pm, Kairui Song wrote:
> > > Use "kdumpctl rebuild" to rebuild the image directly. This could
help
> > > admins to rebuild kdump image directly.
> > >
> > > Signed-off-by: Kairui Song <kasong(a)redhat.com>
> > > ---
> > > kdumpctl | 26 +++++++++++++++++++++++++-
> > > 1 file changed, 25 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/kdumpctl b/kdumpctl
> > > index 1cfbe31..e223224 100755
> > > --- a/kdumpctl
> > > +++ b/kdumpctl
> > > @@ -1141,6 +1141,27 @@ stop()
> > > return 0
> > > }
> > > +rebuild() {
> > > + setup_initrd
> > > + if [ $? -ne 0 ]; then
> > > + return 1
> > > + fi
> > > +
> > > + if [[ ! -w "$KDUMP_BOOTDIR" ]];then
> > > + echo "$KDUMP_BOOTDIR does not have write permission. Can
not rebuild $TARGET_INITRD"
> > > + return 1
> > > + fi
> > > +
> > > + handle_mode_switch
> > > + if [ $? -ne 0 ]; then
> > > + return 1
> > > + fi
> > Maybe handle_mode_switch can be moved to rebuild_initrd()
> > then we do not need it in this function.
>
> IIUC, remove handle_mode_switch() function call here and check_rebuild() functions
and
> call it from rebuild_initrd() instead..? That change is likely to ignore scenario
where
> a rebuild is not necessary (no change in /etc/kdump.conf file) but a restore is
needed
> when we switch from FADump to KDump? We may eventually restore when initrd is
rebuilt
> though...
>
Hmm, then maybe move it to setup_initrd? In setup_initrd, we have the
if else for dump mode then we can just move to backup/restore there and
drop this handle_mode_switch function.
And the -w -w "$KDUMP_BOOTDIR" can be moved to rebuild_initrd(), kairui?
Hi, Dave, just one thing, move handle_mode_switch to setup_initrd this
will make "kdumpctl reload" possible trigger a backup / restore but
don't rebuild anything, doesn't seems very reasonable.
Currently kdumpctl reload is not behaving very well on mode switch
anyway (may fail silently on normal->fadump switch or error out on
fadump->normal), but after all user should really trigger a rebuild
after mode change.
The -w "$KDUMP_BOOTDIR" could be moved to rebuild_initrd indeed, that
should be good.
--
Best Regards,
Kairui Song