On 07/27/15 at 01:03pm, Minfei Huang wrote:
On 07/27/15 at 12:43pm, Dave Young wrote:
> On 07/27/15 at 11:28am, Minfei Huang wrote:
> > On 07/27/15 at 10:23am, Dave Young wrote:
> > > On 07/27/15 at 09:57am, Minfei Huang wrote:
> > > > On 07/27/15 at 08:50am, Dave Young wrote:
> > > > > On 07/25/15 at 04:11pm, Minfei Huang wrote:
> > > > > > On 07/23/15 at 04:47pm, Dave Young wrote:
> > > > > > > On 07/22/15 at 06:20pm, Minfei Huang wrote:
> > > > > > > > Since get_persistent_dev is called in
dracut-module-setup.sh and
> > > > > > > > mkdumprd, we move this lib from mkdumprd to
kdump-lib.sh. Thus
> > > > > > > > dracut-module-setup.sh can use this lib, not the
function in dracut.sh.
> > > > > > > >
> > > > > > > > Copy the function get_persistent_dev from dracut
to make the function
> > > > > > > > consistent.
> > > > > > >
> > > > > > > Cleanup means drop get_presistent_dev function and use
dracut one instead
> > > > > > > of moving it to another file...
> > > > > > Try the way which you points out. It seems difficult to
source the
> > > > > > dracut-functions.sh into mkdumprd, because there are
several variants
> > > > > > which are defined in dracut.sh, such as initdir. In the
other hand,
> > > > > > dracut-functions.sh will source the dracut-logger.sh and
other file.
> > > > I am a bit confused with this patch. IMOP, if there is not heavy
> > > > dependency with other module, self_containing is better.
> > > >
> > > > Also as Vivek reported in bugzilla, moving the common libraries to
> > > > kdump-lib.sh is suggested.
> > >
> > > kdump-lib.sh can have a wrapper, but we should use dracut fuctions
especially
> > > in module-setup.sh. I have posted one patch to dracut so that we can use
> > > dracut-functions.sh. I still do not see what is the difficulty? Can you
post
> > > your error messages?
> > > > > What's the error you see? I think it does not matter, if
there's something
> > > > > which should not be in dracut-functions.sh you can send patch to
dracut
> > > > > list and cleanup. OTOH, the functions mkdumprd uses do not care
about
> > > > > initdir.
> > >
> > > ..
> >
> > Just source the dracut-functions.sh to mkdumprd, without any correction.
> >
> > [root@localhost 99kdumpbase]# kdumpctl restart
> > kexec: unloaded kdump kernel
> > Stopping kdump: [OK]
> > /mnt/var/crash/127.0.0.1-2015-07-22-18:13:42/vmcore
> > Force rebuild /boot/initramfs-3.11.10-301.fc20.x86_64kdump.img
> > Rebuilding /boot/initramfs-3.11.10-301.fc20.x86_64kdump.img
> > initdir not set
> > mkdumprd: failed to make kdump initrd
> > Starting kdump: [FAILED]
> >
> > Once I define the initdir in the mkdumprd, the error message raises like
below:
> >
> > [root@localhost 99kdumpbase]# kdumpctl restart
> > kexec: unloaded kdump kernel
> > Stopping kdump: [OK]
> > Force rebuild /boot/initramfs-3.11.10-301.fc20.x86_64kdump.img
> > Rebuilding /boot/initramfs-3.11.10-301.fc20.x86_64kdump.img
> > logger: unknown facility name: .
> > /usr/lib/dracut/dracut-logger.sh: line 339: ((: 4 <= : syntax error:
operand expected (error token is "<= ")
> > logger: unknown facility name: .
> > /usr/lib/dracut/dracut-logger.sh: line 339: ((: 4 <= : syntax error:
operand expected (error token is "<= ")
> > logger: unknown facility name: .
> > ...
> > kexec: loaded kdump kernel
> > Starting kdump: [OK]
> >
> > Once I have resolved this issue, there is other error message raised.
>
> How did you source dracut-functions.sh? what is your changes?
>
Below is the code which I patched to the mkdumprd.
11 # include the dracut functions
12 [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
13 [[ $dracutfunctions ]] || dracutfunctions=$dracutbasedir/dracut-functions.sh
14
15 [[ $tmpdir ]] || tmpdir=/var/tmp
16 readonly TMPDIR="$tmpdir"
17 readonly initdir="$(mktemp --tmpdir="$TMPDIR/" -d -t
initramfs.XXXXXX)"
18
19 fileloglvl=0
20
21 . $dracutfunctions
Then, kdump service will generate the initramfs successfully, except for some warning.
So dracut-functions need more cleanup, except the functions which do not depend
on dracut variables, all other stuff should be moved to dracut-init.sh below commit
introduced..
commit 777f2db0373ccbc1a44fc2d960ecefbe50195055
Author: Harald Hoyer <harald(a)redhat.com>
Date: Thu Jul 2 15:40:13 2015 +0200
splitup dracut-init.sh from dracut-functions.sh
other tools want to source dracut-functions.sh without any mkdir side
effects.
Thanks
Dave