On 02/20/2014 09:22 AM, Mahesh Jagannath Salgaonkar wrote:
On 02/20/2014 07:34 PM, Marc Milgram wrote:
> On 02/20/2014 02:35 AM, Hari Bathini wrote:
>> The script dracut-kdump.sh is responsible for capturing vmcore during
>> second kernel boot. Currently this script gets installed into kdump
>> initrd as part of kdumpbase dracut module. Since it's always installed
>> into kdump initrd, this script assumes that '/proc/vmcore' will always
>> be present when it is invoked.
>> With fadump support, 'dracut-kdump.sh' script also gets installed into
>> default initrd to capture vmcore generated by firmware assisted dump.
>> Thus in fadump case, the same initrd is going to be used for normal
>> boot as well as boot after system crash. Hence a check is required to
>> see if '/proc/vmcore' file exists before executing steps to capture
>> vmcore. This check will help to bypass the vmcore capture steps during
>> normal boot process.
>> Signed-off-by: Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
>> Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
>> dracut-kdump.sh | 3 +++
>> 1 file changed, 3 insertions(+)
>> diff --git a/dracut-kdump.sh b/dracut-kdump.sh
>> index d9e65ac..9634740 100755
>> --- a/dracut-kdump.sh
>> +++ b/dracut-kdump.sh
>> @@ -1,5 +1,8 @@
>> +# continue only if /proc/vmcore is present.
>> +[ ! -f /proc/vmcore ] && return
>> exec &> /dev/console
>> . /lib/dracut-lib.sh
>> . /lib/kdump-lib.sh
> Could we add an error message as to why kdump failed?
This is not an error case. In fadump case, same initrd will be used for
normal boot as well as boot after crash. In normal boot case, you won't
have /proc/vmcore file present, hence we silently skip entire vmcore
capture step in normal boot.
Thanks for the explanation.