File kexec-tools.spec of Package kexec-tools

# spec file for package kexec-tools (Version 2.0.0)
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# norootforbuild

Name:           kexec-tools
%ifarch ppc
BuildRequires:  gcc-64bit glibc-devel-64bit
License:        GPL v2 or later
Group:          System/Kernel
Requires:       perl-Bootloader
PreReq:         %insserv_prereq %fillup_prereq
AutoReqProv:    on
Summary:        Tools for fast kernel loading
Version:        2.0.0
Release:        47
Source:         %{name}-%{version}.tar.bz2
Source1:        kexec-bootloader
Source2:        kexec-bootloader.8.txt
Source3:        kexec.init
Source4:        %{name}-%{version}-rpmlintrc
Patch0:         %{name}-ia64-uncached-memory.diff
Patch1:         %{name}-ia64-PA.diff
Patch2:         %{name}-build-warnings.diff
Patch3:         %{name}-ppc64-build-warnings.diff
Patch4:         %{name}-ppc64-IBM-QS2x-blades.diff
Patch5:         %{name}-ia64-kdump-PT_LOAD-order.diff
Patch6:         %{name}-crash-memory-ranges-drconf.diff
Patch7:         %{name}-add-usable-drconf-memory-node-to-device-tree.diff
Patch8:         %{name}-get-details-dynamic-reconfiguration-memory-node.diff
Patch9:         %{name}-device-tree-return.diff
Patch10:        %{name}-ppc-check-flags.diff
Patch11:        %{name}-no-vga-output.diff
Patch12:        %{name}-spell.diff
Patch13:        %{name}-xen-static.diff
Patch14:        %{name}-proc-iomem-xen.diff
Patch15:        %{name}-parse-iomem-single-warning.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  zlib-devel
%if 0%{?suse_version} >= 1110
BuildRequires:  asciidoc
%ifarch         %ix86 x86_64
BuildRequires:  xen-devel

Kexec is a user space utility for loading another kernel and asking the
currently running kernel to do something with it. A currently running
kernel may be asked to start the loaded kernel on reboot, or to start
the loaded kernel after it panics.

    Eric Biederman <>
    Albert Herranz
    Jesse Barnes <>
    Khalid Aziz <>
    Hariprasad Nellitheertha <>
    Tim Deegan <>

%setup -q -n kexec-tools-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1

%{?suse_update_config -f}
%ifarch ia64
RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e 's/-fstack-protector//')
autoreconf -f
./configure \
	--prefix=/ \
%ifarch ppc
        --host=powerpc64-suse-linux \
        --build=powerpc64-suse-linux \
	--sbindir=/sbin \
	--libdir=/%_lib || true
# manpage
cp %{S:1} .
cp %{S:2} .
cp %{S:3} .
%if 0%{?suse_version} >= 1110
a2x -d manpage -f manpage kexec-bootloader.8.txt

mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
install -c -m 0644 kexec/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8
%if 0%{?suse_version} >= 1110
install -c -m 0644 kexec-bootloader.8 $RPM_BUILD_ROOT%{_mandir}/man8
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
install -m 0755 kexec-bootloader $RPM_BUILD_ROOT%{_sbindir}
mkdir -p ${RPM_BUILD_ROOT}/etc/init.d
install -m 0755 kexec.init ${RPM_BUILD_ROOT}/etc/init.d/kexec

[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%if 0%{?suse_version} >= 1110

%{fillup_and_insserv -n kexec kexec}

%if 0%{?suse_version} >= 1110

%defattr(-, root, root)
%doc %{_mandir}/man*/*
%if 0%{?suse_version} >= 1110
%config /etc/init.d/kexec
%ifarch %ix86 x86_64

* Wed Nov 26 2008
- Fix compile warning.
* Mon Nov 24 2008
- Read memory map from /proc/iomem instead of /sys/firmware/memmap
  when running under Xen.
- Build against libxenctl on i386 and x86-64 but link statically
  to avoid runtime dependencies that would exist even on non-Xen
* Fri Nov 14 2008
- Fix spell error in help output (bnc#444714).
* Sat Nov 01 2008
- Don't print "setup_linux_vesafb" message on stderr.
* Mon Oct 27 2008
- Update patch that checks for reserved and assigned bit flags on
  the memory regions (bnc#438086).
* Sun Oct 26 2008
- Clear grubonce after using in kexec-bootloader (bnc#438194).
- Add rpmlint supression file.
- Correct debugging output: Number of section was one too small
  (last index != size of array).
* Fri Oct 24 2008
- Check for reserved and assigned bit flags on the memory regions
* Sat Oct 18 2008
- Honor grubonce also when the 1st (== 0th) entry was chosen.
* Mon Oct 13 2008
- Fix runlevels (Default-Start, Default-Stop) in kexec.init.
- Only load kexec kernel when kexec reboot is enabled when the
  target runlevel is 6 (reboot) to avoid slowdown of shutdown in
  that case.
* Thu Oct 09 2008
- PPC64: Use return value of count_dyn_reconf_memory_ranges().
* Thu Oct 09 2008
- Fix empty /proc/vmcore on PPC64 (bnc#431492).
  o kexec/kdump: read crash memory ranges from drconf memory.
  o kexec/kdump: add a new linux, usable-drconf-memory node to the
  device tree.
  o kexec/kdump: get details of ibm, dynamic-reconfiguration-memory
  node of device tree.
* Thu Oct 09 2008
- Add newline in error message of "kexec-bootloader".
- Add error handling when Bootloader::Tools::GetDefaultSection()
* Wed Oct 08 2008
- IA64: Order of operations bug in PT_LOAD segment reader.
* Wed Oct 08 2008
- ia64: Do not include uncached memory to vmcore.
- ia64: Make PA() work for both physical identity-mapped virtual
- PPC64: Let kexec work on IBM QS2x blade servers
- Fix build warnings.
* Mon Oct 06 2008
- Implement -h (help) option (bnc#432386).
- Remove documentation of -o (options) option that never existed.
* Wed Aug 27 2008
- only install and build /etc/init.d/kexec with openSUSE 11.1 /
  SLES 11 and later
* Sat Aug 16 2008
- mark /etc/init.d/kexec as %%config
- remove (empty) %%preun
* Fri Aug 15 2008
- add /etc/init.d/kexec to be able to reboot with kexec(8)
* Sat Jul 19 2008
- update to kexec-tools 2.0.0 (final)
  o Allow BUILD_CFLAGS and TARGET_CFLAGS to be specified at
  configure time
* Mon Jul 14 2008
- update to kexec-tools 2.0.0-rc1
  o implement support for /sys/firmware/memmap interface
  o Allow 32 bit kexec binary to boot kdump kernel on ppc64
  o kexec/crashdump.c: remove file descriptor leaks; make
  kdump_info argument to get_vmcoreinfo() const
  o Fix implicit declaration of inb/outb
  o EDD implementation
  o Specify the arch on kexec_unload
  o Update KEXEC_ARCH_* constants from Linux kernel headers
  o lots of code cleanup
  o Add --reuse-cmdline
  o documentation update (manpage, boot protocol)
  o ensure that extra rtas segment is a multiple of PAGE_SIZE
  o Allow building for ppc32 platforms
  o Die on early EOF in slurp_file, instead of infinite-looping
  o Fix copy-paste bug: entry16 does not start at entry16_debug
  o Fix undefined symbol errors on readw/writew: arch/io.h, not
  o extract vmcoreinfo from /proc/vmcore for Xen
  o Give installed files user-writable permission
  o Use separate CPPFLAGS and LDFLAGS for purgatory
- dropped kexec-tools-fix-arch-on-unload: merged upstream
- dropped kexec-tools-edd-fix: merged upstream
- dropped kexec-tools-refactor-architecture-detection: merged
- dropped kexec-tools.gcc-bug.patch: merged upstream
- dropped kexec-tools.ppc32-64bit-purgatory.patch: merged upstream
- kexec-tools-edd-support: merged upstream
- kexec-tools-32bit-kexec-with-64bit-ppc64.patch: merged upstream
- removed README.SUSE: information not necessary any more
* Thu Jul 03 2008
- fix 32 bit kexec to boot on 64 bit ppc64 (bnc#405015)
* Mon May 26 2008
- fix EDD support when the BIOS-reported length is smaller than
  the sysfs raw_data size (bnc#388754)
* Mon May 26 2008
- fix kexec unload (rckdump stop) on ppc64 (bnc#394216)
* Tue May 13 2008
- implement EDD (bnc#383210)
* Mon Mar 24 2008
- update to kexec-tools-testing v20080324
  o tarball update (version), no functional changes between
  v20080318-rc and v20080324
* Tue Mar 18 2008
- update to kexec-tools-testing v20080318-rc
  o ia64 kern_vaddr_start was calculated incorrectly
  o ia64: make load_crashdump_segments 80col wide
  o fix i386 EFI boot using efifb
  o mipsel: mipsel port
  o fix kexec-tools on x86_64 (see bnc#368138)
  o fix valid_memory_range region merging
  o arm: invalid initialisation of iomem in get_memory_ranges()
  o arm: use proc_iomem()
  o no machine machine to proc_iomem()
* Fri Mar 14 2008
- update to kexec-tools-testing v20080227-git
  (current git snapshot, fixes x86_64, bnc#368138)
- kexec-tools-portability-issue deleted: mainline
* Wed Feb 27 2008
- update to kexec-tools-testing v20080227
  (only increased version number)
* Tue Feb 26 2008
- update to kexec-tools-testing v20080226-rc
  o build: include configure and include/ in dist
- adjusted kexec-tools-portability-issue to build without warnings
  on 32 bit systems
* Thu Feb 21 2008
- update to kexec-tools-testing v20080221-rc
  o Only include needed files in distribution tarball
  o Clean up whitespace in include/x86/x86-linux.h
  o Kexec command line length
- removed kexec-longer-cmdline.diff: fixed mainline differently
* Wed Feb 20 2008
- update to kexec-tools-testing v20080219-rc
  o Fix the feature determining ELF32/ELF64 automatically
  o Enable building a 32 bit binary for ppc64 platforms.
  o Consolidate BOOTLOADER defines
  o Use config.h for defines
  o Add gamecube to config.h defines
  o removed partially duplicated system headers
  o Use general _SRCS and _OBJS, rather and _C_{SRCS, OBJS} and
  o build system fixes
  o Add documentation on creating include/ to INSTALL
  o Log unknown reloc name instead of its number
  o Use zlib if present
  o kexec buffer overflow on ppc platform
  o sh: Remove hardcoded PAGE_SIZE in NetBSD loader
  o Add ARM support to kexec
  o Remove some extraneous whitespace
  o kexec: Use target linker for purgatory
- removed kexec-tools-elf32-elf64-fix: mainline
- removed kexec-tools.ppc64-32bit-build.patch: mainline
- removed kexec-tools.fread-buffer-overflow.patch: mainline
* Wed Jan 30 2008
- fix fread buffer overflow on ppc
* Tue Jan 22 2008
- update ppc buildreq
* Fri Nov 30 2007
- fix a problem with automatic determination of ELF32/ELF64 on i386
* Tue Oct 30 2007
- update to kexec-tools-testing 20071030
  o vmcoreinfo's address and size
* Wed Oct 17 2007
- update to kexec-tools-testing v20071017-rc
  o Set alternate location for /proc/iomem on ia64 xen
  o debugging output improvements
  o Handle malloc() failure in xen_get_nr_phys_cpus()
  o Added generic --reuseinitrd option
  o ppc64: fix device-tree mem node
  o ppc64: fix misaligned cmdline
  o ppc64: cleanup get_devtree_details
  o ppc64: Add arch specific --reuseinitrd hooks
  o ppc64: use kernels slave loop for purgatory
  o ppc64: correct @ha relocation
- remove kexec-tools.check_reuse_initrd-close.patch (merged
* Thu Oct 11 2007
- remove kdump stuff from this package, that's now in the "kexec"
* Wed Aug 29 2007
- add reset_devices kernel parameter as default
* Sat Aug 25 2007
- do not require kdump-helpers on s390
* Fri Jul 27 2007
- update documentation for deleting all dumps (#302257)
* Tue Jul 17 2007
- workaround gcc code analyzing bug
* Mon Jul 16 2007
- update to kexec-tools-testing b84b87747a16f0afbef6f6802bb794a94f4961d9
  build 32bit powerpc kexec binary for 64bit kernels
* Fri Jul 06 2007
- implement a simple status command for kdump init script
* Mon Jul 02 2007
- removed 'machvec=dig' workaround from the documentation since
  this has been fixed in the kernel (#271158)
* Fri Jun 22 2007
- disable -fstack-protector on IA64 since the kdump kernel doesn't
  boot with -fstack-protector enabled
* Thu Jun 21 2007
- kdump init script: fix handling of spaces in kernel type
* Wed Jun 13 2007
- remove KDUMP_KERNELVER="kdump" on x86_64 and i386 since there's
  no special "kdump" kernel any more in the default configuration
  (i.e. in the .spec file since it's different for the
* Wed Jun 13 2007
- removed libelf as BuildRequires
* Mon Jun 11 2007
- moved copying of dump file to an external package
- moved kdump-helper which is needed to save dump in initrd
  also to kdump-helpers package
* Tue Apr 24 2007
- update to current kexec-tools-testing
  add PS3 patches
* Thu Apr 19 2007
- fixes in kdump-helper (update to 0.1.2):
  o retrieve the disk size before mmap()
  o return GENERAL_ERROR if the program cannot be opened
  o use symbolic constants for exit values instead of magic numbers
  now consistently
  o check for correct return value of mmap() instead of NULL
* Fri Apr 13 2007
- improved documentation of KDUMP_DUMPDEV (#264050)
* Mon Apr 02 2007
- add zlib-devel BuildRequires
* Tue Mar 20 2007
- fixed script to properly unload kdump on IA64 (where kdump
  kernel is the normal kernel) (#256179)
* Mon Mar 19 2007
- upgrade to latest snapshot
  o [IA64] Use EFI_LOADER_DATA for ELF core header (-> needed
  because kernel was updated to 2.6.21 on STABLE)
  o include latest fixes
* Wed Mar 14 2007
- add detailed description about dump triggering methods to
  README.SUSE (#250134)
* Wed Mar 14 2007
- improve the check of crash kernel in kdump init script (#252632)
* Fri Mar 09 2007
- added hint that VGA console doesn't work (#253173)
* Thu Feb 15 2007
- added setting to print the kdump command line to standard output
- small improvement for the outut message while dumping: last
  message always prints 100%% if it was sucessful
* Wed Feb 14 2007
- added KDUMP_VERBOSE option to print progress output while
  dumping and to add the kexec call to system log
- added maxcpus=1 as default for KDUMP_COMMANDLINE_APPEND on IA64
- added --noio as default for KEXEC_OPTIONS on IA64
* Tue Feb 13 2007
- align the both start and end address of the ELF core header
  to EFI_PAGE_SIZE (4096) to fix wrong EFI memory maps
* Mon Feb 12 2007
- fixed copying, blocksize was wrong (#243058)
* Sat Feb 10 2007
- Fix help string.
* Fri Feb 09 2007
- fixed overflow error that prints the size from being printed
  correctly if the size doesn't fit into an int (#243058)
- improved error handling to make sure that a similar problem as
  in #243058 will output a better error message
* Wed Feb 07 2007
- don't refuse to deinstall kexec-tools if kdump was not configured
- fixed documentation error (/var/log/dump instead of
  /var/log/dumps in README.SUSE)
* Mon Feb 05 2007
- updated to kexec-tools 2007.02.05:
  * including last fixes
  * fix for ppc64 dynamic memory range allocation (#242075)
* Fri Feb 02 2007
- fixes overflow on large IA64 systems (#241544)
- added KDUMP_COMMANDLINE_APPEND variable (#241607)
- increase the command line size (#236828)
* Mon Jan 29 2007
- do not unload kdump kernel during runlevel changes (#238733)
* Thu Jan 25 2007
- added documentation for initrd-based kdump saving
- fixed description of KDUMP_IMMEDIATE_REBOOT
* Wed Jan 24 2007
- fix invalid /proc/vmcore on ppc64 (#238078).
* Thu Jan 18 2007
- improved documentation as response to #226736
* Wed Jan 17 2007
- implemented Initrd based kdump saving
* Wed Dec 20 2006
- take kexec-tools-testing snapshot-20061219.
  o ia64 support
  o relocatable kernel support
  o lots of cleanups/fixes
- fix manpage and help about -u option (#208710)
- ia64 kdump support (#214865, FATE#301433, FATE#301434)
  o add boot argument "CRASH=1" to indicate the crash environment
  (for kexec'ing with the same kernel)
  o fix kdump init script for ia64, which has only vmlinuz and
  uses the same kernel for kdump
- reduce boot options for kdump kernel (#223500)
* Thu Jul 13 2006
- fixed the calculation of required disk space in kdump
  init script (#192172)
- fix the wrong usage of crash program in README.SUSE
* Thu Jun 22 2006
- fix kexec to reserve ACPI NVS area (#179093)
- add more description about chkconfig and kdump service
* Fri Jun 16 2006
- add irqpoll boot option for i386 and x86_64 for more robust
  kdump (#183017)
* Thu Jun 01 2006
- update README.SUSE for more precise description about crash
  and debug kernel.
* Tue May 30 2006
- ppc64 kdump ELF header fix for power 4 box (#175128).
* Mon May 22 2006
- added the missing man page for kexec (#175084).
- add sleep after reboot in kdump init script for avoiding
  confliction with script single (#171332)
* Fri May 19 2006
- unconditionally add sysrq=1 for kdump boots, nothing to lose
* Fri May 19 2006
- remove crashkernel= cmdline also if only the size is given
  handle m as well as M because memparse() handles both
* Tue May 02 2006
- update/improve README.SUSE
- fix the default value in sysconfig.kdump
- add elevator=deadline to the boot parameter of kdump kernel
  to save memory footprint (#170591)
* Fri Apr 28 2006
- use df -P to print all data for a mount point in a single line
  long device node names will cause 2 lines in df output
* Wed Apr 26 2006
- linux,platform properties were removed from kernel 2.6.17
  assume non-LPAR if some properties do no exist in the device-tree
  (164993 - LTC23056)
* Wed Apr 26 2006
- set /proc/sys/kernel/panic_on_oops to actually trigger a dump
* Wed Mar 08 2006
- add --args-linux only on intel
  copy vmcore with --sparse, maybe it saves a few bytes.
* Wed Feb 22 2006
- updated to kdump7 patch.
* Wed Feb 15 2006
- fixed gdb-kdump script (#151001)
* Mon Feb 13 2006
- fix for ppc64 (#149576)
* Sun Feb 12 2006
- added the system check before dumping
- added gdb-kdump helper script
* Thu Feb 09 2006
- fixed Default-Start in kdump init script.
- fixed RequiredStart in sysconfig/kdump.
* Wed Feb 08 2006
- changed the default values of KDUMP_IMMEDIATE_REBOOT and
  KDUMP_RUNLEVEL (#149140).
* Tue Feb 07 2006
- added missing preun and postun sections.
* Mon Feb 06 2006
- fixed the messages from kdump to use suse rc macros
- added $KDUMP_RUNLEVEL to /etc/sysconfig/kdump for specifying
  the runlevel to boot kdump kernel.
- added /sbin/rckdump
- fixed a typo in kdump init script
* Fri Feb 03 2006
- sync with mainstream dump6 patch:
  most of ppc64 patches were merged there.
  new fixes included: vmcore copy fix for x86_64 and ext_mem_k
  calculation fix for i386
- added KEXEC_TRANSFER sysconfig variable for user-defined
  dump action.
* Fri Jan 27 2006
- added kdump init script and sysconfig.
* Wed Jan 25 2006
- converted neededforbuild to BuildRequires
* Mon Jan 23 2006
- update ppc64 kdump support
* Thu Jan 05 2006
- more fix for ppc64 kdump
- fix malloc size
* Thu Dec 15 2005
- use the latest kdump patch.
* Mon Dec 12 2005
- initial version: 1.101