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