Accepting request 223425 from home:jones_tony:branches:Kernel:kdump
OBS-URL: https://build.opensuse.org/request/show/223425 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kexec-tools?expand=0&rev=39
This commit is contained in:
parent
ace336a880
commit
cd3d9e04cf
@ -149,11 +149,22 @@ if (!$section) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $image=$section->{"image"};
|
||||||
|
my $initrd=$section->{"initrd"};
|
||||||
|
|
||||||
|
# handle btfs /@ -> /
|
||||||
|
if (substr ($image, 0, 3) eq "/@/") {
|
||||||
|
$image = substr ($image, 2);
|
||||||
|
}
|
||||||
|
if ($initrd && substr ($initrd, 0, 3) eq "/@/") {
|
||||||
|
$initrd = substr ($initrd, 2);
|
||||||
|
}
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
print "Type : " . $section->{"type"}."\n";
|
print "Type : " . $section->{"type"}."\n";
|
||||||
print "Name : " . $section->{"name"}."\n";
|
print "Name : " . $section->{"name"}."\n";
|
||||||
print "Image : " . $section->{"image"}."\n";
|
print "Image : " . $image."\n";
|
||||||
print "Initrd : " . $section->{"initrd"}."\n";
|
print "Initrd : " . $initrd."\n";
|
||||||
print "VGA : " . $section->{"vgamode"}."\n";
|
print "VGA : " . $section->{"vgamode"}."\n";
|
||||||
print "Append : " . $section->{"append"}."\n";
|
print "Append : " . $section->{"append"}."\n";
|
||||||
print "Root : " . $section->{"root"}."\n";
|
print "Root : " . $section->{"root"}."\n";
|
||||||
@ -164,15 +175,16 @@ if ($section->{"type"} ne "image") {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# check if the image exists
|
# check if the image exists
|
||||||
if (! -f $section->{"image"}) {
|
if (! -f $image) {
|
||||||
print STDERR "Image '" . $section->{"image"} . "' does not exist.\n";
|
print STDERR "Image '" . $image . "' does not exist.\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
# check if the initrd exists
|
# check if the initrd exists
|
||||||
if ($section->{"initrd"} && ! -f $section->{"initrd"}) {
|
if ($initrd && ! -f $initrd) {
|
||||||
print STDERR "Initrd '" . $section->{"initrd"} . "' does not exist.\n";
|
print STDERR "Initrd '" . $initrd . "' does not exist.\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,11 +198,11 @@ if (system("which kexec &>/dev/null") != 0) {
|
|||||||
my $cmd = "kexec";
|
my $cmd = "kexec";
|
||||||
|
|
||||||
# append image
|
# append image
|
||||||
$cmd .= " -l '" . $section->{"image"} . "'";
|
$cmd .= " -l '" . $image . "'";
|
||||||
|
|
||||||
# append initrd if available
|
# append initrd if available
|
||||||
if ($section->{"initrd"}) {
|
if ($initrd) {
|
||||||
$cmd .= " --initrd='" . $section->{"initrd"} . "'";
|
$cmd .= " --initrd='" . $initrd . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
# build append line
|
# build append line
|
||||||
|
@ -48,6 +48,12 @@ Description
|
|||||||
kexec-bootloader takes the default section of bootloader configuration and
|
kexec-bootloader takes the default section of bootloader configuration and
|
||||||
loads that kernel, initrd with _kexec -l_ and the respective command line.
|
loads that kernel, initrd with _kexec -l_ and the respective command line.
|
||||||
|
|
||||||
|
Under systemd kexec-bootloader may be invoked by kexec-load.service
|
||||||
|
(/usr/bin/systemctl kexec) to perform a kexec. To emulate previous SLE
|
||||||
|
configurable behaviour where kexec occurs automatically at system reboot
|
||||||
|
the systemd reboot target should be altered via
|
||||||
|
'ln -s /usr/lib/systemd/system/kexec.target /etc/systemd/system/reboot.target
|
||||||
|
|
||||||
Options
|
Options
|
||||||
-------
|
-------
|
||||||
*-h* | *--help*::
|
*-h* | *--help*::
|
||||||
|
12
kexec-load.service
Normal file
12
kexec-load.service
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=load default kernel into the current kernel
|
||||||
|
Documentation=man:kexec(8)
|
||||||
|
DefaultDependencies=no
|
||||||
|
Before=shutdown.target umount.target final.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/sbin/kexec-bootloader
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=kexec.target
|
@ -1,11 +1,13 @@
|
|||||||
From: Tony Jones <tonyj@suse.de>
|
From: Tony Jones <tonyj@suse.de>
|
||||||
Subject: fix build error on i386
|
Subject: i386: fix build failure (bzImage_support_efi_boot)
|
||||||
Upstream: pending
|
Upstream: yes
|
||||||
|
Git-commit: 9bcefc97bc6c03b6acc8c25f6b1d4e796521ea4c
|
||||||
|
|
||||||
Commit 9c200a85de2245a850546fded96a1977b84ad24d referenced
|
Commit 9c200a85de2245a850546fded96a1977b84ad24d referenced
|
||||||
'bzImage_support_efi_boot' without matching 32-bit definition.
|
'bzImage_support_efi_boot' without matching 32-bit definition.
|
||||||
|
|
||||||
Signed-off-by: Tony Jones <tonyj@suse.de>
|
Signed-off-by: Tony Jones <tonyj@suse.de>
|
||||||
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
||||||
---
|
---
|
||||||
kexec/arch/i386/kexec-bzImage.c | 1 +
|
kexec/arch/i386/kexec-bzImage.c | 1 +
|
||||||
1 file changed, 1 insertion(+)
|
1 file changed, 1 insertion(+)
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
From: Tony Jones <tonyj@suse.de>
|
From: Tony Jones <tonyj@suse.de>
|
||||||
Subject: fix redefinition error for e820
|
Subject: fix redefinition error for e820
|
||||||
Upstream: pending
|
Upstream: yes
|
||||||
|
Git-commit: 941fa1f6e31bc7cb1b014277de36b80425da7010
|
||||||
|
|
||||||
Our xenctrl.h duplicates e820 definition.
|
At least on our systems, xenctrl.h defines (unguarded) struct e820entry
|
||||||
|
Move the (guarded) definition in include/x86/x86-linux.h to below.
|
||||||
|
|
||||||
|
Signed-off-by: Tony Jones <tonyj@suse.de>
|
||||||
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
||||||
|
|
||||||
---
|
---
|
||||||
kexec/arch/i386/crashdump-x86.c | 3 ++-
|
kexec/arch/i386/crashdump-x86.c | 3 ++-
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Feb 6 01:14:24 UTC 2014 - tonyj@suse.com
|
||||||
|
|
||||||
|
- Drop obsolete /etc/init.d/kexec (bnc# 862143).
|
||||||
|
- Handle btrfs root subvolume (bnc# 862143c35)
|
||||||
|
- Create kexec-load.service (bnc# 862143)
|
||||||
|
- Update kexec-bootloader manpage (document reboot using kexec)
|
||||||
|
- Remove old 11.1 conditionals
|
||||||
|
- Update kexec-tools-i386-bzimage_efi.patch and
|
||||||
|
kexec-tools-xen-e820-redefinition.patch with upstream commit ids
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Feb 5 17:53:56 UTC 2014 - tonyj@suse.com
|
Wed Feb 5 17:53:56 UTC 2014 - tonyj@suse.com
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ Release: 0
|
|||||||
Source: ftp://kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.xz
|
Source: ftp://kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.xz
|
||||||
Source1: kexec-bootloader
|
Source1: kexec-bootloader
|
||||||
Source2: kexec-bootloader.8.txt
|
Source2: kexec-bootloader.8.txt
|
||||||
Source3: kexec.init
|
Source3: kexec-load.service
|
||||||
Source4: %{name}-rpmlintrc
|
Source4: %{name}-rpmlintrc
|
||||||
Patch1: %{name}-xen-static.patch
|
Patch1: %{name}-xen-static.patch
|
||||||
Patch2: %{name}-xen-balloon-up.patch
|
Patch2: %{name}-xen-balloon-up.patch
|
||||||
@ -43,12 +43,10 @@ Patch7: %{name}-i386-bzimage_efi.patch
|
|||||||
Url: ftp://kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.bz2
|
Url: ftp://kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.bz2
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
#!BuildIgnore: fop
|
#!BuildIgnore: fop
|
||||||
BuildRequires: automake
|
|
||||||
BuildRequires: zlib-devel
|
|
||||||
%if 0%{?suse_version} >= 1110
|
|
||||||
BuildRequires: asciidoc
|
BuildRequires: asciidoc
|
||||||
|
BuildRequires: automake
|
||||||
BuildRequires: libxslt
|
BuildRequires: libxslt
|
||||||
%endif
|
BuildRequires: zlib-devel
|
||||||
%ifarch x86_64
|
%ifarch x86_64
|
||||||
BuildRequires: xen-devel
|
BuildRequires: xen-devel
|
||||||
%endif
|
%endif
|
||||||
@ -85,24 +83,17 @@ CFLAGS=$RPM_OPT_FLAGS BUILD_CFLAGS=$RPM_OPT_FLAGS \
|
|||||||
%configure
|
%configure
|
||||||
%endif
|
%endif
|
||||||
make
|
make
|
||||||
cp %{S:1} .
|
a2x -D . -d manpage -f manpage %{S:2}
|
||||||
cp %{S:2} .
|
|
||||||
cp %{S:3} .
|
|
||||||
%if 0%{?suse_version} >= 1110
|
|
||||||
a2x -d manpage -f manpage kexec-bootloader.8.txt
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%makeinstall
|
%makeinstall
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
|
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
|
||||||
install -c -m 0644 kexec/kexec.8 $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
|
install -c -m 0644 kexec-bootloader.8 $RPM_BUILD_ROOT%{_mandir}/man8
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
|
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
|
||||||
install -m 0755 kexec-bootloader $RPM_BUILD_ROOT%{_sbindir}
|
install -m 0755 %{S:1} $RPM_BUILD_ROOT%{_sbindir}
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/etc/init.d
|
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
|
||||||
install -m 0755 kexec.init ${RPM_BUILD_ROOT}/etc/init.d/kexec
|
install -m644 %{S:3} $RPM_BUILD_ROOT%{_unitdir}
|
||||||
%endif
|
|
||||||
#UsrMerge
|
#UsrMerge
|
||||||
mkdir -p $RPM_BUILD_ROOT/sbin
|
mkdir -p $RPM_BUILD_ROOT/sbin
|
||||||
ln -s %{_sbindir}/kdump $RPM_BUILD_ROOT/sbin
|
ln -s %{_sbindir}/kdump $RPM_BUILD_ROOT/sbin
|
||||||
@ -111,17 +102,18 @@ ln -s %{_sbindir}/kexec $RPM_BUILD_ROOT/sbin
|
|||||||
|
|
||||||
%clean
|
%clean
|
||||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
||||||
%if 0%{?suse_version} >= 1110
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%{fillup_and_insserv -n kexec kexec}
|
%service_add_post kexec-load.service
|
||||||
%endif
|
|
||||||
#
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
%if 0%{?suse_version} >= 1110
|
%service_del_postun kexec-load.service
|
||||||
%insserv_cleanup
|
|
||||||
%endif
|
%pre
|
||||||
|
%service_add_pre kexec-load.service
|
||||||
|
|
||||||
|
%preun
|
||||||
|
%service_del_preun kexec-load.service
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
@ -131,9 +123,7 @@ ln -s %{_sbindir}/kexec $RPM_BUILD_ROOT/sbin
|
|||||||
/sbin/*
|
/sbin/*
|
||||||
#EndUsrMerge
|
#EndUsrMerge
|
||||||
%{_sbindir}/*
|
%{_sbindir}/*
|
||||||
%if 0%{?suse_version} >= 1110
|
|
||||||
%{_sbindir}/kexec-bootloader
|
%{_sbindir}/kexec-bootloader
|
||||||
%config /etc/init.d/kexec
|
%{_unitdir}/kexec-load.service
|
||||||
%endif
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
62
kexec.init
62
kexec.init
@ -1,62 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Copyright (c) 2008 SUSE LINUX Products GmbH
|
|
||||||
# Author: Bernhard Walle <bwalle@suse.de>
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: kexec
|
|
||||||
# Required-Start: $null
|
|
||||||
# Should-Start:
|
|
||||||
# Should-Stop:
|
|
||||||
# Required-Stop: $local_fs $remote_fs
|
|
||||||
# Default-Start: 1 2 3 5 S
|
|
||||||
# Default-Stop: 1 2 3 5 S
|
|
||||||
# Short-Description: Enables reboot through kexec
|
|
||||||
# Description: Enables reboot through kexec
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /etc/rc.status
|
|
||||||
|
|
||||||
KEXEC_BOOTLOADER=/usr/sbin/kexec-bootloader
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
# Only execute that script if we're going to reboot the system.
|
|
||||||
if [ "$RUNLEVEL" -eq 6 ] ; then
|
|
||||||
if ! [ -f /sys/kernel/kexec_loaded ] ; then
|
|
||||||
echo -n "Cannot check if kexec kernel has been loaded."
|
|
||||||
rc_failed
|
|
||||||
else
|
|
||||||
read -t 2 kexec_loaded < /sys/kernel/kexec_loaded
|
|
||||||
if [ "$kexec_loaded" -ne 0 ] ; then
|
|
||||||
echo -n "kexec kernel already loaded."
|
|
||||||
rc_status -s
|
|
||||||
else
|
|
||||||
echo -n "Loading kexec kernel for reboot ..."
|
|
||||||
$KEXEC_BOOTLOADER
|
|
||||||
rc_status -v
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Loading kexec kernel ..."
|
|
||||||
rc_status -s
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
echo "not implemented"
|
|
||||||
rc_status -s
|
|
||||||
;;
|
|
||||||
restart|reload)
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo $"Usage: $0 {start|stop|status|restart|reload|try-reload}"
|
|
||||||
exit 1
|
|
||||||
esac
|
|
||||||
|
|
||||||
rc_exit
|
|
||||||
|
|
||||||
# vim: set ts=4 sw=4 et: :mode=shellscript:
|
|
Loading…
x
Reference in New Issue
Block a user