Commit Graph

369 Commits

Author SHA1 Message Date
WANG Chao d2d16f0521 update to kdump-anaconda-addon-002.tar.gz
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-08-21 10:32:08 +08:00
WANG Chao 890d2fabf4 spec: install udev rules 98-kexec.rules to /usr/lib not /etc
Resolves: rhbz#1131169

Zbigniew (systemd developer) pointed out that our udev rules should
install to /usr/lib/ not /etc. Because /etc is supposed to be used by
sysadmins only and package should install by default into /usr/lib.

As advised here:
http://www.freedesktop.org/software/systemd/man/udev.html#Rules%20Files

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-08-21 10:31:52 +08:00
Peter Robinson e46e590cf9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild 2014-08-16 23:35:59 +00:00
WANG Chao b17977dfb8 Release 2.0.7-5
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-08-06 12:06:04 +08:00
WANG Chao 2276b8561c Introduce kdump capture service
This patch introduce a new kdump-capture.service which is used to run
kdump.sh.

kdump-capture.service has OnFailure=emergency.target and
OnFailureIsolate=yes set. When kdump.sh fails, the kdump emergency
service will be triggered and enter the error handling path.

In 2nd kernel, the default target for systemd is initrd.target, so we
put kdump-capture.service in initrd.target.wants/ and by that, system
will start kdump-capture as part of the boot process.

kdump.sh used to run in dracut-pre-pivot hook. Now kdump-capture.service
is placed after dracut-pre-pivot.service and other dependencies are all
copied from dracut-pre-pivot.service. So the start point of
kdump.sh will be almost the same as it used to be.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2014-08-05 13:13:32 +08:00
WANG Chao 002337c671 Introduce kdump error handling service
Now upon failure kdump script might not be called at all and it might
not be able to execute default action. It results in a hang.

Because we disable emergency shell and rely on kdump.sh being invoked
through dracut-pre-pivot hook. But it might happen that we never call
into dracut-pre-pivot hook because certain systemd targets could not
reach due to failure in their dependencies. In those cases error
handling code does not run and system hangs. For example:

sysroot-var-crash.mount --> initrd-root-fs.target --> initrd.target \
  --> dracut-pre-pivot.service --> kdump.sh

If /sysroot/var/crash mount fails, initrd-root-fs.target will not be
reached. And then initrd.target will not be reached,
dracut-pre-pivot.service wouldn't run. Finally kdump.sh wouldn't run.

To solve this problem, we need to separate the error handling code from
dracut-pre-pivot hook, and every time when a failure shows up, the
separated code can be called by the emergency service.

By default systemd provides an emergency service which will drop us into
shell every time upon a critical failure. It's very convenient for us to
re-use the framework of systemd emergency, because we don't have to
touch the other parts of systemd. We can use our own script instead of
the default one.

This new scheme will overwrite emergency shell and replace with kdump
error handling code. And this code will do the error handling as needed.
Now, we will not rely on dracut-pre-pivot hook running always. Instead
whenever error happens and it is serious enough that emergency shell
needed to run, now kdump error handler will run.

dracut-emergency is also replaced by kdump error handler and it's
enabled again all the way down. So all the failure (including systemd
and dracut) in 2nd kernel could be captured, and trigger kdump error
handler.

dracut-initqueue is a special case, which calls "systemctl start
emergency" directly, not via "OnFailure=emergency". In case of failure,
emergency is started, but not in a isolation mode, which means
dracut-initqueue is still running. On the other hand, emergency will
call dracut-initqueue again when default action is dump_to_rootfs.
systemd would block on the last dracut-initqueue, waiting for the first
instance to exit, which leaves us hang. It looks like the following:

dracut-initqueue (running)
  --> call dracut-emergency:
    --> dracut-emergency (running)
      --> kdump-error-handler.sh (running)
        --> call dracut-initqueue:
          --> blocking and waiting for the original instance to exit.

To fix this, I'd like to introduce a wrapper emergency service. This
emegency service will replace both the systemd and dracut emergency. And
this service does nothing but to isolate to real kdump error handler
service:

dracut-initqueue (running)
  --> call dracut-emergency:
    --> dracut-emergency isolate to kdump-error-handler.service
      --> dracut-emergency and dracut-initqueue will both be stopped
          and kdump-error-handler.service will run kdump-error-handler.sh.

In a normal failure case, this still works:
foo.service fails
  --> trigger emergency.service
    --> emergency.service isolates to kdump-error-handler.service
      --> kdump-error-handler.service will run kdump-error-handler.sh

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2014-08-05 13:13:32 +08:00
WANG Chao 3b27570bea cleanup: extract functions from kdump.sh to kdump-lib-initramfs.sh
Extract functions from kdump.sh, and construct kdump-lib-initramfs.sh as
kdump common functions/varaibles library.

kdump-lib-initramfs.sh will include kdump-lib.sh, because it will use
the functions from there. IOW, kdump-lib-initramfs.sh will be a superset
of kdump-lib.sh

So after this cleanup:

- scripts running in 1st kernel only have to include kdump-lib.sh
- scripts running in 2nd kernel only have to include kdump-lib-initramfs.sh

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2014-08-05 13:13:11 +08:00
WANG Chao 0b63f4a522 Release 2.0.7-4
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-07-24 13:01:19 +08:00
WANG Chao 10b2ee22ef kdump-anaconda-addon: update to kdump-anaconda-addon-001-4-g03898ef.tar.gz
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-07-24 12:56:57 +08:00
WANG Chao 61fcf06f98 Release 2.0.7-3
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-07-21 14:50:43 +08:00
WANG Chao a87b9ff7ef Update kexec-tools-anaconda-addon
update to kdump-anaconda-addon-20140721.tar.gz

Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-07-21 14:49:13 +08:00
WANG Chao 993961a411 Fix a typo in %changelog
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-07-16 15:10:00 +08:00
WANG Chao c45783a2c3 Release 2.0.7-2
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-07-16 14:59:13 +08:00
Baoquan He e5769870b1 Stop maximizing the bitmap buffer to reduce the risk of OOM.
This is a backport of the following upstream commit.

commit 0b732828091a545185ad13d0b2e6800600788d61
Author: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Date:   Tue Jun 10 13:57:29 2014 +0900

    [PATCH 3/3] Stop maximizing the bitmap buffer to reduce the risk of OOM.

    We tried to maximize the bitmap buffer to get the best performance,
    but the performance degradation caused by multi-cycle processing
    looks very small according to the benchmark on 2TB memory:

      https://lkml.org/lkml/2013/3/26/914

    This result means we don't need to make an effort to maximize the
    bitmap buffer, it will just increase the risk of OOM.

    This patch sets a small fixed value (4MB) as a safety limit,
    it may be safer and enough in most cases.

    Signed-off-by: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-07-16 14:57:21 +08:00
Baoquan He 23d1c25fd5 Move counting pfn_memhole for cyclic mode.
This is a backport of the following upstream commit.

commit 2648a8f7caa63e3ec82fd4bce471cec0a895b704
Author: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Date:   Mon Jun 9 17:48:30 2014 +0900

    [PATCH 2/3] Move counting pfn_memhole for cyclic mode.

    In cyclic mode, memory holes are checked in initialize_2nd_bitmap_cyclic()
    in both the kdump path and the ELF path, so pfn_memhole should be
    counted there.

    Signed-off-by: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-07-16 14:57:18 +08:00
Baoquan He 0bb00b495b Remove the 1st bitmap buffer from the ELF path in cyclic mode.
This is a backport of the following upstream commit.

commit 16b94ab7fad6744d8b77f2b26838f220307e3118
Author: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Date:   Mon Jun 9 17:44:43 2014 +0900

    [PATCH 1/3] Remove the 1st bitmap buffer from the ELF path in cyclic mode.

    We can create the 2nd bitmap without creating the 1st bitmap by commit
    363d53fc8, so we don't need to create the 1st bitmap in cyclic mode
    in the ELF path since it isn't used. Thus, we can use the whole bitmap
    buffer only for the 2nd bitmap like the kdump path.

    Signed-off-by: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-07-16 14:57:15 +08:00
Baoquan He 598e09b6b6 Fix free bitmap_buffer_cyclic error.
This is a backport of the following upstream commit. It is about freeing
the wrong bitmap thing, it could increase the risk of OOM when system is
in an edge of OOM.

commit 0e7b1a6e3c1919c9222b662d458637ddf802dd04
Author: Arthur Zou <zzou@redhat.com>
Date:   Wed May 7 17:54:16 2014 +0900

    [PATCH v3] Fix free bitmap_buffer_cyclic error.

    Description:
    In create_dump_bitmap() and write_kdump_pages_and_bitmap_cyclic(),
    What should be freed is info->partial_bitmap instead of info->bitmap.

    Solution:
    Add two functions to free the bitmap_buffer_cyclic. info->partial_bitmap1
    is freed by free_bitmap1_buffer_cyclic(). info->partial_bitmap2 is
    freed by free_bitmap2_buffer_cyclic(). At the same time, remove
    thoes frees that free partial_bitmap1 or partial_bitmap2 at the end
    of main() because partial_bitmap1 and partial_bitmap2 has been freed
    after dump file has been written out, so there is no need to free it
    again at the end of main.

    Signed-off-by: Arthur Zou <zzou@redhat.com>

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-07-16 14:57:00 +08:00
Baoquan He 46a8fa94aa Introduce the mdf_pfn_t type.
This is a backport of the following upstream commit. Late back ported
commit depends on it.

commit 9dc6440c63320066bc6344c6e3ca3c3af88bcc42
Author: Petr Tesarik <ptesarik@suse.cz>
Date:   Thu Apr 24 10:58:43 2014 +0900

    [PATCH v3] Introduce the mdf_pfn_t type.

    Replace unsigned long long with mdf_pfn_t where:

      a. the variable denotes a PFN
      b. the variable is a number of pages

    The number of pages is converted to a mdf_pfn_t, because it is a result
    of subtracting two PFNs or incremented in a loop over a range of PFNs,
    so it can get as large as a PFN.

    Note: The mdf_ (i.e. makedumpfile) prefix is used to prevent possible
    conflicts with other software that defines a pfn_t type.

    Signed-off-by: Petr Tesarik <ptesarik@suse.cz>

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com
2014-07-16 14:56:41 +08:00
WANG Chao 33736ef595 makedumpfile: Fix Makefile for eppic_makedumpfile.so build
Backport from the following commit from upstream makedumpfile:

commit 45fc42c
Author: WANG Chao <chaowang@redhat.com>
Date:   Tue Jun 10 14:11:27 2014 +0900

    [PATCH] Fix Makefile for eppic_makedumpfile.so build.

    When libeppic isn't installed on a standard location, building
    eppic_makedumpfile.so with -leppic directly doesn't work.

    Add LDFLAGS to build arguments, so that one can pass LDFLAGS="-Ldir
    -Idir" to tell where to search for libeppic library and its header
    files.

    For example, if eppic source is installed on the same directory level
    with makedumpfile as the following:

    makedumpfile
     |--- arch
     +--- eeppic_scripts
    eppic
     |--- applications
     +--- libeppic

    After compiling libeppic, one can use the following command to build
    eppic_makedumpfile.so:

    make LDFLAGS="-I../eppic/libeppic -L../eppic/libeppic" eppic_makedumpfile.so

    Signed-off-by: WANG Chao <chaowang@redhat.com>

With this patch, we don't need use a fedora-specific patch for building
eppic_makedumpfile.so.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-06-13 13:17:56 +08:00
WANG Chao 2db8de3c8a kexec-tools.spec: add changelog
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-06-10 11:24:55 +08:00
WANG Chao 85ee62fdd1 Release 2.0.7-1
Rebase kexec-tools-2.0.7

Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-06-10 11:20:36 +08:00
Dennis Gilmore 3a560f19ab - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 2014-06-07 21:17:21 -05:00
WANG Chao 40ce1a4ece Release 2.0.6-8
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-05-22 18:33:02 +08:00
Arthur Zou 2553056c74 Rename the subpackage kdump-anaconda-addon
Rename the subpackage kdump-anaconda-addon to kexec-tools-anaconda-addon
to keep consistency and make fedpkg build happy

Because every time fedpkg builds a new release the package version number
should increase. But kdump-annaconda-addon just keep same version, so let's
rename it to kexec-tools-annaconda-addon here kexec-tools- is a default prefix.
For version let's use default top level version.

At the same time, rename the kdump-anaconda-addon directory name to anaconda-addon
to make it more standard. Using the current data instead of version number as a
surfix of kdump-anaconda-addon tarball just like kexec-tools-po did.

Signed-off-by: Arthur Zou <zzou@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2014-05-22 18:32:43 +08:00
WANG Chao 4742c0fb6b Release 2.0.6-7
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-05-21 17:33:00 +08:00
WANG Chao f6eaa4e227 spec: fix a typo in "Requires" of kexec-tools-eppic
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-05-21 17:32:23 +08:00
WANG Chao f765f060c8 Release 2.0.6-6
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-05-20 16:48:13 +08:00
WANG Chao e4cf7a9282 spec: kexec-tools-eppic requires the same version/release of kexec-tools
makedumpfile_eppic.so (provided by kexec-tools-eppic) is built against
makedumpfile (provided by kexec-tools). kexec-tools-eppic must depend on
the same version.release of kexec-tools, otherwise there could be a ABI
compatibility issue.

Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-05-20 16:18:42 +08:00
Arthur Zou 8f963f3318 Modify the kexec-tools.spec file to generate a kdump-anaconda-addon subpackage
Signed-off-by: Arthur Zou <zzou@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2014-05-20 16:05:58 +08:00
WANG Chao 649f83713e Release 2.0.6-5
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-04-30 13:43:50 +08:00
WANG Chao 39178b1346 Rebase makedumpfile-1.5.6
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-04-30 13:40:01 +08:00
WANG Chao 1780a4b77c kexec-tools.spec: remove ia64 architecture
Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-04-23 14:02:57 +08:00
WANG Chao 06750c40e7 Release 2.0.6-4
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-04-17 11:31:32 +08:00
WANG Chao ed12e00218 kdump-dep-generator: Add kdump service dependencies on the fly
kdump-dep-generator is a systemd generator, used to write out kdump
service dependencies.

Currently it's only useful for ssh dump case. And in ssh dump case, it
writes out a dependency which kdump.service "Wants"
network-online.target:

  # ls -l /run/systemd/generator/kdump.service.wants/
  [..] network-online.target -> /usr/lib/systemd/system/network-online.target

So that kdump.service will pull in network-online.target and delayed
start until network-online.target is reached.

In the future, we could use generator to write out kdump.service
dynamically and get rid of the static defined kdump.service at all.

v1->v2:
Vivek: not using hardcoded run time generator path, use what systemd pass in.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-04-17 11:27:31 +08:00
WANG Chao 9546c93e6b Release 2.0.6-3
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-04-03 14:43:10 +08:00
Peter Robinson 7851211da1 Exclude aarch64 2014-03-27 16:13:09 +00:00
Peter Robinson 4cc836d2ed Revert "Add initial aarch64 support."
This reverts commit ab699dd204.
2014-03-27 14:38:47 +00:00
Peter Robinson ab699dd204 Add initial aarch64 support. 2014-03-27 11:56:27 +00:00
WANG Chao 33d1bf7e67 Release 2.0.6-1
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-03-26 15:28:42 +08:00
Arthur Zou 7f9b45002a Backport vmcore-dmsg stack smashing in extreme case
In exteme case vmcore-dmesg will overflow. upstream has fixed the
some problem. so simply backport it

Signed-off-by: Arthur Zou <zzou@redhat.com>
Acked-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-03-14 13:04:58 +08:00
WANG Chao 58a4543011 Release 2.0.5-2
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-03-10 13:22:24 +08:00
WANG Chao 3b9a0140cb Release 2.0.5-1
Rebase kexec-tools-2.0.5

Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-03-05 11:16:44 +08:00
WANG Chao ad6faec56b Release 2.0.4-25
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-03-05 11:15:42 +08:00
WANG Chao 7c99869b79 Release 2.0.4-24
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-02-17 12:50:08 +08:00
WANG Chao 2ef16b5be8 add kdump-in-cluster-environment.txt to rpm pkg
Last time I forgot to install this doc to rpm pkg. So add it now.

Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-02-17 12:50:05 +08:00
WANG Chao 7c65f40916 Release 2.0.4-23
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-01-29 16:34:28 +08:00
WANG Chao 75c9162996 makedumpfile: memset() in cyclic bitmap initialization introduce segment fault.
This is a backport of the following upstream commit:

commit 4404368
Author: WANG Chao <chaowang@redhat.com>
Date:   Wed Dec 18 22:34:43 2013 +0900

    [PATCH] memset() in cyclic bitmap initialization introduce segment fault.

    We are using memset() to improve performance when creating 1st and 2nd
    bitmap. After doing round up the pfn_start and round down pfn_end, it's
    possible that pfn_start_roundup is greater than pfn_end_round. A segment
    fault could happen in that case because memset is taking roughly the
    value of (pfn_end_round << 3 - pfn_start_roundup << 3 ), which is
    negative, as its third argument.

    So we can skip the memset if start is greater than end. It's safe
    because we will set bit for the round up part and also round down part.

    Actually this happens on my EFI virtual machine:

    cat /proc/iomem:
    00000000-00000fff : reserved
    00001000-0009ffff : System RAM
    000a0000-000bffff : PCI Bus 0000:00
    000f0000-000fffff : System ROM
    00100000-3d162017 : System RAM
      01000000-015cab9b : Kernel code
      015cab9c-019beb3f : Kernel data
      01b4f000-01da9fff : Kernel bss
      30000000-37ffffff : Crash kernel
    3d162018-3d171e57 : System RAM
    3d171e58-3d172017 : System RAM
    3d172018-3d17ae57 : System RAM
    3d17ae58-3dc10fff : System RAM
    3dc11000-3dc18fff : reserved
    3dc19000-3dc41fff : System RAM
    3dc42000-3ddcefff : reserved
    3ddcf000-3f7fefff : System RAM
    3f7ff000-3f856fff : reserved
    [..]

    gdb ./makedumpfile core
    (gdb) bt full
    [..]
     #1  0x000000000042775d in create_1st_bitmap_cyclic () at makedumpfile.c:4543
            i = 0x5
            pfn = 0x3d190
            phys_start = 0x3d18ee58
            phys_end = 0x3d18f018
            pfn_start = 0x3d18e
            pfn_end = 0x3d18f
            pfn_start_roundup = 0x3d190
            pfn_end_round = 0x3d188
            pfn_start_byte = 0x7a32
            pfn_end_byte = 0x7a31
    [..]
    (gdb) list makedumpfile.c:4543
    4538                                        return FALSE;
    4539
    4540                        pfn_start_byte = (pfn_start_roundup - info->cyclic_start_pfn) >> 3;
    4541                        pfn_end_byte = (pfn_end_round - info->cyclic_start_pfn) >> 3;
    4542
    4543                        memset(info->partial_bitmap2 + pfn_start_byte,
    4544                               0xff,
    4545                               pfn_end_byte - pfn_start_byte);
    4546
    4547                        for (pfn = pfn_end_round; pfn < pfn_end; ++pfn)

    Signed-off-by: WANG Chao <chaowang@redhat.com>

This patch fixes segment fault issues on the systems with very small
memory map range (less than 8 pages).

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-01-29 16:31:04 +08:00
WANG Chao 5d68494023 Release 2.0.4-22
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-01-28 13:07:09 +08:00
WANG Chao 6ae85f33a7 Rebase makedumpfile-1.5.5
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-01-28 13:04:36 +08:00
WANG Chao 59b1229661 Release 2.0.4-21
Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-01-22 12:53:36 +08:00