On 07/05/2017 at 08:59 PM, Hari Bathini wrote:
Hi Dave,
Thanks for looping me in.
On Wednesday 05 July 2017 08:56 AM, Dave Young wrote:
> Cc Hari for fadump part.
>
> On 07/04/17 at 01:45pm, Xunlei Pang wrote:
>> Resolves: bz1451717
>>
https://bugzilla.redhat.com/1451717
>>
>> When there is no crypt related kdump target, we can safely
>> omit "crypt" dracut module, this can avoid the pop asking
>> disk password during kdump boot in some cases.
>>
>> Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
>> ---
>> kdump-lib.sh | 12 ++++++++++++
>> kdumpctl | 12 ------------
>> mkdumprd | 26 ++++++++++++++++++++++++++
>> 3 files changed, 38 insertions(+), 12 deletions(-)
>>
>> diff --git a/kdump-lib.sh b/kdump-lib.sh
>> index 6b112a4..c09248d 100755
>> --- a/kdump-lib.sh
>> +++ b/kdump-lib.sh
>> @@ -6,6 +6,7 @@
>> DEFAULT_PATH="/var/crash/"
>> FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
>> FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
>> +FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
>> perror_exit() {
>> echo $@ >&2
>> @@ -485,3 +486,14 @@ get_dracut_args_target()
>> {
>> echo $1 | grep "\-\-mount" | sed "s/.*--mount
.\(.*\)/\1/" | cut -d' ' -f1
>> }
>> +
>> +is_fadump_capable()
>> +{
>> + # Check if firmware-assisted dump is enabled
>> + # if no, fallback to kdump check
>> + if [ -f $FADUMP_ENABLED_SYS_NODE ]; then
>> + rc=`cat $FADUMP_ENABLED_SYS_NODE`
>> + [ $rc -eq 1 ] && return 0
>> + fi
>> + return 1
>> +}
>> diff --git a/kdumpctl b/kdumpctl
>> index fb4112e..8c57f5f 100755
>> --- a/kdumpctl
>> +++ b/kdumpctl
>> @@ -13,7 +13,6 @@ DUMP_TARGET=""
>> DEFAULT_INITRD=""
>> DEFAULT_INITRD_BAK=""
>> TARGET_INITRD=""
>> -FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
>> FADUMP_REGISTER_SYS_NODE="/sys/kernel/fadump_registered"
>> #kdump shall be the default dump mode
>> DEFAULT_DUMP_MODE="kdump"
>> @@ -934,17 +933,6 @@ handle_mode_switch()
>> fi
>> }
>> -is_fadump_capable()
>> -{
>> - # Check if firmware-assisted dump is enabled
>> - # if no, fallback to kdump check
>> - if [ -f $FADUMP_ENABLED_SYS_NODE ]; then
>> - rc=`cat $FADUMP_ENABLED_SYS_NODE`
>> - [ $rc -eq 1 ] && return 0
>> - fi
>> - return 1
>> -}
>> -
>> check_current_fadump_status()
>> {
>> # Check if firmware-assisted dump has been registered.
>> diff --git a/mkdumprd b/mkdumprd
>> index 0fe1b30..0bd724c 100644
>> --- a/mkdumprd
>> +++ b/mkdumprd
>> @@ -382,6 +382,30 @@ check_crypt()
>> return 1
>> }
>> +omit_dracut_modules()
>> +{
>> + local target majmin
>> + local has_crypt
>> +
>> + # Skip fadump case
>> + is_fadump_capable && return
> We have other default omitted modules in mkdumprd, seems fadump works
> well with it. Does that means we can omit below modules as well for
> fadump?
Since fadump initrd is the same as default initrd, I think the patch is doing the
Hi Hari,
Thanks for the comments.
I did some code review, and found that the fadump initramfs generated by kexec-tools
is not the same as default initrd, for example, kdump uses the following dracut cmd
to generate(with --rebuild) initramfs:
dracut --hostonly --hostonly-cmdline --hostonly-i18n -o plymouth dash resume ifcfg -f
/boot/initramfs-3.10.0-691.el7.ppc64le.img.tmp
--rebuild /boot/initramfs-3.10.0-691.el7.ppc64le.img --kver 3.10.0-691.el7.ppc64le -i
/tmp/fadump.initramfs /etc/fadump.initramfs
1) original initramfs
Image: .initramfs-3.10.0-691.el7.ppc64le.img.default: 21M
========================================================================
Version: dracut-033-502.el7
Arguments: -f
dracut modules:
bash
nss-softokn
i18n
network
ifcfg
drm
plymouth
dm
kernel-modules
lvm
resume
rootfs-block
terminfo
udev-rules
systemd
usrmount
base
fs-lib
shutdown
2) kdump initramfs used by fadump
Image: initramfs-3.10.0-691.el7.ppc64le.img: 19M
========================================================================
Version: dracut-033-502.el7
Arguments: -f --hostonly --hostonly-cmdline --hostonly-i18n -o 'plymouth dash resume
ifcfg' -f --kver '3.10.0-691.el7.ppc64le' --include
'/tmp/fadump.initramfs' '/etc/fadump.initramfs'
dracut modules:
bash
nss-softokn
i18n
network
dm
kernel-modules
lvm
rootfs-block
terminfo
udev-rules
systemd
usrmount
base
fs-lib
kdumpbase
shutdown
Do you think there is a problem that the two are a little different(especially with the
extra "--hostonly" and -o 'plymouth dash resume ifcfg')?
Regards,
Xunlei
right thing by skipping omission of crypt module in fadump mode.
> In fadump howto, it says there is some dracut changes to add kdump
> module to default initrd, but I do not find where is the dracut chagnes.
> I do not find anything in dracut repo..
dracut-module-setup.sh & mkdumprd files in kexec-tools repo have the relevant
change.
When IN_KDUMP is set to '1', kdump module is inserted out-of-tree into initrd.
With mkdumprd script exporting "IN_KDUMP=1" environment variable and kdumpctl
script
calling mkdumprd to make the initrd, kdump module is included in kdump initrd in
kdump mode and default initrd in fadump mode.
Thanks
Hari