Initialize for kexec-tools
This commit is contained in:
commit
04e87e0062
20 changed files with 2291 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
kexec-tools-2.0.20.tar.xz
|
1
.kexec-tools.metadata
Normal file
1
.kexec-tools.metadata
Normal file
|
@ -0,0 +1 @@
|
||||||
|
8310f3a0b9f68bcd9175ba80f5eb7022b8e8b13f0ced9f2e45bd9be99ae661d4 kexec-tools-2.0.20.tar.xz
|
232
kexec-bootloader
Normal file
232
kexec-bootloader
Normal file
|
@ -0,0 +1,232 @@
|
||||||
|
#!/usr/bin/perl -w
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or {{{
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
# 02110-1301, USA. }}}
|
||||||
|
#
|
||||||
|
use Bootloader::Tools;
|
||||||
|
use strict;
|
||||||
|
use Getopt::Long;
|
||||||
|
|
||||||
|
use constant FALSE => 0;
|
||||||
|
use constant TRUE => 1;
|
||||||
|
|
||||||
|
my $GRUBDIR = "/boot/grub";
|
||||||
|
my $GRUBDEFAULT = "$GRUBDIR/default";
|
||||||
|
my $debug = FALSE;
|
||||||
|
my $showHelp = FALSE;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Prints the given stuff (variable number of arguments) if debugging has
|
||||||
|
# been enabled. Does nothing otherwise.
|
||||||
|
sub print_debug(@) # {{{
|
||||||
|
{
|
||||||
|
if ($debug) {
|
||||||
|
print STDERR @_;
|
||||||
|
print STDERR "\n";
|
||||||
|
}
|
||||||
|
} # }}}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Displays help. Does not exit.
|
||||||
|
sub show_help()
|
||||||
|
{
|
||||||
|
print STDERR "kexec-bootloader\n";
|
||||||
|
print STDERR "Loads kexec kernel from bootloader configuration.\n\n";
|
||||||
|
print STDERR "Options:\n";
|
||||||
|
print STDERR " -h | --help Shows that help message.\n";
|
||||||
|
print STDERR " -D | --debug Prints debugging information.\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Returns the value stored with "grubonce". If no value has been stored
|
||||||
|
# or the /boot/grub/default file is not readable, then -1 is returned.
|
||||||
|
#
|
||||||
|
# Also emulate the behaviour when using GRUB which resets the 'magic once' flag
|
||||||
|
# when booting. Because we use kexec, we have to reset that 'magic once' flag
|
||||||
|
# ourselves.
|
||||||
|
sub get_grubonce_and_reset_magic() # {{{
|
||||||
|
{
|
||||||
|
# no /boot/grub/default file
|
||||||
|
if (! -f $GRUBDEFAULT) {
|
||||||
|
print_debug("get_grubonce_and_reset_magic(): No $GRUBDEFAULT.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# read /boot/grub/default
|
||||||
|
open(FH, $GRUBDEFAULT) or return -1;
|
||||||
|
my $value;
|
||||||
|
my $ret = sysread(FH, $value, 10);
|
||||||
|
close(FH);
|
||||||
|
|
||||||
|
# only if we have read 4 bytes it's valid
|
||||||
|
if ($ret != 10) {
|
||||||
|
print_debug("get_grubonce_and_reset_magic(): ".
|
||||||
|
"Read returned $ret instead of 4.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$value =~ s/\n//g;
|
||||||
|
my $once = int($value);
|
||||||
|
|
||||||
|
# 0x4000 is the "magic once flag"
|
||||||
|
unless ($once & 0x4000) {
|
||||||
|
print_debug("get_grubonce_and_reset_magic(): No magic 0x40000.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $defaultno = $once & ~0x4000;
|
||||||
|
my $buf = $defaultno . "\0" . "\n" x 9;
|
||||||
|
|
||||||
|
# now reset the grubonce flag
|
||||||
|
open(FH, ">$GRUBDEFAULT") or return $defaultno;
|
||||||
|
$ret = syswrite(FH, $buf, 10);
|
||||||
|
close(FH);
|
||||||
|
|
||||||
|
return $defaultno;
|
||||||
|
} # }}}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Parses command line options and sets global variables.
|
||||||
|
sub parse_options() # {{{
|
||||||
|
{
|
||||||
|
GetOptions(
|
||||||
|
"D|debug" => \$debug,
|
||||||
|
"h|help" => \$showHelp
|
||||||
|
);
|
||||||
|
} # }}}
|
||||||
|
|
||||||
|
|
||||||
|
parse_options();
|
||||||
|
if ($showHelp) {
|
||||||
|
show_help();
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
Bootloader::Tools::InitLibrary();
|
||||||
|
my $loader = Bootloader::Tools::GetBootloader();
|
||||||
|
my $default = -1;
|
||||||
|
|
||||||
|
if ($loader =~ m/GRUB/i) {
|
||||||
|
$default = get_grubonce_and_reset_magic();
|
||||||
|
print_debug("GRUB Default: $default");
|
||||||
|
}
|
||||||
|
|
||||||
|
my $section = undef;
|
||||||
|
# do we have a default?
|
||||||
|
if ($default >= 0) {
|
||||||
|
my @sections = Bootloader::Tools::GetSectionList();
|
||||||
|
print_debug("Number of sections: " . $#sections);
|
||||||
|
|
||||||
|
if ($#sections < 0 || $#sections < $default) {
|
||||||
|
print STDERR "WARNING: grubonce default number ($default) is invalid.\n";
|
||||||
|
print STDERR " Falling back to the default GRUB section.\n";
|
||||||
|
} else {
|
||||||
|
my $sect_name = $sections[$default];
|
||||||
|
$section = Bootloader::Tools::GetSection($sect_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# use the default section if we didn't get any default otherwise
|
||||||
|
if (!$section) {
|
||||||
|
$section = Bootloader::Tools::GetDefaultSection();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$section) {
|
||||||
|
print STDERR "Unable to get default section of bootloader configuration.\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
my $image=$section->{"image"};
|
||||||
|
my $initrd=$section->{"initrd"};
|
||||||
|
|
||||||
|
for my $file ($image, $initrd) {
|
||||||
|
# handle btfs /@ -> /
|
||||||
|
$file =~ s!^/@/!/!;
|
||||||
|
# handle /boot on separate partition
|
||||||
|
if($file !~ m!^/boot/! && ! -e $file && -e "/boot$file") {
|
||||||
|
$file="/boot$file"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($debug) {
|
||||||
|
print "Type : " . $section->{"type"}."\n";
|
||||||
|
print "Name : " . $section->{"name"}."\n";
|
||||||
|
print "Image : " . $image."\n";
|
||||||
|
print "Initrd : " . $initrd."\n";
|
||||||
|
print "VGA : " . $section->{"vgamode"}."\n";
|
||||||
|
print "Append : " . $section->{"append"}."\n";
|
||||||
|
print "Root : " . $section->{"root"}."\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($section->{"type"} ne "image") {
|
||||||
|
print STDERR "Default boot section is no image.\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# check if the image exists
|
||||||
|
if (! -f $image) {
|
||||||
|
print STDERR "Image '" . $image . "' does not exist.\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
# check if the initrd exists
|
||||||
|
if ($initrd && ! -f $initrd) {
|
||||||
|
print STDERR "Initrd '" . $initrd . "' does not exist.\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Do we have kexec?
|
||||||
|
if (system("which kexec &>/dev/null") != 0) {
|
||||||
|
print STDERR "kexec not available. Install kexec-tools.\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
# build the command list
|
||||||
|
my $cmd = "kexec";
|
||||||
|
|
||||||
|
# append image
|
||||||
|
$cmd .= " -l '" . $image . "'";
|
||||||
|
|
||||||
|
# append initrd if available
|
||||||
|
if ($initrd) {
|
||||||
|
$cmd .= " --initrd='" . $initrd . "'";
|
||||||
|
}
|
||||||
|
|
||||||
|
# build append line
|
||||||
|
my $append = "";
|
||||||
|
if ($section->{"root"}) {
|
||||||
|
$append .= "root=" . $section->{"root"};
|
||||||
|
}
|
||||||
|
if ($section->{"vga"}) {
|
||||||
|
$append .= " vga=" . $section->{"vga"};
|
||||||
|
}
|
||||||
|
if ($section->{"append"}) {
|
||||||
|
$append .= " " . $section->{"append"};
|
||||||
|
}
|
||||||
|
|
||||||
|
# and tell that kexec
|
||||||
|
$cmd .= " --append='" . $append . "'";
|
||||||
|
|
||||||
|
print_debug("Kexec call: " . $cmd);
|
||||||
|
if (system($cmd) != 0) {
|
||||||
|
print STDERR "kexec($cmd) failed.";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
exit(0);
|
||||||
|
|
||||||
|
# :vim set ts=4 sw=4 et fdm=markers: :collapseFolds=1:
|
68
kexec-bootloader.8
Normal file
68
kexec-bootloader.8
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
'\" t
|
||||||
|
.\" Title: kexec-bootloader
|
||||||
|
.\" Author: Bernhard Walle <bwalle@suse.de>
|
||||||
|
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
|
||||||
|
.\" Date: 01/19/2018
|
||||||
|
.\" Manual: User Manuals
|
||||||
|
.\" Source: SUSE
|
||||||
|
.\" Language: English
|
||||||
|
.\"
|
||||||
|
.TH "KEXEC\-BOOTLOADER" "8" "01/19/2018" "SUSE" "User Manuals"
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * Define some portability stuff
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" http://bugs.debian.org/507673
|
||||||
|
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.ie \n(.g .ds Aq \(aq
|
||||||
|
.el .ds Aq '
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * set default formatting
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" disable hyphenation
|
||||||
|
.nh
|
||||||
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
.ad l
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * MAIN CONTENT STARTS HERE *
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.SH "NAME"
|
||||||
|
kexec-bootloader \- Load kexec kernel from bootloader configuration
|
||||||
|
.SH "SYNOPSIS"
|
||||||
|
.sp
|
||||||
|
kexec\-bootloader [\-D]
|
||||||
|
.SH "DESCRIPTION"
|
||||||
|
.sp
|
||||||
|
kexec\-bootloader takes the default section of bootloader configuration and loads that kernel, initrd with \fIkexec \-l\fR and the respective command line\&.
|
||||||
|
.sp
|
||||||
|
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 \*(Aqln \-s /usr/lib/systemd/system/kexec\&.target /etc/systemd/system/reboot\&.target
|
||||||
|
.SH "OPTIONS"
|
||||||
|
.PP
|
||||||
|
\fB\-h\fR | \fB\-\-help\fR
|
||||||
|
.RS 4
|
||||||
|
Shows a short usage message\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\fB\-D\fR | \fB\-\-debug\fR
|
||||||
|
.RS 4
|
||||||
|
Prints debugging output\&.
|
||||||
|
.RE
|
||||||
|
.SH "RETURN VALUE"
|
||||||
|
.sp
|
||||||
|
The program returns \fB0\fR on success and \fB1\fR on failure\&.
|
||||||
|
.SH "BUGS"
|
||||||
|
.sp
|
||||||
|
Please report bugs and enhancement requests at https://bugzilla\&.novell\&.com\&.
|
||||||
|
.SH "COPYING"
|
||||||
|
.sp
|
||||||
|
Copyright (c) 2008 Bernhard Walle <bwalle@suse\&.de>\&. Free use of this software is granted under the terms of the GNU General Public License (GPL), version 2 or later\&.
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
.sp
|
||||||
|
\fBkexec\fR(8)
|
||||||
|
.SH "AUTHOR"
|
||||||
|
.PP
|
||||||
|
\fBBernhard Walle\fR <\&bwalle@suse\&.de\&>
|
||||||
|
.RS 4
|
||||||
|
Author.
|
||||||
|
.RE
|
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
|
25
kexec-tools-SYS_getrandom.patch
Normal file
25
kexec-tools-SYS_getrandom.patch
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
From: Petr Tesarik <ptesarik@suse.com>
|
||||||
|
Subject: Define SYS_getrandom if needed
|
||||||
|
Upstream: never, build fix for SLE12
|
||||||
|
|
||||||
|
SLE12 did not provide a definition for SYS_getrandom.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
|
||||||
|
---
|
||||||
|
kexec/arch/arm64/kexec-arm64.c | 5 +++++
|
||||||
|
1 file changed, 5 insertions(+)
|
||||||
|
|
||||||
|
--- a/kexec/arch/arm64/kexec-arm64.c
|
||||||
|
+++ b/kexec/arch/arm64/kexec-arm64.c
|
||||||
|
@@ -34,6 +34,11 @@
|
||||||
|
#include "mem_regions.h"
|
||||||
|
#include "arch/options.h"
|
||||||
|
|
||||||
|
+#ifndef __NR_getrandom
|
||||||
|
+#define __NR_getrandom 278
|
||||||
|
+__SYSCALL(__NR_getrandom, sys_getrandom)
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#define ROOT_NODE_ADDR_CELLS_DEFAULT 1
|
||||||
|
#define ROOT_NODE_SIZE_CELLS_DEFAULT 1
|
||||||
|
|
84
kexec-tools-add-variant-helper-functions.patch
Normal file
84
kexec-tools-add-variant-helper-functions.patch
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
|
||||||
|
Date: Fri, 11 Jan 2019 01:59:44 +0900
|
||||||
|
Subject: kexec: add variant helper functions for handling memory regions
|
||||||
|
References: jsc#SLE-9943
|
||||||
|
Upstream: not yet, it's under review in upstream
|
||||||
|
|
||||||
|
mem_regions_alloc_and_add() and mem_regions_alloc_and_exclude() are
|
||||||
|
functionally equivalent to, respectively, mem_regions_add() and
|
||||||
|
mem_regions_exclude() except the formers will re-allocate memory
|
||||||
|
dynamically when no more entries are available in 'ranges' array.
|
||||||
|
|
||||||
|
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
|
||||||
|
Signed-off-by: Chester Lin <clin@suse.com>
|
||||||
|
---
|
||||||
|
kexec/mem_regions.c | 42 ++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
kexec/mem_regions.h | 7 +++++++
|
||||||
|
2 files changed, 49 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/kexec/mem_regions.c b/kexec/mem_regions.c
|
||||||
|
index 50c8abccb93a..ad7d3f13fd84 100644
|
||||||
|
--- a/kexec/mem_regions.c
|
||||||
|
+++ b/kexec/mem_regions.c
|
||||||
|
@@ -125,3 +125,45 @@ int mem_regions_exclude(struct memory_ranges *ranges,
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+#define KEXEC_MEMORY_RANGES 16
|
||||||
|
+
|
||||||
|
+int mem_regions_alloc_and_add(struct memory_ranges *ranges,
|
||||||
|
+ unsigned long long base,
|
||||||
|
+ unsigned long long length, int type)
|
||||||
|
+{
|
||||||
|
+ void *new_ranges;
|
||||||
|
+
|
||||||
|
+ if (ranges->size >= ranges->max_size) {
|
||||||
|
+ new_ranges = realloc(ranges->ranges,
|
||||||
|
+ sizeof(struct memory_range) *
|
||||||
|
+ (ranges->max_size + KEXEC_MEMORY_RANGES));
|
||||||
|
+ if (!new_ranges)
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+ ranges->ranges = new_ranges;
|
||||||
|
+ ranges->max_size += KEXEC_MEMORY_RANGES;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return mem_regions_add(ranges, base, length, type);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int mem_regions_alloc_and_exclude(struct memory_ranges *ranges,
|
||||||
|
+ const struct memory_range *range)
|
||||||
|
+{
|
||||||
|
+ void *new_ranges;
|
||||||
|
+
|
||||||
|
+ /* for safety, we should have at least one free entry in ranges */
|
||||||
|
+ if (ranges->size >= ranges->max_size) {
|
||||||
|
+ new_ranges = realloc(ranges->ranges,
|
||||||
|
+ sizeof(struct memory_range) *
|
||||||
|
+ (ranges->max_size + KEXEC_MEMORY_RANGES));
|
||||||
|
+ if (!new_ranges)
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+ ranges->ranges = new_ranges;
|
||||||
|
+ ranges->max_size += KEXEC_MEMORY_RANGES;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return mem_regions_exclude(ranges, range);
|
||||||
|
+}
|
||||||
|
diff --git a/kexec/mem_regions.h b/kexec/mem_regions.h
|
||||||
|
index ae9e972b0206..e306d67e3261 100644
|
||||||
|
--- a/kexec/mem_regions.h
|
||||||
|
+++ b/kexec/mem_regions.h
|
||||||
|
@@ -12,4 +12,11 @@ int mem_regions_exclude(struct memory_ranges *ranges,
|
||||||
|
int mem_regions_add(struct memory_ranges *ranges, unsigned long long base,
|
||||||
|
unsigned long long length, int type);
|
||||||
|
|
||||||
|
+int mem_regions_alloc_and_exclude(struct memory_ranges *ranges,
|
||||||
|
+ const struct memory_range *range);
|
||||||
|
+
|
||||||
|
+int mem_regions_alloc_and_add(struct memory_ranges *ranges,
|
||||||
|
+ unsigned long long base,
|
||||||
|
+ unsigned long long length, int type);
|
||||||
|
+
|
||||||
|
#endif
|
|
@ -0,0 +1,77 @@
|
||||||
|
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
|
||||||
|
Date: Fri, 11 Jan 2019 01:59:46 +0900
|
||||||
|
Subject: arm64: kdump: deal with a lot of resource entries in /proc/iomem
|
||||||
|
References: jsc#SLE-9943
|
||||||
|
Upstream: not yet, it's under review in upstream
|
||||||
|
|
||||||
|
As described in the commit ("arm64: kexec: allocate memory space avoiding
|
||||||
|
reserved regions"), /proc/iomem now has a lot of "reserved" entries, and
|
||||||
|
it's not just enough to have a fixed size of memory range array.
|
||||||
|
|
||||||
|
With this patch, kdump is allowed to handle arbitrary number of memory
|
||||||
|
ranges, using mem_regions_alloc_and_xxx() functions.
|
||||||
|
|
||||||
|
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
|
||||||
|
Signed-off-by: Chester Lin <clin@suse.com>
|
||||||
|
---
|
||||||
|
kexec/arch/arm64/crashdump-arm64.c | 25 ++++++++++---------------
|
||||||
|
1 file changed, 10 insertions(+), 15 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c
|
||||||
|
index 4fd7aa8fd43c..38d1a0f3000d 100644
|
||||||
|
--- a/kexec/arch/arm64/crashdump-arm64.c
|
||||||
|
+++ b/kexec/arch/arm64/crashdump-arm64.c
|
||||||
|
@@ -23,13 +23,8 @@
|
||||||
|
#include "kexec-elf.h"
|
||||||
|
#include "mem_regions.h"
|
||||||
|
|
||||||
|
-/* memory ranges on crashed kernel */
|
||||||
|
-static struct memory_range system_memory_ranges[CRASH_MAX_MEMORY_RANGES];
|
||||||
|
-static struct memory_ranges system_memory_rgns = {
|
||||||
|
- .size = 0,
|
||||||
|
- .max_size = CRASH_MAX_MEMORY_RANGES,
|
||||||
|
- .ranges = system_memory_ranges,
|
||||||
|
-};
|
||||||
|
+/* memory ranges of crashed kernel */
|
||||||
|
+static struct memory_ranges system_memory_rgns;
|
||||||
|
|
||||||
|
/* memory range reserved for crashkernel */
|
||||||
|
struct memory_range crash_reserved_mem;
|
||||||
|
@@ -82,7 +77,7 @@ static uint64_t get_kernel_page_offset(void)
|
||||||
|
*
|
||||||
|
* This function is called once for each memory region found in /proc/iomem.
|
||||||
|
* It locates system RAM and crashkernel reserved memory and places these to
|
||||||
|
- * variables, respectively, system_memory_ranges and crash_reserved_mem.
|
||||||
|
+ * variables, respectively, system_memory_rgns and usablemem_rgns.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static int iomem_range_callback(void *UNUSED(data), int UNUSED(nr),
|
||||||
|
@@ -90,11 +85,11 @@ static int iomem_range_callback(void *UNUSED(data), int UNUSED(nr),
|
||||||
|
unsigned long long length)
|
||||||
|
{
|
||||||
|
if (strncmp(str, CRASH_KERNEL, strlen(CRASH_KERNEL)) == 0)
|
||||||
|
- return mem_regions_add(&usablemem_rgns,
|
||||||
|
- base, length, RANGE_RAM);
|
||||||
|
+ return mem_regions_alloc_and_add(&usablemem_rgns,
|
||||||
|
+ base, length, RANGE_RAM);
|
||||||
|
else if (strncmp(str, SYSTEM_RAM, strlen(SYSTEM_RAM)) == 0)
|
||||||
|
- return mem_regions_add(&system_memory_rgns,
|
||||||
|
- base, length, RANGE_RAM);
|
||||||
|
+ return mem_regions_alloc_and_add(&system_memory_rgns,
|
||||||
|
+ base, length, RANGE_RAM);
|
||||||
|
else if (strncmp(str, KERNEL_CODE, strlen(KERNEL_CODE)) == 0)
|
||||||
|
elf_info.kern_paddr_start = base;
|
||||||
|
else if (strncmp(str, KERNEL_DATA, strlen(KERNEL_DATA)) == 0)
|
||||||
|
@@ -135,9 +130,9 @@ static int crash_get_memory_ranges(void)
|
||||||
|
|
||||||
|
dbgprint_mem_range("Reserved memory range", &crash_reserved_mem, 1);
|
||||||
|
|
||||||
|
- if (mem_regions_exclude(&system_memory_rgns, &crash_reserved_mem)) {
|
||||||
|
- fprintf(stderr,
|
||||||
|
- "Error: Number of crash memory ranges excedeed the max limit\n");
|
||||||
|
+ if (mem_regions_alloc_and_exclude(&system_memory_rgns,
|
||||||
|
+ &crash_reserved_mem)) {
|
||||||
|
+ fprintf(stderr, "Cannot allocate memory for ranges\n");
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,247 @@
|
||||||
|
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
|
||||||
|
Date: Fri, 11 Jan 2019 01:59:45 +0900
|
||||||
|
Subject: arm64: kexec: allocate memory space avoiding reserved regions
|
||||||
|
References: jsc#SLE-9943
|
||||||
|
Upstream: not yet, it's under review in upstream
|
||||||
|
|
||||||
|
On UEFI/ACPI-only system, some memory regions, including but not limited
|
||||||
|
to UEFI memory map and ACPI tables, must be preserved across kexec'ing.
|
||||||
|
Otherwise, they can be corrupted and result in early failure in booting
|
||||||
|
a new kernel.
|
||||||
|
|
||||||
|
In recent kernels, /proc/iomem now has an extended file format like:
|
||||||
|
40000000-5871ffff : System RAM
|
||||||
|
41800000-426affff : Kernel code
|
||||||
|
426b0000-42aaffff : reserved
|
||||||
|
42ab0000-42c64fff : Kernel data
|
||||||
|
54400000-583fffff : Crash kernel
|
||||||
|
58590000-585effff : reserved
|
||||||
|
58700000-5871ffff : reserved
|
||||||
|
58720000-58b5ffff : reserved
|
||||||
|
58b60000-5be3ffff : System RAM
|
||||||
|
58b61000-58b61fff : reserved
|
||||||
|
59a77000-59a77fff : reserved
|
||||||
|
5be40000-5becffff : reserved
|
||||||
|
5bed0000-5bedffff : System RAM
|
||||||
|
5bee0000-5bffffff : reserved
|
||||||
|
5c000000-5fffffff : System RAM
|
||||||
|
5da00000-5e9fffff : reserved
|
||||||
|
5ec00000-5edfffff : reserved
|
||||||
|
5ef6a000-5ef6afff : reserved
|
||||||
|
5ef6b000-5efcafff : reserved
|
||||||
|
5efcd000-5efcffff : reserved
|
||||||
|
5efd0000-5effffff : reserved
|
||||||
|
5f000000-5fffffff : reserved
|
||||||
|
|
||||||
|
where the "reserved" entries at the top level or under System RAM (and
|
||||||
|
its descendant resources) are ones of such kind and should not be regarded
|
||||||
|
as usable memory ranges where several free spaces for loading kexec data
|
||||||
|
will be allocated.
|
||||||
|
|
||||||
|
With this patch, get_memory_ranges() will handle this format of file
|
||||||
|
correctly. Note that, for safety, unknown regions, in addition to
|
||||||
|
"reserved" ones, will also be excluded.
|
||||||
|
|
||||||
|
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
|
||||||
|
Signed-off-by: Chester Lin <clin@suse.com>
|
||||||
|
---
|
||||||
|
kexec/arch/arm64/kexec-arm64.c | 146 ++++++++++++++++++++-------------
|
||||||
|
1 file changed, 87 insertions(+), 59 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
|
||||||
|
index 1cde75d1a771..2e923b54f5b1 100644
|
||||||
|
--- a/kexec/arch/arm64/kexec-arm64.c
|
||||||
|
+++ b/kexec/arch/arm64/kexec-arm64.c
|
||||||
|
@@ -10,7 +10,9 @@
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <libfdt.h>
|
||||||
|
#include <limits.h>
|
||||||
|
+#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
+#include <string.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <linux/elf-em.h>
|
||||||
|
#include <elf.h>
|
||||||
|
@@ -29,6 +31,7 @@
|
||||||
|
#include "fs2dt.h"
|
||||||
|
#include "iomem.h"
|
||||||
|
#include "kexec-syscall.h"
|
||||||
|
+#include "mem_regions.h"
|
||||||
|
#include "arch/options.h"
|
||||||
|
|
||||||
|
#define ROOT_NODE_ADDR_CELLS_DEFAULT 1
|
||||||
|
@@ -899,19 +902,33 @@ int get_phys_base_from_pt_load(unsigned long *phys_offset)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static bool to_be_excluded(char *str)
|
||||||
|
+{
|
||||||
|
+ if (!strncmp(str, SYSTEM_RAM, strlen(SYSTEM_RAM)) ||
|
||||||
|
+ !strncmp(str, KERNEL_CODE, strlen(KERNEL_CODE)) ||
|
||||||
|
+ !strncmp(str, KERNEL_DATA, strlen(KERNEL_DATA)) ||
|
||||||
|
+ !strncmp(str, CRASH_KERNEL, strlen(CRASH_KERNEL)))
|
||||||
|
+ return false;
|
||||||
|
+ else
|
||||||
|
+ return true;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
- * get_memory_ranges_iomem_cb - Helper for get_memory_ranges_iomem.
|
||||||
|
+ * get_memory_ranges - Try to get the memory ranges from
|
||||||
|
+ * /proc/iomem.
|
||||||
|
*/
|
||||||
|
-
|
||||||
|
-static int get_memory_ranges_iomem_cb(void *data, int nr, char *str,
|
||||||
|
- unsigned long long base, unsigned long long length)
|
||||||
|
+int get_memory_ranges(struct memory_range **range, int *ranges,
|
||||||
|
+ unsigned long kexec_flags)
|
||||||
|
{
|
||||||
|
- int ret;
|
||||||
|
unsigned long phys_offset = UINT64_MAX;
|
||||||
|
- struct memory_range *r;
|
||||||
|
-
|
||||||
|
- if (nr >= KEXEC_SEGMENT_MAX)
|
||||||
|
- return -1;
|
||||||
|
+ FILE *fp;
|
||||||
|
+ const char *iomem = proc_iomem();
|
||||||
|
+ char line[MAX_LINE], *str;
|
||||||
|
+ unsigned long long start, end;
|
||||||
|
+ int n, consumed;
|
||||||
|
+ struct memory_ranges memranges;
|
||||||
|
+ struct memory_range *last, excl_range;
|
||||||
|
+ int ret;
|
||||||
|
|
||||||
|
if (!try_read_phys_offset_from_kcore) {
|
||||||
|
/* Since kernel version 4.19, 'kcore' contains
|
||||||
|
@@ -945,17 +962,65 @@ static int get_memory_ranges_iomem_cb(void *data, int nr, char *str,
|
||||||
|
try_read_phys_offset_from_kcore = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
- r = (struct memory_range *)data + nr;
|
||||||
|
+ fp = fopen(iomem, "r");
|
||||||
|
+ if (!fp)
|
||||||
|
+ die("Cannot open %s\n", iomem);
|
||||||
|
+
|
||||||
|
+ memranges.ranges = NULL;
|
||||||
|
+ memranges.size = memranges.max_size = 0;
|
||||||
|
+
|
||||||
|
+ while (fgets(line, sizeof(line), fp) != 0) {
|
||||||
|
+ n = sscanf(line, "%llx-%llx : %n", &start, &end, &consumed);
|
||||||
|
+ if (n != 2)
|
||||||
|
+ continue;
|
||||||
|
+ str = line + consumed;
|
||||||
|
+
|
||||||
|
+ if (!strncmp(str, SYSTEM_RAM, strlen(SYSTEM_RAM))) {
|
||||||
|
+ ret = mem_regions_alloc_and_add(&memranges,
|
||||||
|
+ start, end - start + 1, RANGE_RAM);
|
||||||
|
+ if (ret) {
|
||||||
|
+ fprintf(stderr,
|
||||||
|
+ "Cannot allocate memory for ranges\n");
|
||||||
|
+ return -ENOMEM;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- if (!strncmp(str, SYSTEM_RAM, strlen(SYSTEM_RAM)))
|
||||||
|
- r->type = RANGE_RAM;
|
||||||
|
- else if (!strncmp(str, IOMEM_RESERVED, strlen(IOMEM_RESERVED)))
|
||||||
|
- r->type = RANGE_RESERVED;
|
||||||
|
- else
|
||||||
|
- return 1;
|
||||||
|
+ dbgprintf("%s:+[%d] %016llx - %016llx\n", __func__,
|
||||||
|
+ memranges.size - 1,
|
||||||
|
+ memranges.ranges[memranges.size - 1].start,
|
||||||
|
+ memranges.ranges[memranges.size - 1].end);
|
||||||
|
+ } else if (to_be_excluded(str)) {
|
||||||
|
+ if (!memranges.size)
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Note: mem_regions_exclude() doesn't guarantee
|
||||||
|
+ * that the ranges are sorted out, but as long as
|
||||||
|
+ * we cope with /proc/iomem, we only operate on
|
||||||
|
+ * the last entry and so it is safe.
|
||||||
|
+ */
|
||||||
|
|
||||||
|
- r->start = base;
|
||||||
|
- r->end = base + length - 1;
|
||||||
|
+ /* The last System RAM range */
|
||||||
|
+ last = &memranges.ranges[memranges.size - 1];
|
||||||
|
+
|
||||||
|
+ if (last->end < start)
|
||||||
|
+ /* New resource outside of System RAM */
|
||||||
|
+ continue;
|
||||||
|
+ if (end < last->start)
|
||||||
|
+ /* Already excluded by parent resource */
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ excl_range.start = start;
|
||||||
|
+ excl_range.end = end;
|
||||||
|
+ mem_regions_alloc_and_exclude(&memranges, &excl_range);
|
||||||
|
+ dbgprintf("%s:- %016llx - %016llx\n",
|
||||||
|
+ __func__, start, end);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ fclose(fp);
|
||||||
|
+
|
||||||
|
+ *range = memranges.ranges;
|
||||||
|
+ *ranges = memranges.size;
|
||||||
|
|
||||||
|
/* As a fallback option, we can try determining the PHYS_OFFSET
|
||||||
|
* value from the '/proc/iomem' entries as well.
|
||||||
|
@@ -976,52 +1041,15 @@ static int get_memory_ranges_iomem_cb(void *data, int nr, char *str,
|
||||||
|
* between the user-space and kernel space 'PHYS_OFFSET'
|
||||||
|
* value.
|
||||||
|
*/
|
||||||
|
- set_phys_offset(r->start, "iomem");
|
||||||
|
+ if (memranges.size)
|
||||||
|
+ set_phys_offset(memranges.ranges[0].start, "iomem");
|
||||||
|
|
||||||
|
- dbgprintf("%s: %016llx - %016llx : %s", __func__, r->start,
|
||||||
|
- r->end, str);
|
||||||
|
+ dbgprint_mem_range("System RAM ranges;",
|
||||||
|
+ memranges.ranges, memranges.size);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
-/**
|
||||||
|
- * get_memory_ranges_iomem - Try to get the memory ranges from
|
||||||
|
- * /proc/iomem.
|
||||||
|
- */
|
||||||
|
-
|
||||||
|
-static int get_memory_ranges_iomem(struct memory_range *array,
|
||||||
|
- unsigned int *count)
|
||||||
|
-{
|
||||||
|
- *count = kexec_iomem_for_each_line(NULL,
|
||||||
|
- get_memory_ranges_iomem_cb, array);
|
||||||
|
-
|
||||||
|
- if (!*count) {
|
||||||
|
- dbgprintf("%s: failed: No RAM found.\n", __func__);
|
||||||
|
- return EFAILED;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- return 0;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-/**
|
||||||
|
- * get_memory_ranges - Try to get the memory ranges some how.
|
||||||
|
- */
|
||||||
|
-
|
||||||
|
-int get_memory_ranges(struct memory_range **range, int *ranges,
|
||||||
|
- unsigned long kexec_flags)
|
||||||
|
-{
|
||||||
|
- static struct memory_range array[KEXEC_SEGMENT_MAX];
|
||||||
|
- unsigned int count;
|
||||||
|
- int result;
|
||||||
|
-
|
||||||
|
- result = get_memory_ranges_iomem(array, &count);
|
||||||
|
-
|
||||||
|
- *range = result ? NULL : array;
|
||||||
|
- *ranges = result ? 0 : count;
|
||||||
|
-
|
||||||
|
- return result;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
int arch_compat_trampoline(struct kexec_info *info)
|
||||||
|
{
|
||||||
|
return 0;
|
70
kexec-tools-build-multiboot2-for-i386.patch
Normal file
70
kexec-tools-build-multiboot2-for-i386.patch
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
From: Chris Packham <chris.packham@alliedtelesis.co.nz>
|
||||||
|
Date: Sun, 17 Nov 2019 15:52:15 -0800
|
||||||
|
Subject: kexec: build multiboot2 for i386
|
||||||
|
References: jsc#SLE-9943
|
||||||
|
Upstream: Queued, http://lists.infradead.org/pipermail/kexec/2020-January/024311.html
|
||||||
|
|
||||||
|
This addresses the following compilation issues when building for i386.
|
||||||
|
|
||||||
|
kexec/arch/i386/kexec-x86.c:39:22: error: 'multiboot2_x86_probe' undeclared here (not in a function); did you mean 'multiboot_x86_probe'?
|
||||||
|
{ "multiboot2-x86", multiboot2_x86_probe, multiboot2_x86_load,
|
||||||
|
^~~~~~~~~~~~~~~~~~~~
|
||||||
|
multiboot_x86_probe
|
||||||
|
kexec/arch/i386/kexec-x86.c:39:44: error: 'multiboot2_x86_load' undeclared here (not in a function); did you mean 'multiboot_x86_load'?
|
||||||
|
{ "multiboot2-x86", multiboot2_x86_probe, multiboot2_x86_load,
|
||||||
|
^~~~~~~~~~~~~~~~~~~
|
||||||
|
multiboot_x86_load
|
||||||
|
kexec/arch/i386/kexec-x86.c:40:4: error: 'multiboot2_x86_usage' undeclared here (not in a function); did you mean 'multiboot_x86_usage'?
|
||||||
|
multiboot2_x86_usage },
|
||||||
|
^~~~~~~~~~~~~~~~~~~~
|
||||||
|
multiboot_x86_usage
|
||||||
|
make: *** [Makefile:114: kexec/arch/i386/kexec-x86.o] Error 1
|
||||||
|
make: *** Waiting for unfinished jobs....
|
||||||
|
|
||||||
|
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
|
||||||
|
Signed-off-by: Chester Lin <clin@suse.com>
|
||||||
|
---
|
||||||
|
I wasn't sure whether this should be fixed by linking with kexec-mb2-x86.o or
|
||||||
|
by removing the code from kexec-x86.c. I went for the former but I'd happily
|
||||||
|
change to the latter.
|
||||||
|
|
||||||
|
kexec/arch/i386/Makefile | 2 +-
|
||||||
|
kexec/arch/i386/kexec-x86.h | 5 +++++
|
||||||
|
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/kexec/arch/i386/Makefile b/kexec/arch/i386/Makefile
|
||||||
|
index 105cefd..f486103 100644
|
||||||
|
--- a/kexec/arch/i386/Makefile
|
||||||
|
+++ b/kexec/arch/i386/Makefile
|
||||||
|
@@ -7,6 +7,7 @@ i386_KEXEC_SRCS += kexec/arch/i386/kexec-elf-x86.c
|
||||||
|
i386_KEXEC_SRCS += kexec/arch/i386/kexec-elf-rel-x86.c
|
||||||
|
i386_KEXEC_SRCS += kexec/arch/i386/kexec-bzImage.c
|
||||||
|
i386_KEXEC_SRCS += kexec/arch/i386/kexec-multiboot-x86.c
|
||||||
|
+i386_KEXEC_SRCS += kexec/arch/i386/kexec-mb2-x86.c
|
||||||
|
i386_KEXEC_SRCS += kexec/arch/i386/kexec-beoboot-x86.c
|
||||||
|
i386_KEXEC_SRCS += kexec/arch/i386/kexec-nbi.c
|
||||||
|
i386_KEXEC_SRCS += kexec/arch/i386/x86-linux-setup.c
|
||||||
|
@@ -14,7 +15,6 @@ i386_KEXEC_SRCS += kexec/arch/i386/crashdump-x86.c
|
||||||
|
|
||||||
|
dist += kexec/arch/i386/Makefile $(i386_KEXEC_SRCS) \
|
||||||
|
kexec/arch/i386/crashdump-x86.h \
|
||||||
|
- kexec/arch/i386/kexec-mb2-x86.c \
|
||||||
|
kexec/arch/i386/kexec-x86.h \
|
||||||
|
kexec/arch/i386/x86-linux-setup.h \
|
||||||
|
kexec/arch/i386/include/arch/options.h
|
||||||
|
diff --git a/kexec/arch/i386/kexec-x86.h b/kexec/arch/i386/kexec-x86.h
|
||||||
|
index 1b58c3b..0f941df 100644
|
||||||
|
--- a/kexec/arch/i386/kexec-x86.h
|
||||||
|
+++ b/kexec/arch/i386/kexec-x86.h
|
||||||
|
@@ -60,6 +60,11 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
|
||||||
|
struct kexec_info *info);
|
||||||
|
void multiboot_x86_usage(void);
|
||||||
|
|
||||||
|
+int multiboot2_x86_load(int argc, char **argv, const char *buf, off_t len,
|
||||||
|
+ struct kexec_info *info);
|
||||||
|
+void multiboot2_x86_usage(void);
|
||||||
|
+int multiboot2_x86_probe(const char *buf, off_t buf_len);
|
||||||
|
+
|
||||||
|
int elf_x86_probe(const char *buf, off_t len);
|
||||||
|
int elf_x86_load(int argc, char **argv, const char *buf, off_t len,
|
||||||
|
struct kexec_info *info);
|
26
kexec-tools-disable-test.patch
Normal file
26
kexec-tools-disable-test.patch
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
From: Tony Jones <tonyj@suse.de>
|
||||||
|
Subject: Disable kexec_test
|
||||||
|
|
||||||
|
Disable kexec_test. It is not required in released product (matching latest
|
||||||
|
Fedora). Also one less file for usr_merge
|
||||||
|
|
||||||
|
---
|
||||||
|
Makefile.in | 7 +++++--
|
||||||
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- a/Makefile.in
|
||||||
|
+++ b/Makefile.in
|
||||||
|
@@ -173,8 +173,11 @@ PSRCS:=$(foreach s, $(SRCS), $(PACKAGE_N
|
||||||
|
PGSRCS:=$(foreach s, $(GENERATED_SRCS), $(PACKAGE_NAME)-$(PACKAGE_VERSION)/$(s))
|
||||||
|
|
||||||
|
MAN_PAGES:=$(KEXEC_MANPAGE) $(VMCORE_DMESG_MANPAGE)
|
||||||
|
-BINARIES_i386:=$(KEXEC_TEST)
|
||||||
|
-BINARIES_x86_64:=$(KEXEC_TEST)
|
||||||
|
+# Dont' build kexec_test
|
||||||
|
+#BINARIES_i386:=$(KEXEC_TEST)
|
||||||
|
+#BINARIES_x86_64:=$(KEXEC_TEST)
|
||||||
|
+BINARIES_i386:=
|
||||||
|
+BINARIES_x86_64:=
|
||||||
|
BINARIES:=$(KEXEC) $(VMCORE_DMESG) $(BINARIES_$(ARCH))
|
||||||
|
|
||||||
|
UNINSTALL_KDUMP = $(sbindir)/kdump
|
230
kexec-tools-fix-kexec_file_load-error-handling.patch
Normal file
230
kexec-tools-fix-kexec_file_load-error-handling.patch
Normal file
|
@ -0,0 +1,230 @@
|
||||||
|
From 0ec1fd23847ba103f967e3377e2a1b13712cff6e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Petr Tesarik <ptesarik@suse.com>
|
||||||
|
Date: Thu, 12 Mar 2020 20:12:12 +0100
|
||||||
|
Upstream: not yet, patch sent 2020-03-12
|
||||||
|
Subject: Fix kexec_file_load(2) error handling
|
||||||
|
References: bsc#1166105
|
||||||
|
|
||||||
|
The handling of kexec_file_load() error conditions needs some
|
||||||
|
improvement.
|
||||||
|
|
||||||
|
First, on failure, the system call itself returns -1 and sets
|
||||||
|
errno. It is wrong to check the return value itself.
|
||||||
|
|
||||||
|
Second, do_kexec_file_load() mixes different types of error
|
||||||
|
codes (-1, return value of a load method, negative kernel error
|
||||||
|
number). Let it always return one of the reason codes defined in
|
||||||
|
kexec/kexec.h.
|
||||||
|
|
||||||
|
Third, the caller of do_kexec_file_load() cannot know what exactly
|
||||||
|
failed inside that function, so it should not check errno directly.
|
||||||
|
All it needs to know is whether it makes sense to fall back to the
|
||||||
|
other syscall. Add an error code for that purpose (EFALLBACK), and
|
||||||
|
let do_kexec_file_load() decide.
|
||||||
|
|
||||||
|
Fourth, do_kexec_file_load() should not print any error message if
|
||||||
|
it returns EFALLBACK, because the fallback syscall may succeed
|
||||||
|
later, and the user is confused whether the command failed, or not.
|
||||||
|
Move the error message towards the end of main().
|
||||||
|
|
||||||
|
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
|
||||||
|
---
|
||||||
|
kexec/kexec.c | 114 ++++++++++++++++++++++++++++++----------------------------
|
||||||
|
kexec/kexec.h | 1 +
|
||||||
|
2 files changed, 61 insertions(+), 54 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/kexec/kexec.c b/kexec/kexec.c
|
||||||
|
index bc6ab3d..33c1b4b 100644
|
||||||
|
--- a/kexec/kexec.c
|
||||||
|
+++ b/kexec/kexec.c
|
||||||
|
@@ -836,11 +836,21 @@ static int kexec_file_unload(unsigned long kexec_file_flags)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
+ if (!is_kexec_file_load_implemented())
|
||||||
|
+ return EFALLBACK;
|
||||||
|
+
|
||||||
|
ret = kexec_file_load(-1, -1, 0, NULL, kexec_file_flags);
|
||||||
|
if (ret != 0) {
|
||||||
|
- /* The unload failed, print some debugging information */
|
||||||
|
- fprintf(stderr, "kexec_file_load(unload) failed\n: %s\n",
|
||||||
|
- strerror(errno));
|
||||||
|
+ if (errno == ENOSYS) {
|
||||||
|
+ ret = EFALLBACK;
|
||||||
|
+ } else {
|
||||||
|
+ /*
|
||||||
|
+ * The unload failed, print some debugging
|
||||||
|
+ * information */
|
||||||
|
+ fprintf(stderr, "kexec_file_load(unload) failed: %s\n",
|
||||||
|
+ strerror(errno));
|
||||||
|
+ ret = EFAILED;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
@@ -1182,15 +1192,13 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
|
||||||
|
info.file_mode = 1;
|
||||||
|
info.initrd_fd = -1;
|
||||||
|
|
||||||
|
- if (!is_kexec_file_load_implemented()) {
|
||||||
|
- fprintf(stderr, "syscall kexec_file_load not available.\n");
|
||||||
|
- return -ENOSYS;
|
||||||
|
- }
|
||||||
|
+ if (!is_kexec_file_load_implemented())
|
||||||
|
+ return EFALLBACK;
|
||||||
|
|
||||||
|
if (argc - fileind <= 0) {
|
||||||
|
fprintf(stderr, "No kernel specified\n");
|
||||||
|
usage();
|
||||||
|
- return -1;
|
||||||
|
+ return EFAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
kernel = argv[fileind];
|
||||||
|
@@ -1199,7 +1207,7 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
|
||||||
|
if (kernel_fd == -1) {
|
||||||
|
fprintf(stderr, "Failed to open file %s:%s\n", kernel,
|
||||||
|
strerror(errno));
|
||||||
|
- return -1;
|
||||||
|
+ return EFAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* slurp in the input kernel */
|
||||||
|
@@ -1225,7 +1233,7 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
|
||||||
|
if (i == file_types) {
|
||||||
|
fprintf(stderr, "Cannot determine the file type " "of %s\n",
|
||||||
|
kernel);
|
||||||
|
- return -1;
|
||||||
|
+ return EFAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = file_type[i].load(argc, argv, kernel_buf, kernel_size, &info);
|
||||||
|
@@ -1243,9 +1251,43 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
|
||||||
|
|
||||||
|
ret = kexec_file_load(kernel_fd, info.initrd_fd, info.command_line_len,
|
||||||
|
info.command_line, info.kexec_flags);
|
||||||
|
- if (ret != 0)
|
||||||
|
- fprintf(stderr, "kexec_file_load failed: %s\n",
|
||||||
|
- strerror(errno));
|
||||||
|
+ if (ret != 0) {
|
||||||
|
+ switch (errno) {
|
||||||
|
+ /*
|
||||||
|
+ * Something failed with signature verification.
|
||||||
|
+ * Reject the image.
|
||||||
|
+ */
|
||||||
|
+ case ELIBBAD:
|
||||||
|
+ case EKEYREJECTED:
|
||||||
|
+ case ENOPKG:
|
||||||
|
+ case ENOKEY:
|
||||||
|
+ case EBADMSG:
|
||||||
|
+ case EMSGSIZE:
|
||||||
|
+ /* Reject by default. */
|
||||||
|
+ default:
|
||||||
|
+ ret = EFAILED;
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ /* Not implemented. */
|
||||||
|
+ case ENOSYS:
|
||||||
|
+ /*
|
||||||
|
+ * Parsing image or other options failed
|
||||||
|
+ * The image may be invalid or image
|
||||||
|
+ * type may not supported by kernel so
|
||||||
|
+ * retry parsing in kexec-tools.
|
||||||
|
+ */
|
||||||
|
+ case EINVAL:
|
||||||
|
+ case ENOEXEC:
|
||||||
|
+ /*
|
||||||
|
+ * ENOTSUP can be unsupported image
|
||||||
|
+ * type or unsupported PE signature
|
||||||
|
+ * wrapper type, duh.
|
||||||
|
+ */
|
||||||
|
+ case ENOTSUP:
|
||||||
|
+ ret = EFALLBACK;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
|
||||||
|
close(kernel_fd);
|
||||||
|
return ret;
|
||||||
|
@@ -1496,7 +1538,7 @@ int main(int argc, char *argv[])
|
||||||
|
if (do_unload) {
|
||||||
|
if (do_kexec_file_syscall) {
|
||||||
|
result = kexec_file_unload(kexec_file_flags);
|
||||||
|
- if ((result == -ENOSYS) && do_kexec_fallback)
|
||||||
|
+ if (result == EFALLBACK && do_kexec_fallback)
|
||||||
|
do_kexec_file_syscall = 0;
|
||||||
|
}
|
||||||
|
if (!do_kexec_file_syscall)
|
||||||
|
@@ -1506,46 +1548,8 @@ int main(int argc, char *argv[])
|
||||||
|
if (do_kexec_file_syscall) {
|
||||||
|
result = do_kexec_file_load(fileind, argc, argv,
|
||||||
|
kexec_file_flags);
|
||||||
|
- if (do_kexec_fallback) switch (result) {
|
||||||
|
- /*
|
||||||
|
- * Something failed with signature verification.
|
||||||
|
- * Reject the image.
|
||||||
|
- */
|
||||||
|
- case -ELIBBAD:
|
||||||
|
- case -EKEYREJECTED:
|
||||||
|
- case -ENOPKG:
|
||||||
|
- case -ENOKEY:
|
||||||
|
- case -EBADMSG:
|
||||||
|
- case -EMSGSIZE:
|
||||||
|
- /*
|
||||||
|
- * By default reject or do nothing if
|
||||||
|
- * succeded
|
||||||
|
- */
|
||||||
|
- default: break;
|
||||||
|
- case -ENOSYS: /* not implemented */
|
||||||
|
- /*
|
||||||
|
- * Parsing image or other options failed
|
||||||
|
- * The image may be invalid or image
|
||||||
|
- * type may not supported by kernel so
|
||||||
|
- * retry parsing in kexec-tools.
|
||||||
|
- */
|
||||||
|
- case -EINVAL:
|
||||||
|
- case -ENOEXEC:
|
||||||
|
- /*
|
||||||
|
- * ENOTSUP can be unsupported image
|
||||||
|
- * type or unsupported PE signature
|
||||||
|
- * wrapper type, duh
|
||||||
|
- *
|
||||||
|
- * The kernel sometimes wrongly
|
||||||
|
- * returns ENOTSUPP (524) - ignore
|
||||||
|
- * that. It is not supposed to be seen
|
||||||
|
- * by userspace so seeing it is a
|
||||||
|
- * kernel bug
|
||||||
|
- */
|
||||||
|
- case -ENOTSUP:
|
||||||
|
- do_kexec_file_syscall = 0;
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
+ if (result == EFALLBACK && do_kexec_fallback)
|
||||||
|
+ do_kexec_file_syscall = 0;
|
||||||
|
}
|
||||||
|
if (!do_kexec_file_syscall)
|
||||||
|
result = my_load(type, fileind, argc, argv,
|
||||||
|
@@ -1570,6 +1574,8 @@ int main(int argc, char *argv[])
|
||||||
|
if ((result == 0) && do_load_jump_back_helper) {
|
||||||
|
result = my_load_jump_back_helper(kexec_flags, entry);
|
||||||
|
}
|
||||||
|
+ if (result == EFALLBACK)
|
||||||
|
+ fputs("syscall kexec_file_load not available.\n", stderr);
|
||||||
|
|
||||||
|
fflush(stdout);
|
||||||
|
fflush(stderr);
|
||||||
|
diff --git a/kexec/kexec.h b/kexec/kexec.h
|
||||||
|
index a97b9ce..28fd129 100644
|
||||||
|
--- a/kexec/kexec.h
|
||||||
|
+++ b/kexec/kexec.h
|
||||||
|
@@ -63,6 +63,7 @@
|
||||||
|
*/
|
||||||
|
#define EFAILED -1 /* default error code */
|
||||||
|
#define ENOCRASHKERNEL -2 /* no memory reserved for crashkernel */
|
||||||
|
+#define EFALLBACK -3 /* fallback to kexec_load(2) may work */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This function doesn't actually exist. The idea is that when someone
|
||||||
|
--
|
||||||
|
2.16.4
|
||||||
|
|
36
kexec-tools-print-error-if-kexec_file_load-fails.patch
Normal file
36
kexec-tools-print-error-if-kexec_file_load-fails.patch
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
From: Hari Bathini <hbathini@linux.ibm.com>
|
||||||
|
Date: Wed Mar 16 16:03:05 2022 +0530
|
||||||
|
Subject: kexec-tools: print error if kexec_file_load fails
|
||||||
|
References: bsc#1197176
|
||||||
|
Git-commit: 1d7a308bf7349fcf1627e950159029dfccf85891
|
||||||
|
Upstream: merged
|
||||||
|
|
||||||
|
Commit 4f77da634035 ("kexec-tools: Fix kexec_file_load(2) error
|
||||||
|
handling") introduced EFALLBACK for scenarios where fallbacking back
|
||||||
|
to kexec_load syscall is likely to work and dropped printing error
|
||||||
|
message for these scenarios. But printing error message for other
|
||||||
|
failure scenarios was inadvertently dropped. Restore printing error
|
||||||
|
message for such cases.
|
||||||
|
|
||||||
|
Fixes: 4f77da634035 ("kexec-tools: Fix kexec_file_load(2) error handling")
|
||||||
|
Cc: Petr Tesarik <ptesarik@suse.com>
|
||||||
|
Reported-by: Nageswara R Sastry <rnsastry@linux.ibm.com>
|
||||||
|
Tested-by: Nageswara R Sastry <rnsastry@linux.ibm.com>
|
||||||
|
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
|
||||||
|
Reviewed-by: Petr Tesarik <ptesarik@suse.com>
|
||||||
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
||||||
|
|
||||||
|
---
|
||||||
|
kexec/kexec.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
--- a/kexec/kexec.c
|
||||||
|
+++ b/kexec/kexec.c
|
||||||
|
@@ -1265,6 +1265,7 @@ static int do_kexec_file_load(int filein
|
||||||
|
case EMSGSIZE:
|
||||||
|
/* Reject by default. */
|
||||||
|
default:
|
||||||
|
+ fprintf(stderr, "kexec_file_load failed: %s\n", strerror(errno));
|
||||||
|
ret = EFAILED;
|
||||||
|
break;
|
||||||
|
|
54
kexec-tools-reset-getopt-before-falling-back-to-legacy.patch
Normal file
54
kexec-tools-reset-getopt-before-falling-back-to-legacy.patch
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
From dadafc4664c7b78ea1561ccca33986c9639106ec Mon Sep 17 00:00:00 2001
|
||||||
|
From: Petr Tesarik <ptesarik@suse.com>
|
||||||
|
Date: Fri, 13 Mar 2020 14:54:00 +0100
|
||||||
|
Upstream: not yet, patch sent 2020-03-13
|
||||||
|
Subject: Reset getopt before falling back to legacy syscall
|
||||||
|
References: bsc#1166105
|
||||||
|
|
||||||
|
The modules may need to parse the arguments again after
|
||||||
|
kexec_file_load(2) failed, but getopt is not reset.
|
||||||
|
|
||||||
|
This change fixes the --initrd option on s390x. Without this patch,
|
||||||
|
it will fail to load the initrd on kernels that do not implement
|
||||||
|
kexec_file_load(2).
|
||||||
|
|
||||||
|
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
|
||||||
|
---
|
||||||
|
kexec/kexec.c | 12 ++++++++++--
|
||||||
|
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/kexec/kexec.c b/kexec/kexec.c
|
||||||
|
index 33c1b4b..6601f1f 100644
|
||||||
|
--- a/kexec/kexec.c
|
||||||
|
+++ b/kexec/kexec.c
|
||||||
|
@@ -1538,8 +1538,12 @@ int main(int argc, char *argv[])
|
||||||
|
if (do_unload) {
|
||||||
|
if (do_kexec_file_syscall) {
|
||||||
|
result = kexec_file_unload(kexec_file_flags);
|
||||||
|
- if (result == EFALLBACK && do_kexec_fallback)
|
||||||
|
+ if (result == EFALLBACK && do_kexec_fallback) {
|
||||||
|
+ /* Reset getopt for fallback */
|
||||||
|
+ opterr = 1;
|
||||||
|
+ optind = 1;
|
||||||
|
do_kexec_file_syscall = 0;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
if (!do_kexec_file_syscall)
|
||||||
|
result = k_unload(kexec_flags);
|
||||||
|
@@ -1548,8 +1552,12 @@ int main(int argc, char *argv[])
|
||||||
|
if (do_kexec_file_syscall) {
|
||||||
|
result = do_kexec_file_load(fileind, argc, argv,
|
||||||
|
kexec_file_flags);
|
||||||
|
- if (result == EFALLBACK && do_kexec_fallback)
|
||||||
|
+ if (result == EFALLBACK && do_kexec_fallback) {
|
||||||
|
+ /* Reset getopt for fallback */
|
||||||
|
+ opterr = 1;
|
||||||
|
+ optind = 1;
|
||||||
|
do_kexec_file_syscall = 0;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
if (!do_kexec_file_syscall)
|
||||||
|
result = my_load(type, fileind, argc, argv,
|
||||||
|
--
|
||||||
|
2.16.4
|
||||||
|
|
16
kexec-tools-rpmlintrc
Normal file
16
kexec-tools-rpmlintrc
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#
|
||||||
|
# The name for the init script is correct. kexec-tools is no name
|
||||||
|
# for an init script.
|
||||||
|
addFilter(".*incoherent-init-script-name.*");
|
||||||
|
|
||||||
|
#
|
||||||
|
# $null is a valid dependency.
|
||||||
|
addFilter(".*init-script-undefined-dependency.*");
|
||||||
|
|
||||||
|
#
|
||||||
|
# It does not make any sense to stop the "service" kexec on removal.
|
||||||
|
# kexec is no service but an init script to run kexec when rebooting.
|
||||||
|
# Stopping it here would lead to a very unexpected behaviour on reboot. :)
|
||||||
|
addFilter(".*init-script-without-%stop_on_removal-preun.*");
|
||||||
|
|
||||||
|
# :mode=python:
|
31
kexec-tools-s390-Reset-kernel-command-line-on-syscal.patch
Normal file
31
kexec-tools-s390-Reset-kernel-command-line-on-syscal.patch
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
From: Petr Tesarik <ptesarik@suse.com>
|
||||||
|
Date: Fri, 3 Apr 2020 13:12:00 +0200
|
||||||
|
Subject: kexec-tools: s390: Reset kernel command line on syscall fallback
|
||||||
|
References: bsc#1167868
|
||||||
|
Upstream: submitted 2020-04-03
|
||||||
|
|
||||||
|
The command line is duplicated on s390 if kexec_file_load(2) is not
|
||||||
|
implemented. That's because the corresponding variable is not reset
|
||||||
|
to an empty string before re-parsing the kexec command line.
|
||||||
|
|
||||||
|
Fixes: 9cf721279f6c ("Reset getopt before falling back to legacy syscall")
|
||||||
|
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
|
||||||
|
---
|
||||||
|
kexec/arch/s390/kexec-image.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/kexec/arch/s390/kexec-image.c b/kexec/arch/s390/kexec-image.c
|
||||||
|
index 8b39566..3c24fdf 100644
|
||||||
|
--- a/kexec/arch/s390/kexec-image.c
|
||||||
|
+++ b/kexec/arch/s390/kexec-image.c
|
||||||
|
@@ -112,6 +112,7 @@ image_s390_load(int argc, char **argv, const char *kernel_buf,
|
||||||
|
};
|
||||||
|
static const char short_options[] = KEXEC_OPT_STR "";
|
||||||
|
|
||||||
|
+ command_line[0] = 0;
|
||||||
|
ramdisk = NULL;
|
||||||
|
ramdisk_len = 0;
|
||||||
|
ramdisk_origin = 0;
|
||||||
|
--
|
||||||
|
2.16.4
|
||||||
|
|
25
kexec-tools-video-capability.patch
Normal file
25
kexec-tools-video-capability.patch
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
From: Petr Tesarik <ptesarik@suse.com>
|
||||||
|
Subject: Make sure VIDEO_CAPABILITY_64BIT_BASE is defined
|
||||||
|
Upstream: never, build fix for SLE12
|
||||||
|
|
||||||
|
SLE12 did not provide a definition for VIDEO_CAPABILITY_64BIT_BASE
|
||||||
|
in <linux/screen_info.h>.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
|
||||||
|
---
|
||||||
|
kexec/arch/i386/x86-linux-setup.c | 4 ++++
|
||||||
|
1 file changed, 4 insertions(+)
|
||||||
|
|
||||||
|
--- a/kexec/arch/i386/x86-linux-setup.c
|
||||||
|
+++ b/kexec/arch/i386/x86-linux-setup.c
|
||||||
|
@@ -37,6 +37,10 @@
|
||||||
|
#include "x86-linux-setup.h"
|
||||||
|
#include "../../kexec/kexec-syscall.h"
|
||||||
|
|
||||||
|
+#ifndef VIDEO_CAPABILITY_64BIT_BASE
|
||||||
|
+#define VIDEO_CAPABILITY_64BIT_BASE (1 << 1) /* Frame buffer base is 64-bit */
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
void init_linux_parameters(struct x86_linux_param_header *real_mode)
|
||||||
|
{
|
||||||
|
/* Fill in the values that are usually provided by the kernel. */
|
79
kexec-tools-vmcoreinfo-in-xen.patch
Normal file
79
kexec-tools-vmcoreinfo-in-xen.patch
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
From: Petr Tesarik <petr@tesarici.cz>
|
||||||
|
Date: Thu, 5 Apr 2018 10:57:05 +0200
|
||||||
|
Subject: Revert "kexec-tools: Read always one vmcoreinfo file"
|
||||||
|
References: bsc#1085626, bsc#951740
|
||||||
|
Upstream: not yet, upstream wants to stay broken
|
||||||
|
|
||||||
|
This reverts commit 455d79f57e9367e5c59093fd74798905bd5762fc.
|
||||||
|
|
||||||
|
The explanation seems bogus. The file under /sys/kernel
|
||||||
|
refers to the Linux kernel VMCOREINFO note, while the
|
||||||
|
file under /sys/hypervisor refers to the Xen hypervisor
|
||||||
|
VMCOREINFO_XEN note. The former note contains information
|
||||||
|
about the Linux kernel. The latter contains information
|
||||||
|
about the Xen hypervisor. Both are needed to allow page
|
||||||
|
filtering in makedumpfile.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
|
||||||
|
|
||||||
|
---
|
||||||
|
kexec/crashdump-elf.c | 33 ++++++++++++++++++++++++++-------
|
||||||
|
1 file changed, 26 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
--- a/kexec/crashdump-elf.c
|
||||||
|
+++ b/kexec/crashdump-elf.c
|
||||||
|
@@ -40,6 +40,8 @@ int FUNC(struct kexec_info *info,
|
||||||
|
uint64_t notes_addr, notes_len;
|
||||||
|
uint64_t vmcoreinfo_addr, vmcoreinfo_len;
|
||||||
|
int has_vmcoreinfo = 0;
|
||||||
|
+ uint64_t vmcoreinfo_addr_xen, vmcoreinfo_len_xen;
|
||||||
|
+ int has_vmcoreinfo_xen = 0;
|
||||||
|
int (*get_note_info)(int cpu, uint64_t *addr, uint64_t *len);
|
||||||
|
long int count_cpu;
|
||||||
|
|
||||||
|
@@ -52,14 +54,16 @@ int FUNC(struct kexec_info *info,
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (xen_present()) {
|
||||||
|
- if (!get_xen_vmcoreinfo(&vmcoreinfo_addr, &vmcoreinfo_len))
|
||||||
|
- has_vmcoreinfo = 1;
|
||||||
|
- } else
|
||||||
|
- if (!get_kernel_vmcoreinfo(&vmcoreinfo_addr, &vmcoreinfo_len))
|
||||||
|
- has_vmcoreinfo = 1;
|
||||||
|
+ if (get_kernel_vmcoreinfo(&vmcoreinfo_addr, &vmcoreinfo_len) == 0) {
|
||||||
|
+ has_vmcoreinfo = 1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (xen_present() &&
|
||||||
|
+ get_xen_vmcoreinfo(&vmcoreinfo_addr_xen, &vmcoreinfo_len_xen) == 0) {
|
||||||
|
+ has_vmcoreinfo_xen = 1;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- sz = sizeof(EHDR) + (nr_cpus + has_vmcoreinfo) * sizeof(PHDR) +
|
||||||
|
+ sz = sizeof(EHDR) + (nr_cpus + has_vmcoreinfo + has_vmcoreinfo_xen) * sizeof(PHDR) +
|
||||||
|
ranges * sizeof(PHDR);
|
||||||
|
|
||||||
|
/*
|
||||||
|
@@ -178,6 +182,21 @@ int FUNC(struct kexec_info *info,
|
||||||
|
dbgprintf_phdr("vmcoreinfo header", phdr);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (has_vmcoreinfo_xen) {
|
||||||
|
+ phdr = (PHDR *) bufp;
|
||||||
|
+ bufp += sizeof(PHDR);
|
||||||
|
+ phdr->p_type = PT_NOTE;
|
||||||
|
+ phdr->p_flags = 0;
|
||||||
|
+ phdr->p_offset = phdr->p_paddr = vmcoreinfo_addr_xen;
|
||||||
|
+ phdr->p_vaddr = 0;
|
||||||
|
+ phdr->p_filesz = phdr->p_memsz = vmcoreinfo_len_xen;
|
||||||
|
+ /* Do we need any alignment of segments? */
|
||||||
|
+ phdr->p_align = 0;
|
||||||
|
+
|
||||||
|
+ (elf->e_phnum)++;
|
||||||
|
+ dbgprintf_phdr("vmcoreinfo_xen header", phdr);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/* Setup an PT_LOAD type program header for the region where
|
||||||
|
* Kernel is mapped if elf_info->kern_size is non-zero.
|
||||||
|
*/
|
847
kexec-tools.changes
Normal file
847
kexec-tools.changes
Normal file
|
@ -0,0 +1,847 @@
|
||||||
|
* Wed Apr 13 2022 ptesarik@suse.com
|
||||||
|
- kexec-tools-print-error-if-kexec_file_load-fails.patch: print
|
||||||
|
error if kexec_file_load fails (bsc#1197176).
|
||||||
|
* Tue Apr 20 2021 wolfgang.frisch@suse.com
|
||||||
|
- Hardening: Link as PIE (bsc#1185020).
|
||||||
|
* Tue Nov 10 2020 ohering@suse.com
|
||||||
|
- Remove kexec-tools-xen-balloon-up.patch (bsc#1176606,
|
||||||
|
bsc#1174508)
|
||||||
|
This patch was introduced to address bsc#694863; it enabled kexec
|
||||||
|
for HVM at that time. Meanwhile Xen 4.7 introduced "soft-reset"
|
||||||
|
for HVM domUs. This host feature removes the requirement to
|
||||||
|
un-ballon the domU prior kexec.
|
||||||
|
With Xen 4.13 cpuid faulting became the default, which affects
|
||||||
|
the approach used in this patch to detect the domU type. As a
|
||||||
|
result, invoking kexec in dom0 failed.
|
||||||
|
* Fri Apr 3 2020 ptesarik@suse.com
|
||||||
|
- kexec-tools-s390-Reset-kernel-command-line-on-syscal.patch: s390:
|
||||||
|
Reset kernel command line on syscall fallback (bsc#1167868).
|
||||||
|
* Fri Mar 13 2020 ptesarik@suse.com
|
||||||
|
- kexec-tools-reset-getopt-before-falling-back-to-legacy.patch:
|
||||||
|
Reset getopt before falling back to legacy syscall (bsc#1166105).
|
||||||
|
* Fri Mar 13 2020 ptesarik@suse.com
|
||||||
|
- kexec-tools-fix-kexec_file_load-error-handling.patch: Fix the
|
||||||
|
error handling if kexec_file_load() fails (bsc#1166105).
|
||||||
|
* Wed Jan 29 2020 ptesarik@suse.com
|
||||||
|
- Fix build errors on old distributions
|
||||||
|
* kexec-tools-video-capability.patch
|
||||||
|
* kexec-tools-SYS_getrandom.patch
|
||||||
|
* Fri Jan 10 2020 clin@suse.com
|
||||||
|
- Fix compiling errors of multiboot2_x86_* functions for i586
|
||||||
|
* kexec-tools-build-multiboot2-for-i386.patch
|
||||||
|
* Mon Dec 16 2019 clin@suse.com
|
||||||
|
- Bump to version 2.0.20
|
||||||
|
Changelog: https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.19..v2.0.20
|
||||||
|
- Backport a upstream patch series: [jsc#SLE-9032]
|
||||||
|
Subject: [PATCH v2 0/3] arm64: handle "reserved" entries in /proc/iomem
|
||||||
|
* kexec-tools-add-variant-helper-functions.patch
|
||||||
|
* kexec-tools-arm64-kexec-allocate-memory-space-avoiding-reserved-regions.patch
|
||||||
|
* kexec-tools-arm64-kdump-deal-with-resource-entries-in-proc-iomem.patch
|
||||||
|
* Fri Jun 14 2019 ptesarik@suse.com
|
||||||
|
- Bump to version 2.0.19
|
||||||
|
Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.18..v2.0.19
|
||||||
|
* Mon Jan 14 2019 kukuk@suse.de
|
||||||
|
- Use %%license instead of %%doc [bsc#1082318]
|
||||||
|
* Thu Nov 1 2018 ptesarik@suse.com
|
||||||
|
- Remove bogus Url RPM tag: The project does not have a home page.
|
||||||
|
* Thu Nov 1 2018 ptesarik@suse.com
|
||||||
|
- Bump to version 2.0.18
|
||||||
|
Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.17..v2.0.18
|
||||||
|
- Drop patches from upstream git:
|
||||||
|
* kexec-tools-fix-for-Unhandled-rela-relocation-R_X86_64_PLT32.patch
|
||||||
|
- Remove the confusing kdump binary (no longer in upstream).
|
||||||
|
* Mon Sep 10 2018 aplanas@suse.com
|
||||||
|
- kexec-tools-fix-for-Unhandled-rela-relocation-R_X86_64_PLT32.patch
|
||||||
|
Upstream backport.
|
||||||
|
In response to a change in binutils, commit b21ebf2fb4c
|
||||||
|
(x86: Treat R_X86_64_PLT32 as R_X86_64_PC32) was applied to
|
||||||
|
the linux kernel during the 4.16 development cycle and has
|
||||||
|
since been backported to earlier stable kernel series. The
|
||||||
|
change results in the failure message in $SUBJECT when
|
||||||
|
rebooting via kexec.
|
||||||
|
Fix this by replicating the change in kexec.
|
||||||
|
* Thu Apr 19 2018 ptesarik@suse.com
|
||||||
|
- Bump to version 2.0.17
|
||||||
|
Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.16..v2.0.17
|
||||||
|
- Drop kexec-tools-xen-static.patch: upstream uses run-time dynamic
|
||||||
|
linking to address the same issue.
|
||||||
|
- Drop all patches from upstream git:
|
||||||
|
* kexec-tools-add-a-helper-function-to-add-ranges.patch
|
||||||
|
* kexec-tools-ppc64-parse-ibm-dynamic-memory.patch
|
||||||
|
* kexec-tools-ppc64-leverage-kexec_file_load-support.patch
|
||||||
|
* kexec-tools-Return-ENOSYS-when-kexec-does-not-know.patch
|
||||||
|
* kexec-tools-Fix-option-checks-to-take-KEXEC_FILE_LOAD.patch
|
||||||
|
* kexec-tools-Do-not-special-case-the-s-option.patch
|
||||||
|
* kexec-tools-Add-option-to-revert-s.patch
|
||||||
|
* kexec-tools-Add-option-to-fall-back-to-KEXEC_LOAD.patch
|
||||||
|
* kexec-tools-Document-s-c-and-a-options-in-the-man-page.patch
|
||||||
|
* kexec-tools-fix-kexec-p-segfault.patch
|
||||||
|
* Thu Apr 5 2018 ptesarik@suse.com
|
||||||
|
- kexec-tools-vmcoreinfo-in-xen.patch: Revert "kexec-tools: Read
|
||||||
|
always one vmcoreinfo file" (bsc#1085626, bsc#951740).
|
||||||
|
* Thu Apr 5 2018 ptesarik@suse.com
|
||||||
|
- kexec-tools-fix-kexec-p-segfault.patch: Fix a segmentation fault
|
||||||
|
when trying to run "kexec -p" (bsc#1080916).
|
||||||
|
* Tue Apr 3 2018 msuchanek@suse.com
|
||||||
|
- kexec: add -a option to fall back to KEXEC_LOAD when KEXEC_FILE_LOAD is not
|
||||||
|
supported (bsc#1080916, boo#1076839).
|
||||||
|
* kexec-tools-Return-ENOSYS-when-kexec-does-not-know.patch
|
||||||
|
* kexec-tools-Fix-option-checks-to-take-KEXEC_FILE_LOAD.patch
|
||||||
|
* kexec-tools-Do-not-special-case-the-s-option.patch
|
||||||
|
* kexec-tools-Add-option-to-revert-s.patch
|
||||||
|
* kexec-tools-Add-option-to-fall-back-to-KEXEC_LOAD.patch
|
||||||
|
* kexec-tools-Document-s-c-and-a-options-in-the-man-page.patch
|
||||||
|
- kexec-tools-ppc64-leverage-kexec_file_load-support.patch: kexec/ppc64:
|
||||||
|
leverage kexec_file_load support (bsc#1080916).
|
||||||
|
* Fri Feb 23 2018 ptesarik@suse.com
|
||||||
|
- kexec-tools-ppc64-parse-ibm-dynamic-memory.patch: kexec/ppc64:
|
||||||
|
add support to parse ibm, dynamic-memory-v2 property
|
||||||
|
(bsc#1081789, LTC#164625).
|
||||||
|
- kexec-tools-add-a-helper-function-to-add-ranges.patch: kexec: add
|
||||||
|
a helper function to add ranges (bsc#1081789, LTC#164625).
|
||||||
|
* Fri Jan 19 2018 tchvatal@suse.com
|
||||||
|
- Create compat link for rckexec-loader systemd service
|
||||||
|
- Convert the asciidoc file to normal man in order to drop asciidoc dep
|
||||||
|
* python2 only obsoletion and upstream has only raw manpages too
|
||||||
|
- Properly state all post/postun dependencies (systemd, suse-module-tools)
|
||||||
|
- There is no reason for exclusive arch if we state all archs
|
||||||
|
- Bump to version 2.0.16
|
||||||
|
Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.14..v2.0.16
|
||||||
|
- Remove support for older products to trivialize spec file
|
||||||
|
- Make sure to not pull python2 via asciidoc
|
||||||
|
- Drop merged patch 0001-kexec-tools-2.0.14.git.patch
|
||||||
|
- Drop all patches from upstream git:
|
||||||
|
* 0002-ppc64-Reduce-number-of-ELF-LOAD-segments.patch
|
||||||
|
* 0003-kexec-Increase-the-upper-limit-for-RAM-segments.patch
|
||||||
|
* 0004-alpha-add-missing-__NR_kexec_load-definition.patch
|
||||||
|
* 0005-kexec-implemented-XEN-KEXEC-STATUS-to-determine-if-a.patch
|
||||||
|
* 0006-kexec-Remove-redundant-space-from-help-message.patch
|
||||||
|
* 0007-purgatory-Add-purgatory.map-and-purgatory.ro.sym-to-.patch
|
||||||
|
* 0008-kexec-Add-option-to-get-crash-kernel-region-size.patch
|
||||||
|
* 0009-crashdump-arm-Add-get_crash_kernel_load_range-functi.patch
|
||||||
|
* 0010-crashdump-arm64-Add-get_crash_kernel_load_range-func.patch
|
||||||
|
* 0011-crashdump-cris-Add-get_crash_kernel_load_range-funct.patch
|
||||||
|
* 0012-crashdump-ia64-Add-get_crash_kernel_load_range-funct.patch
|
||||||
|
* 0013-crashdump-m68k-Add-get_crash_kernel_load_range-funct.patch
|
||||||
|
* 0014-crashdump-mips-Add-get_crash_kernel_load_range-funct.patch
|
||||||
|
* 0015-crashdump-ppc-Add-get_crash_kernel_load_range-functi.patch
|
||||||
|
* 0016-crashdump-ppc64-Add-get_crash_kernel_load_range-func.patch
|
||||||
|
* 0017-crashdump-s390-Add-get_crash_kernel_load_range-funct.patch
|
||||||
|
* 0018-crashdump-sh-Add-get_crash_kernel_load_range-functio.patch
|
||||||
|
* 0019-gitignore-add-two-generated-files-in-purgatory.patch
|
||||||
|
* 0020-Only-print-debug-message-when-failed-to-serach-for-k.patch
|
||||||
|
* 0021-build_mem_phdrs-check-if-p_paddr-is-invalid.patch
|
||||||
|
* 0022-uImage-fix-realloc-pointer-confusion.patch
|
||||||
|
* 0023-uImage-Fix-uImage_load-for-little-endian-machines.patch
|
||||||
|
* 0024-uImage-Add-new-IH_ARCH_xxx-definitions.patch
|
||||||
|
* 0025-uImage-use-char-instead-of-unsigned-char-for-uImage_.patch
|
||||||
|
* 0026-uImage-use-char-instead-of-unsigned-char-for-uImage_.patch
|
||||||
|
* 0027-arm64-add-uImage-support.patch
|
||||||
|
* 0028-vmcore-dmesg-Define-_GNU_SOURCE.patch
|
||||||
|
* 0029-Don-t-use-L-width-specifier-with-integer-values.patch
|
||||||
|
* 0030-x86-x86_64-Fix-format-warning-with-die.patch
|
||||||
|
* 0031-ppc-Fix-format-warning-with-die.patch
|
||||||
|
* 0032-crashdump-Remove-stray-get_crashkernel_region-declar.patch
|
||||||
|
* 0033-x86-Support-large-number-of-memory-ranges.patch
|
||||||
|
* 0034-Fix-broken-Xen-support-in-configure.ac.patch
|
||||||
|
* 0035-kexec-extend-the-semantics-of-kexec_iomem_for_each_l.patch
|
||||||
|
* 0036-kexec-generalize-and-rename-get_kernel_stext_sym.patch
|
||||||
|
* 0037-arm64-identify-PHYS_OFFSET-correctly.patch
|
||||||
|
* 0038-arm64-change-return-values-on-error-to-negative.patch
|
||||||
|
* 0039-arm64-kdump-identify-memory-regions.patch
|
||||||
|
* 0040-arm64-kdump-add-elf-core-header-segment.patch
|
||||||
|
* 0041-arm64-kdump-set-up-kernel-image-segment.patch
|
||||||
|
* 0042-arm64-kdump-set-up-other-segments.patch
|
||||||
|
* 0043-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch
|
||||||
|
* 0044-arm64-kdump-Add-support-for-binary-image-files.patch
|
||||||
|
* 0045-Handle-additional-e820-memmap-type-strings.patch
|
||||||
|
* 0046-powerpc-fix-command-line-overflow-error.patch
|
||||||
|
* 0047-fix-how-RMA-top-is-deduced.patch
|
||||||
|
* Mon Jan 8 2018 msuchanek@suse.com
|
||||||
|
- Fix kexec error on ppc64 (bsc#1074947).
|
||||||
|
0046-powerpc-fix-command-line-overflow-error.patch
|
||||||
|
0047-fix-how-RMA-top-is-deduced.patch
|
||||||
|
* Tue Oct 31 2017 carnold@suse.com
|
||||||
|
- With Xen 4.10 there is a new required library called xentoolcore
|
||||||
|
(bsc#1037779)
|
||||||
|
kexec-tools-xen-static.patch
|
||||||
|
- Refreshed kexec-tools-disable-test.patch
|
||||||
|
* Thu Jun 1 2017 jengelh@inai.de
|
||||||
|
- Remove redundant %%clean section. Replace $RPM_* shell vars
|
||||||
|
by macros.
|
||||||
|
- Rewrite summary line.
|
||||||
|
* Wed May 31 2017 tiwai@suse.de
|
||||||
|
- Update to version 2.0.14 (bsc#1039937, FATE#320672, FATE#320671)
|
||||||
|
Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.13..v2.0.14
|
||||||
|
- Backport upstream fixes (bsc#1039937, FATE#320672, FATE#320671)
|
||||||
|
0001-kexec-tools-2.0.14.git.patch
|
||||||
|
0002-ppc64-Reduce-number-of-ELF-LOAD-segments.patch
|
||||||
|
0003-kexec-Increase-the-upper-limit-for-RAM-segments.patch
|
||||||
|
0004-alpha-add-missing-__NR_kexec_load-definition.patch
|
||||||
|
0005-kexec-implemented-XEN-KEXEC-STATUS-to-determine-if-a.patch
|
||||||
|
0006-kexec-Remove-redundant-space-from-help-message.patch
|
||||||
|
0007-purgatory-Add-purgatory.map-and-purgatory.ro.sym-to-.patch
|
||||||
|
0008-kexec-Add-option-to-get-crash-kernel-region-size.patch
|
||||||
|
0009-crashdump-arm-Add-get_crash_kernel_load_range-functi.patch
|
||||||
|
0010-crashdump-arm64-Add-get_crash_kernel_load_range-func.patch
|
||||||
|
0011-crashdump-cris-Add-get_crash_kernel_load_range-funct.patch
|
||||||
|
0012-crashdump-ia64-Add-get_crash_kernel_load_range-funct.patch
|
||||||
|
0013-crashdump-m68k-Add-get_crash_kernel_load_range-funct.patch
|
||||||
|
0014-crashdump-mips-Add-get_crash_kernel_load_range-funct.patch
|
||||||
|
0015-crashdump-ppc-Add-get_crash_kernel_load_range-functi.patch
|
||||||
|
0016-crashdump-ppc64-Add-get_crash_kernel_load_range-func.patch
|
||||||
|
0017-crashdump-s390-Add-get_crash_kernel_load_range-funct.patch
|
||||||
|
0018-crashdump-sh-Add-get_crash_kernel_load_range-functio.patch
|
||||||
|
0019-gitignore-add-two-generated-files-in-purgatory.patch
|
||||||
|
0020-Only-print-debug-message-when-failed-to-serach-for-k.patch
|
||||||
|
0021-build_mem_phdrs-check-if-p_paddr-is-invalid.patch
|
||||||
|
0022-uImage-fix-realloc-pointer-confusion.patch
|
||||||
|
0023-uImage-Fix-uImage_load-for-little-endian-machines.patch
|
||||||
|
0024-uImage-Add-new-IH_ARCH_xxx-definitions.patch
|
||||||
|
0025-uImage-use-char-instead-of-unsigned-char-for-uImage_.patch
|
||||||
|
0026-uImage-use-char-instead-of-unsigned-char-for-uImage_.patch
|
||||||
|
0027-arm64-add-uImage-support.patch
|
||||||
|
0028-vmcore-dmesg-Define-_GNU_SOURCE.patch
|
||||||
|
0029-Don-t-use-L-width-specifier-with-integer-values.patch
|
||||||
|
0030-x86-x86_64-Fix-format-warning-with-die.patch
|
||||||
|
0031-ppc-Fix-format-warning-with-die.patch
|
||||||
|
0032-crashdump-Remove-stray-get_crashkernel_region-declar.patch
|
||||||
|
0033-x86-Support-large-number-of-memory-ranges.patch
|
||||||
|
0034-Fix-broken-Xen-support-in-configure.ac.patch
|
||||||
|
0035-kexec-extend-the-semantics-of-kexec_iomem_for_each_l.patch
|
||||||
|
0036-kexec-generalize-and-rename-get_kernel_stext_sym.patch
|
||||||
|
0037-arm64-identify-PHYS_OFFSET-correctly.patch
|
||||||
|
0038-arm64-change-return-values-on-error-to-negative.patch
|
||||||
|
0039-arm64-kdump-identify-memory-regions.patch
|
||||||
|
0040-arm64-kdump-add-elf-core-header-segment.patch
|
||||||
|
0041-arm64-kdump-set-up-kernel-image-segment.patch
|
||||||
|
0042-arm64-kdump-set-up-other-segments.patch
|
||||||
|
0043-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch
|
||||||
|
0044-arm64-kdump-Add-support-for-binary-image-files.patch
|
||||||
|
0045-Handle-additional-e820-memmap-type-strings.patch
|
||||||
|
- Refreshed patches:
|
||||||
|
kexec-tools-xen-static.patch
|
||||||
|
kexec-tools-xen-balloon-up.patch
|
||||||
|
- Drop obsoleted arm64 patches:
|
||||||
|
kexec-tools-enable-aarch64-fixup.patch
|
||||||
|
kexec-tools-enable-aarch64.patch
|
||||||
|
- Fix source URL, as ftp was discontinued on korg
|
||||||
|
- Sync changelog with SLE12 packages
|
||||||
|
* Wed May 10 2017 carnold@suse.com
|
||||||
|
- kexec-tools-xen-static.patch: xen breaks kexec-tools build
|
||||||
|
(bsc#1037779)
|
||||||
|
See also matching fix in xen-devel package
|
||||||
|
* Tue Apr 11 2017 bwiedemann@suse.com
|
||||||
|
- fix kexec-bootloader with /boot partition (boo#1033599)
|
||||||
|
* Wed Feb 22 2017 meissner@suse.com
|
||||||
|
- Do not pull in gcc-PIE, as it breaks the static build in here.
|
||||||
|
* Mon Aug 8 2016 ptesarik@suse.com
|
||||||
|
- Update to version 2.0.13
|
||||||
|
Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.12..v2.0.13
|
||||||
|
- Refresh kexec-tools-enable-aarch64.patch
|
||||||
|
* Fri Jun 17 2016 normand@linux.vnet.ibm.com
|
||||||
|
- remove sed line in spec for ppc64 about stack-protector
|
||||||
|
as now handled in Makefile.
|
||||||
|
* Fri Jun 3 2016 tonyj@suse.com
|
||||||
|
- Update to version 2.0.12 (FATE#320915, bsc#980545)
|
||||||
|
Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.10..v2.0.12
|
||||||
|
Drop following patches (upstream):
|
||||||
|
kexec-tools-load-crash-kernel-high.patch
|
||||||
|
- Fix pkg-config to check >= 4.7 rather than > 4.6 for xenlight
|
||||||
|
- Specifically name Files in specfile rather than using glob.
|
||||||
|
* Mon May 30 2016 ptesarik@suse.com
|
||||||
|
- kexec-tools-ppc64-reduce-elf-loads.patch: ppc64: Reduce number of
|
||||||
|
ELF LOAD segments (bsc#981339).
|
||||||
|
* Tue May 3 2016 olaf@aepfle.de
|
||||||
|
- Adjust linking to libxenctrl to xen-4.7 API (fate#319989)
|
||||||
|
* Thu Dec 10 2015 tiwai@suse.de
|
||||||
|
- Fix missing dependency on coreutils for initrd macros (boo#958562)
|
||||||
|
- Call missing initrd macro at postun (boo#958562)
|
||||||
|
* Mon Oct 26 2015 ptesarik@suse.cz
|
||||||
|
- kexec-tools-vmcoreinfo-in-xen.patch: Store XEN_VMCOREINFO in
|
||||||
|
panic kernel ELF notes.
|
||||||
|
(bsc#951740)
|
||||||
|
* Wed Oct 14 2015 jlee@suse.com
|
||||||
|
- kexec-tools-xen-inhibit-file-based-syscall.patch: To inhibit file
|
||||||
|
based syscall on XEN, using old syscall to load crash kernel.
|
||||||
|
(bsc#947172)
|
||||||
|
* Tue Oct 6 2015 ptesarik@suse.com
|
||||||
|
- kexec-tools-load-crash-kernel-high.patch: Load crash kernel high
|
||||||
|
on x86 (bsc#946365).
|
||||||
|
* Fri Jun 26 2015 ptesarik@suse.cz
|
||||||
|
- Upgrade to kexec-2.0.10: This is a feature release coinciding
|
||||||
|
with the release of the v4.1 Linux Kernel.
|
||||||
|
- Refreshed patches:
|
||||||
|
* kexec-tools-xen-static.patch
|
||||||
|
* kexec-tools-xen-balloon-up.patch
|
||||||
|
- Dropped patches (now upstream):
|
||||||
|
* kexec-tools-callback-function-proto.patch
|
||||||
|
* Mon May 4 2015 jlee@suse.com
|
||||||
|
- Add 'kexec-tools/kexec-tools-Provide-an-option-to-use-new-kexec-system-call.patch'
|
||||||
|
to support kdump on secure boot. (fate#315018, bnc#884453)
|
||||||
|
* Sun Mar 29 2015 crrodriguez@opensuse.org
|
||||||
|
- kexec tools are included in the default initrd, we need
|
||||||
|
to regenerate if this package changes.
|
||||||
|
* Fri Mar 20 2015 schwab@linux-m68k.org
|
||||||
|
- Enable building on m68k
|
||||||
|
* Fri Feb 13 2015 ptesarik@suse.cz
|
||||||
|
- Upgrade to kexec-2.0.9: This is a bug-fix release coinciding with
|
||||||
|
the release of the v3.19 Linux Kernel.
|
||||||
|
* Fri Jan 9 2015 tonyj@suse.com
|
||||||
|
- Fix x86 callback prototypes (bnc#905090)
|
||||||
|
Add patch: kexec-tools-callback-function-proto.patch
|
||||||
|
* Thu Oct 9 2014 ptesarik@suse.cz
|
||||||
|
- Upgrade to kexec-2.0.8
|
||||||
|
- Dropped patches (now upstream):
|
||||||
|
o kexec-tools-xen-e820-redefinition.patch
|
||||||
|
o kexec-tools-i386-bzimage_efi.patch
|
||||||
|
o kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch
|
||||||
|
o kexec-tools-zero-efi-info.patch
|
||||||
|
o kexec-tools-fs2dt-fix-endianess-issue-with-initrd-base-and-size.patch
|
||||||
|
o kexec-tools-ppc64-purgatory-device-tree-values-should-be-read-stored-in-big-endian.patch
|
||||||
|
o kexec-tools-kdump-fix-elf-header-endianess.patch
|
||||||
|
* Tue Aug 19 2014 tonyj@suse.com
|
||||||
|
- custom autoconf action was no longer setting HAVE_LIBXENCTRL (bnc#886873)
|
||||||
|
* Fri Aug 15 2014 tonyj@suse.com
|
||||||
|
- Do not package kdump.8 as it is only a placeholder, full man page is provided
|
||||||
|
by kdump package (bnc#892090)
|
||||||
|
* Sat Jul 26 2014 tonyj@suse.com
|
||||||
|
- Fix ELF header endianess for ppc64le kdump (bnc#888150)
|
||||||
|
New patch: kexec-tools-kdump-fix-elf-header-endianess.patch
|
||||||
|
* Sun Jul 20 2014 p.drouand@gmail.com
|
||||||
|
- Remove insserv dependency; the package doesn't provide any sysvinit
|
||||||
|
script
|
||||||
|
* Thu May 1 2014 tonyj@suse.com
|
||||||
|
- Device tree values should be big endian for ppc64le (bnc#875485)
|
||||||
|
New patch: kexec-tools-ppc64-purgatory-device-tree-values-should-be-read-stored-in-big-endian.patch
|
||||||
|
* Fri Apr 11 2014 tonyj@suse.com
|
||||||
|
- Expose flattened device trees (ppc64le) to new kexec'd kernel in Big Endian
|
||||||
|
format (bnc#873169)
|
||||||
|
New patch: kexec-tools-fs2dt-fix-endianess-issue-with-initrd-base-and-size.patch
|
||||||
|
- Update patch headers to reflect upstream commit id's:
|
||||||
|
Change patch: kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch
|
||||||
|
Change patch: kexec-tools-zero-efi-info.patch
|
||||||
|
* Tue Mar 18 2014 tonyj@suse.com
|
||||||
|
- Reserve mmconf areas for kdump kernel via memmap=X$Y in cmdline
|
||||||
|
(bnc#819777 [original: bnc#804800]: fix still needed for SGI UV systems).
|
||||||
|
New patch: kexec-tools-set-mmconf-reserved.patch
|
||||||
|
- Disable stack protector for ppc64le (bnc#869161)
|
||||||
|
New patch: kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch
|
||||||
|
- Disable erroneous (efi memory descriptor version) message (bnc#867785c5)
|
||||||
|
New patch: kexec-tools-zero-efi-info.patch
|
||||||
|
* Thu Feb 6 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 2014 tonyj@suse.com
|
||||||
|
- Update to version 2.0.5
|
||||||
|
Drop patch 'device-tree-buffer-overflows.patch' (upstream)
|
||||||
|
Drop patch '0001-kexec-fs2dt-fix-endianess-conversion.patch' (upstream)
|
||||||
|
- Rename aarch64 patch to 'kexec-tools-enable-aarch64.patch' and rebase to
|
||||||
|
version from Linaro git.
|
||||||
|
- Add 'kexec-tools-enable-aarch64-fixup.patch' to solve arm libfdt breakage
|
||||||
|
with Linaro patch.
|
||||||
|
- Enable ppc64le
|
||||||
|
- Refresh patches for context.
|
||||||
|
- Add following patches (pending upstream):
|
||||||
|
'kexec-tools-i386-bzimage_efi.patch' to fix i386 breakage.
|
||||||
|
'kexec-tools-xen-e820-redefinition.patch' to fix xen/820 breakage.
|
||||||
|
* Tue Feb 4 2014 dmueller@suse.com
|
||||||
|
- add 0001-kexec-fs2dt-fix-endianess-conversion.patch:
|
||||||
|
* fix ppc64 and arm
|
||||||
|
- refresh device-tree-buffer-overflows.patch with the version
|
||||||
|
that went upstream
|
||||||
|
* Mon Feb 3 2014 dmueller@suse.com
|
||||||
|
- enable build for arm / aarch64
|
||||||
|
- add kexec-aarch64.patch
|
||||||
|
- add device-tree-buffer-overflows.patch
|
||||||
|
* Thu Jan 9 2014 tonyj@suse.com
|
||||||
|
- Update to version 2.0.4
|
||||||
|
- Drop patches (mainline):
|
||||||
|
kexec-tools-fix-makefile-binaries.patch (aaedd532)
|
||||||
|
kexec-tools-fix-strncat.patch (d5efc524)
|
||||||
|
kexec-tools-no-vga-output.patch (f1facd4b)
|
||||||
|
* Sun Jan 5 2014 coolo@suse.com
|
||||||
|
- xen 4.4 is exclusive to 64bit archs, so don't require it
|
||||||
|
* Fri Dec 6 2013 ptesarik@suse.cz
|
||||||
|
- Remove double-packaging of /etc/init.d/kexec-tools, fixing build
|
||||||
|
errors on some targets, e.g. SLE-11.
|
||||||
|
* Thu Apr 11 2013 mmeister@suse.com
|
||||||
|
- Added url as source.
|
||||||
|
Please see http://en.opensuse.org/SourceUrls
|
||||||
|
* Thu Oct 11 2012 tonyj@suse.com
|
||||||
|
- Update to kexec 2.0.3. Drop unneeded patches.
|
||||||
|
* Thu Jun 14 2012 ohering@suse.de
|
||||||
|
- Fix xen cpuid() inline asm to not clobber stack's red zone
|
||||||
|
See xen-unstable changeset 24344:72f4e4cb7440
|
||||||
|
* Thu Jun 14 2012 ohering@suse.de
|
||||||
|
- Balloon up in a Xen PVonHVM guest before kexec (bnc#694863)
|
||||||
|
- Update xen_present check for xenfs in pv_ops kernel (bnc#694863)
|
||||||
|
- Change xen_present hv check (bnc#658413)
|
||||||
|
* Fri Apr 20 2012 rschweikert@suse.com
|
||||||
|
- place binaries into /usr tree (UsrMerge project)
|
||||||
|
* Fri Dec 2 2011 coolo@suse.com
|
||||||
|
- add automake as buildrequire to avoid implicit dependency
|
||||||
|
* Sun Jul 10 2011 meissner@suse.de
|
||||||
|
- fixed strncat sizse argument on ppc
|
||||||
|
* Tue May 17 2011 jslaby@suse.de
|
||||||
|
- fix build with gcc that doesn't understand --no-undefined
|
||||||
|
* Sun Sep 12 2010 bernhard@bwalle.de
|
||||||
|
- Update to kexec-tools 2.0.2 (bug fix release). The complete
|
||||||
|
changelog can be viewed at
|
||||||
|
http://git.kernel.org/?p=utils/kernel/kexec/kexec-tools.git;a=shortlog;h=refs/tags/v2.0.2.
|
||||||
|
- Drop kexec-tools-increase-kernel-text-size.diff: Mainline.
|
||||||
|
* Tue Mar 16 2010 ro@suse.de
|
||||||
|
- disable autoreconf to fix build
|
||||||
|
- drop obsolete patch ARM_kexec-zImage-arm_page_to_unistd.diff
|
||||||
|
* Wed Feb 10 2010 jengelh@medozas.de
|
||||||
|
- Add ExclusiveArch to specfile according to source capabilities
|
||||||
|
* Sun Dec 20 2009 bernhard@bwalle.de
|
||||||
|
- Update to kexec-tools 2.0.1 (bug fix release).
|
||||||
|
- Drop following patches because they are upstream now (or the
|
||||||
|
problem is fixed otherwise upstream):
|
||||||
|
o kexec-tools-ia64-uncached-memory.diff
|
||||||
|
o kexec-tools-ia64-PA.diff
|
||||||
|
o kexec-tools-build-warnings.diff
|
||||||
|
o kexec-tools-ppc64-build-warnings.diff
|
||||||
|
o kexec-tools-ppc64-IBM-QS2x-blades.diff
|
||||||
|
o kexec-tools-ia64-kdump-PT_LOAD-order.diff
|
||||||
|
o kexec-tools-crash-memory-ranges-drconf.diff
|
||||||
|
o kexec-tools-add-usable-drconf-memory-node-to-device-tree.diff
|
||||||
|
o kexec-tools-get-details-dynamic-reconfiguration-memory-node.diff
|
||||||
|
o kexec-tools-get-details-dynamic-reconfiguration-memory-node.diff
|
||||||
|
o kexec-tools-device-tree-return.diff
|
||||||
|
o kexec-tools-ppc-check-flags.diff
|
||||||
|
o kexec-tools-spell.diff
|
||||||
|
o kexec-tools-proc-iomem-xen.diff
|
||||||
|
o kexec-tools-parse-iomem-single-warning.diff
|
||||||
|
o kexec-tools-exclude-gart.diff
|
||||||
|
o kexec-tools-ppc64-memory-ranges-dynamic.diff
|
||||||
|
o kexec-tools-ppc64-dynamic-fix-1.diff
|
||||||
|
o kexec-tools-ppc64-dynamic-fix-2.diff
|
||||||
|
o kexec-tools-ppc64-dynamic-fix-3.diff
|
||||||
|
o kexec-tools-ppc64-reinit.diff
|
||||||
|
* Mon Sep 21 2009 jansimon.moeller@opensuse.org
|
||||||
|
- fix build on arm. kexec-zImage-arm needed s#asm/page.h#unistd.h#
|
||||||
|
* Wed Aug 12 2009 tiwai@suse.de
|
||||||
|
- increase kernel text size to fix for 2.6.31 kernel (bnc#530240)
|
||||||
|
* Sun Jul 12 2009 coolo@novell.com
|
||||||
|
- disable as-needed to fix build
|
||||||
|
* Thu Feb 5 2009 bwalle@suse.de
|
||||||
|
- Re-initialize drconf variables for PPC64 (bnc #468571).
|
||||||
|
* Wed Feb 4 2009 tiwai@suse.de
|
||||||
|
- fix build failure due to missing xsltproc
|
||||||
|
* Fri Jan 16 2009 bwalle@suse.de
|
||||||
|
- The dynamic reallocation for PPC64 broke kdump completely.
|
||||||
|
Fix the patch so that dynamic reallocation actually works
|
||||||
|
without memory corruption (bnc #466782).
|
||||||
|
* Fri Jan 16 2009 bwalle@suse.de
|
||||||
|
- Add #!BuildIgnore on fop to speed up build (asciidoc don't
|
||||||
|
require fop for manpage generation).
|
||||||
|
* Wed Jan 7 2009 bwalle@suse.de
|
||||||
|
- Allocate memory ranges dynamically on PPC64 (bnc #460752).
|
||||||
|
* Tue Dec 9 2008 bwalle@suse.de
|
||||||
|
- Exclude GART memory from regions that must be written to the
|
||||||
|
dump file (bnc #457612).
|
||||||
|
* Wed Nov 26 2008 bwalle@suse.de
|
||||||
|
- Fix compile warning.
|
||||||
|
* Mon Nov 24 2008 bwalle@suse.de
|
||||||
|
- 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
|
||||||
|
systems.
|
||||||
|
* Fri Nov 14 2008 bwalle@suse.de
|
||||||
|
- Fix spell error in help output (bnc#444714).
|
||||||
|
* Sat Nov 1 2008 bwalle@suse.de
|
||||||
|
- Don't print "setup_linux_vesafb" message on stderr.
|
||||||
|
* Mon Oct 27 2008 bwalle@suse.de
|
||||||
|
- Update patch that checks for reserved and assigned bit flags on
|
||||||
|
the memory regions (bnc#438086).
|
||||||
|
* Sun Oct 26 2008 bwalle@suse.de
|
||||||
|
- 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 bwalle@suse.de
|
||||||
|
- Check for reserved and assigned bit flags on the memory regions
|
||||||
|
(bnc#438086).
|
||||||
|
* Sat Oct 18 2008 bwalle@suse.de
|
||||||
|
- Honor grubonce also when the 1st (== 0th) entry was chosen.
|
||||||
|
* Mon Oct 13 2008 bwalle@suse.de
|
||||||
|
- 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 9 2008 bwalle@suse.de
|
||||||
|
- PPC64: Use return value of count_dyn_reconf_memory_ranges().
|
||||||
|
* Thu Oct 9 2008 bwalle@suse.de
|
||||||
|
- 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 9 2008 bwalle@suse.de
|
||||||
|
- Add newline in error message of "kexec-bootloader".
|
||||||
|
- Add error handling when Bootloader::Tools::GetDefaultSection()
|
||||||
|
fails.
|
||||||
|
* Wed Oct 8 2008 bwalle@suse.de
|
||||||
|
- IA64: Order of operations bug in PT_LOAD segment reader.
|
||||||
|
* Wed Oct 8 2008 bwalle@suse.de
|
||||||
|
- ia64: Do not include uncached memory to vmcore.
|
||||||
|
- ia64: Make PA() work for both physical identity-mapped virtual
|
||||||
|
addresses.
|
||||||
|
- PPC64: Let kexec work on IBM QS2x blade servers
|
||||||
|
- Fix build warnings.
|
||||||
|
* Mon Oct 6 2008 bwalle@suse.de
|
||||||
|
- Implement -h (help) option (bnc#432386).
|
||||||
|
- Remove documentation of -o (options) option that never existed.
|
||||||
|
* Wed Aug 27 2008 bwalle@suse.de
|
||||||
|
- only install and build /etc/init.d/kexec with openSUSE 11.1 /
|
||||||
|
SLES 11 and later
|
||||||
|
* Sat Aug 16 2008 bwalle@suse.de
|
||||||
|
- mark /etc/init.d/kexec as %%config
|
||||||
|
- remove (empty) %%preun
|
||||||
|
* Fri Aug 15 2008 bwalle@suse.de
|
||||||
|
- add /etc/init.d/kexec to be able to reboot with kexec(8)
|
||||||
|
(FATE#302238)
|
||||||
|
* Sat Jul 19 2008 bwalle@suse.de
|
||||||
|
- 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 bwalle@suse.de
|
||||||
|
- 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
|
||||||
|
architecture
|
||||||
|
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
|
||||||
|
sys/io.h
|
||||||
|
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
|
||||||
|
upstram
|
||||||
|
- 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 3 2008 bwalle@suse.de
|
||||||
|
- fix 32 bit kexec to boot on 64 bit ppc64 (bnc#405015)
|
||||||
|
* Mon May 26 2008 bwalle@suse.de
|
||||||
|
- fix EDD support when the BIOS-reported length is smaller than
|
||||||
|
the sysfs raw_data size (bnc#388754)
|
||||||
|
* Mon May 26 2008 bwalle@suse.de
|
||||||
|
- fix kexec unload (rckdump stop) on ppc64 (bnc#394216)
|
||||||
|
* Tue May 13 2008 bwalle@suse.de
|
||||||
|
- implement EDD (bnc#383210)
|
||||||
|
* Mon Mar 24 2008 bwalle@suse.de
|
||||||
|
- update to kexec-tools-testing v20080324
|
||||||
|
o tarball update (version), no functional changes between
|
||||||
|
v20080318-rc and v20080324
|
||||||
|
* Tue Mar 18 2008 bwalle@suse.de
|
||||||
|
- 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 bwalle@suse.de
|
||||||
|
- 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 bwalle@suse.de
|
||||||
|
- update to kexec-tools-testing v20080227
|
||||||
|
(only increased version number)
|
||||||
|
* Tue Feb 26 2008 bwalle@suse.de
|
||||||
|
- update to kexec-tools-testing v20080226-rc
|
||||||
|
o build: include configure and include/config.h.in in dist
|
||||||
|
tarball
|
||||||
|
- adjusted kexec-tools-portability-issue to build without warnings
|
||||||
|
on 32 bit systems
|
||||||
|
* Thu Feb 21 2008 bwalle@suse.de
|
||||||
|
- 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 bwalle@suse.de
|
||||||
|
- 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
|
||||||
|
_S_{SRCS, OBJS}
|
||||||
|
o build system fixes
|
||||||
|
o Add documentation on creating include/config.h.in 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 sassmann@suse.de
|
||||||
|
- fix fread buffer overflow on ppc
|
||||||
|
* Tue Jan 22 2008 ro@suse.de
|
||||||
|
- update ppc buildreq
|
||||||
|
* Fri Nov 30 2007 bwalle@suse.de
|
||||||
|
- fix a problem with automatic determination of ELF32/ELF64 on i386
|
||||||
|
* Tue Oct 30 2007 bwalle@suse.de
|
||||||
|
- update to kexec-tools-testing 20071030
|
||||||
|
o vmcoreinfo's address and size
|
||||||
|
* Wed Oct 17 2007 bwalle@suse.de
|
||||||
|
- 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
|
||||||
|
mainline)
|
||||||
|
* Thu Oct 11 2007 bwalle@suse.de
|
||||||
|
- remove kdump stuff from this package, that's now in the "kexec"
|
||||||
|
package
|
||||||
|
* Wed Aug 29 2007 bwalle@suse.de
|
||||||
|
- add reset_devices kernel parameter as default
|
||||||
|
* Sat Aug 25 2007 olh@suse.de
|
||||||
|
- do not require kdump-helpers on s390
|
||||||
|
* Fri Jul 27 2007 bwalle@suse.de
|
||||||
|
- update documentation for deleting all dumps (#302257)
|
||||||
|
* Tue Jul 17 2007 olh@suse.de
|
||||||
|
- workaround gcc code analyzing bug
|
||||||
|
* Mon Jul 16 2007 olh@suse.de
|
||||||
|
- update to kexec-tools-testing b84b87747a16f0afbef6f6802bb794a94f4961d9
|
||||||
|
build 32bit powerpc kexec binary for 64bit kernels
|
||||||
|
* Fri Jul 6 2007 tiwai@suse.de
|
||||||
|
- implement a simple status command for kdump init script
|
||||||
|
* Mon Jul 2 2007 bwalle@suse.de
|
||||||
|
- removed 'machvec=dig' workaround from the documentation since
|
||||||
|
this has been fixed in the kernel (#271158)
|
||||||
|
* Fri Jun 22 2007 bwalle@suse.de
|
||||||
|
- disable -fstack-protector on IA64 since the kdump kernel doesn't
|
||||||
|
boot with -fstack-protector enabled
|
||||||
|
* Thu Jun 21 2007 bwalle@suse.de
|
||||||
|
- kdump init script: fix handling of spaces in kernel type
|
||||||
|
* Wed Jun 13 2007 bwalle@suse.de
|
||||||
|
- 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
|
||||||
|
architectures)
|
||||||
|
* Wed Jun 13 2007 bwalle@suse.de
|
||||||
|
- removed libelf as BuildRequires
|
||||||
|
* Mon Jun 11 2007 bwalle@suse.de
|
||||||
|
- moved copying of dump file to an external package
|
||||||
|
"kdump-helpers"
|
||||||
|
- moved kdump-helper which is needed to save dump in initrd
|
||||||
|
also to kdump-helpers package
|
||||||
|
* Tue Apr 24 2007 olh@suse.de
|
||||||
|
- update to current kexec-tools-testing
|
||||||
|
add PS3 patches
|
||||||
|
* Thu Apr 19 2007 bwalle@suse.de
|
||||||
|
- 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 bwalle@suse.de
|
||||||
|
- improved documentation of KDUMP_DUMPDEV (#264050)
|
||||||
|
* Mon Apr 2 2007 rguenther@suse.de
|
||||||
|
- add zlib-devel BuildRequires
|
||||||
|
* Tue Mar 20 2007 bwalle@suse.de
|
||||||
|
- fixed script to properly unload kdump on IA64 (where kdump
|
||||||
|
kernel is the normal kernel) (#256179)
|
||||||
|
* Mon Mar 19 2007 bwalle@suse.de
|
||||||
|
- 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 tiwai@suse.de
|
||||||
|
- add detailed description about dump triggering methods to
|
||||||
|
README.SUSE (#250134)
|
||||||
|
* Wed Mar 14 2007 tiwai@suse.de
|
||||||
|
- improve the check of crash kernel in kdump init script (#252632)
|
||||||
|
* Fri Mar 9 2007 bwalle@suse.de
|
||||||
|
- added hint that VGA console doesn't work (#253173)
|
||||||
|
* Thu Feb 15 2007 bwalle@suse.de
|
||||||
|
- 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 bwalle@suse.de
|
||||||
|
- 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 bwalle@suse.de
|
||||||
|
- align the both start and end address of the ELF core header
|
||||||
|
to EFI_PAGE_SIZE (4096) to fix wrong EFI memory maps
|
||||||
|
(#214865)
|
||||||
|
* Mon Feb 12 2007 bwalle@suse.de
|
||||||
|
- fixed copying, blocksize was wrong (#243058)
|
||||||
|
* Sat Feb 10 2007 schwab@suse.de
|
||||||
|
- Fix help string.
|
||||||
|
* Fri Feb 9 2007 bwalle@suse.de
|
||||||
|
- 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 7 2007 bwalle@suse.de
|
||||||
|
- don't refuse to deinstall kexec-tools if kdump was not configured
|
||||||
|
(#243081)
|
||||||
|
- fixed documentation error (/var/log/dump instead of
|
||||||
|
/var/log/dumps in README.SUSE)
|
||||||
|
(#239506)
|
||||||
|
* Mon Feb 5 2007 tiwai@suse.de
|
||||||
|
- updated to kexec-tools 2007.02.05:
|
||||||
|
* including last fixes
|
||||||
|
* fix for ppc64 dynamic memory range allocation (#242075)
|
||||||
|
* Fri Feb 2 2007 bwalle@suse.de
|
||||||
|
- fixes overflow on large IA64 systems (#241544)
|
||||||
|
- added KDUMP_COMMANDLINE_APPEND variable (#241607)
|
||||||
|
- increase the command line size (#236828)
|
||||||
|
* Mon Jan 29 2007 olh@suse.de
|
||||||
|
- do not unload kdump kernel during runlevel changes (#238733)
|
||||||
|
* Thu Jan 25 2007 bwalle@suse.de
|
||||||
|
- added documentation for initrd-based kdump saving
|
||||||
|
- fixed description of KDUMP_IMMEDIATE_REBOOT
|
||||||
|
* Wed Jan 24 2007 tiwai@suse.de
|
||||||
|
- fix invalid /proc/vmcore on ppc64 (#238078).
|
||||||
|
* Thu Jan 18 2007 bwalle@suse.de
|
||||||
|
- improved documentation as response to #226736
|
||||||
|
* Wed Jan 17 2007 bwalle@suse.de
|
||||||
|
- implemented Initrd based kdump saving
|
||||||
|
(#301538)
|
||||||
|
* Wed Dec 20 2006 tiwai@suse.de
|
||||||
|
- 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 tiwai@suse.de
|
||||||
|
- 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 tiwai@suse.de
|
||||||
|
- fix kexec to reserve ACPI NVS area (#179093)
|
||||||
|
- add more description about chkconfig and kdump service
|
||||||
|
(#183017)
|
||||||
|
* Fri Jun 16 2006 tiwai@suse.de
|
||||||
|
- add irqpoll boot option for i386 and x86_64 for more robust
|
||||||
|
kdump (#183017)
|
||||||
|
* Thu Jun 1 2006 tiwai@suse.de
|
||||||
|
- update README.SUSE for more precise description about crash
|
||||||
|
and debug kernel.
|
||||||
|
* Tue May 30 2006 tiwai@suse.de
|
||||||
|
- ppc64 kdump ELF header fix for power 4 box (#175128).
|
||||||
|
* Mon May 22 2006 tiwai@suse.de
|
||||||
|
- 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 olh@suse.de
|
||||||
|
- unconditionally add sysrq=1 for kdump boots, nothing to lose
|
||||||
|
* Fri May 19 2006 olh@suse.de
|
||||||
|
- remove crashkernel= cmdline also if only the size is given
|
||||||
|
handle m as well as M because memparse() handles both
|
||||||
|
* Tue May 2 2006 tiwai@suse.de
|
||||||
|
- 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 olh@suse.de
|
||||||
|
- 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 olh@suse.de
|
||||||
|
- 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 olh@suse.de
|
||||||
|
- set /proc/sys/kernel/panic_on_oops to actually trigger a dump
|
||||||
|
* Wed Mar 8 2006 olh@suse.de
|
||||||
|
- add --args-linux only on intel
|
||||||
|
copy vmcore with --sparse, maybe it saves a few bytes.
|
||||||
|
* Wed Feb 22 2006 tiwai@suse.de
|
||||||
|
- updated to kdump7 patch.
|
||||||
|
* Wed Feb 15 2006 tiwai@suse.de
|
||||||
|
- fixed gdb-kdump script (#151001)
|
||||||
|
* Mon Feb 13 2006 tiwai@suse.de
|
||||||
|
- fix for ppc64 (#149576)
|
||||||
|
* Sun Feb 12 2006 tiwai@suse.de
|
||||||
|
- added the system check before dumping
|
||||||
|
- added README.SUSE
|
||||||
|
- added gdb-kdump helper script
|
||||||
|
* Thu Feb 9 2006 tiwai@suse.de
|
||||||
|
- fixed Default-Start in kdump init script.
|
||||||
|
- fixed RequiredStart in sysconfig/kdump.
|
||||||
|
* Wed Feb 8 2006 tiwai@suse.de
|
||||||
|
- changed the default values of KDUMP_IMMEDIATE_REBOOT and
|
||||||
|
KDUMP_RUNLEVEL (#149140).
|
||||||
|
* Tue Feb 7 2006 tiwai@suse.de
|
||||||
|
- added missing preun and postun sections.
|
||||||
|
* Mon Feb 6 2006 tiwai@suse.de
|
||||||
|
- 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 3 2006 tiwai@suse.de
|
||||||
|
- 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 tiwai@suse.de
|
||||||
|
- added kdump init script and sysconfig.
|
||||||
|
* Wed Jan 25 2006 mls@suse.de
|
||||||
|
- converted neededforbuild to BuildRequires
|
||||||
|
* Mon Jan 23 2006 olh@suse.de
|
||||||
|
- update ppc64 kdump support
|
||||||
|
* Thu Jan 5 2006 tiwai@suse.de
|
||||||
|
- more fix for ppc64 kdump
|
||||||
|
- fix malloc size
|
||||||
|
* Thu Dec 15 2005 tiwai@suse.de
|
||||||
|
- use the latest kdump patch.
|
||||||
|
* Mon Dec 12 2005 tiwai@suse.de
|
||||||
|
- initial version: 1.101
|
130
kexec-tools.spec
Normal file
130
kexec-tools.spec
Normal file
|
@ -0,0 +1,130 @@
|
||||||
|
#
|
||||||
|
# spec file for package kexec-tools
|
||||||
|
#
|
||||||
|
# Copyright (c) 2022-2023 ZhuningOS
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
Name: kexec-tools
|
||||||
|
Version: 2.0.20
|
||||||
|
Release: 150500.18.3
|
||||||
|
Summary: Tools for loading replacement kernels into memory
|
||||||
|
License: GPL-2.0-or-later
|
||||||
|
Group: System/Kernel
|
||||||
|
Source: https://kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.xz
|
||||||
|
Source1: kexec-bootloader
|
||||||
|
Source2: kexec-bootloader.8
|
||||||
|
Source3: kexec-load.service
|
||||||
|
Source4: %{name}-rpmlintrc
|
||||||
|
Patch3: %{name}-disable-test.patch
|
||||||
|
Patch4: %{name}-vmcoreinfo-in-xen.patch
|
||||||
|
Patch5: %{name}-add-variant-helper-functions.patch
|
||||||
|
Patch6: %{name}-arm64-kexec-allocate-memory-space-avoiding-reserved-regions.patch
|
||||||
|
Patch7: %{name}-arm64-kdump-deal-with-resource-entries-in-proc-iomem.patch
|
||||||
|
Patch8: %{name}-build-multiboot2-for-i386.patch
|
||||||
|
Patch9: %{name}-video-capability.patch
|
||||||
|
Patch10: %{name}-SYS_getrandom.patch
|
||||||
|
Patch11: %{name}-fix-kexec_file_load-error-handling.patch
|
||||||
|
Patch12: %{name}-reset-getopt-before-falling-back-to-legacy.patch
|
||||||
|
Patch13: %{name}-s390-Reset-kernel-command-line-on-syscal.patch
|
||||||
|
Patch14: %{name}-print-error-if-kexec_file_load-fails.patch
|
||||||
|
BuildRequires: autoconf
|
||||||
|
BuildRequires: automake
|
||||||
|
BuildRequires: systemd-rpm-macros
|
||||||
|
BuildRequires: zlib-devel
|
||||||
|
#!BuildIgnore: fop
|
||||||
|
#!BuildIgnore: gcc-PIE
|
||||||
|
Requires: perl-Bootloader
|
||||||
|
Requires(post): suse-module-tools
|
||||||
|
Requires(postun): suse-module-tools
|
||||||
|
%{?systemd_requires}
|
||||||
|
%ifarch x86_64
|
||||||
|
BuildRequires: pkgconfig
|
||||||
|
BuildRequires: xen-devel
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%description
|
||||||
|
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.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q
|
||||||
|
%patch3 -p1
|
||||||
|
%patch4 -p1
|
||||||
|
%patch5 -p1
|
||||||
|
%patch6 -p1
|
||||||
|
%patch7 -p1
|
||||||
|
%patch8 -p1
|
||||||
|
%patch9 -p1
|
||||||
|
%patch10 -p1
|
||||||
|
%patch11 -p1
|
||||||
|
%patch12 -p1
|
||||||
|
%patch13 -p1
|
||||||
|
%patch14 -p1
|
||||||
|
|
||||||
|
%build
|
||||||
|
autoreconf -fvi
|
||||||
|
export CFLAGS="%{optflags} -fPIC"
|
||||||
|
export BUILD_CFLAGS="%{optflags}"
|
||||||
|
export LDFLAGS="-pie"
|
||||||
|
%configure
|
||||||
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
|
%install
|
||||||
|
%make_install
|
||||||
|
install -c -m 0644 %{SOURCE2} %{buildroot}/%{_mandir}/man8
|
||||||
|
mkdir -p %{buildroot}/%{_sbindir}
|
||||||
|
install -m 0755 %{SOURCE1} %{buildroot}/%{_sbindir}
|
||||||
|
mkdir -p %{buildroot}/%{_unitdir}
|
||||||
|
install -m644 %{SOURCE3} %{buildroot}/%{_unitdir}
|
||||||
|
ln -s service %{buildroot}%{_sbindir}/rckexec-load
|
||||||
|
#UsrMerge
|
||||||
|
mkdir -p %{buildroot}/sbin
|
||||||
|
ln -s %{_sbindir}/kexec %{buildroot}/sbin
|
||||||
|
#EndUsrMerge
|
||||||
|
|
||||||
|
%post
|
||||||
|
%service_add_post kexec-load.service
|
||||||
|
%{?regenerate_initrd_post}
|
||||||
|
|
||||||
|
%postun
|
||||||
|
%service_del_postun kexec-load.service
|
||||||
|
%{?regenerate_initrd_post}
|
||||||
|
|
||||||
|
%pre
|
||||||
|
%service_add_pre kexec-load.service
|
||||||
|
|
||||||
|
%preun
|
||||||
|
%service_del_preun kexec-load.service
|
||||||
|
|
||||||
|
%posttrans
|
||||||
|
%{?regenerate_initrd_posttrans}
|
||||||
|
|
||||||
|
# Compatibility cruft
|
||||||
|
# there is no %license prior to SLE12
|
||||||
|
%if %{undefined _defaultlicensedir}
|
||||||
|
%define license %doc
|
||||||
|
%else
|
||||||
|
# filesystem before SLE12 SP3 lacks /usr/share/licenses
|
||||||
|
%if 0%(test ! -d %{_defaultlicensedir} && echo 1)
|
||||||
|
%define _defaultlicensedir %_defaultdocdir
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
# End of compatibility cruft
|
||||||
|
|
||||||
|
%files
|
||||||
|
%license COPYING
|
||||||
|
%doc AUTHORS News TODO doc
|
||||||
|
%{_mandir}/man*/*
|
||||||
|
#UsrMerge
|
||||||
|
/sbin/kexec
|
||||||
|
#EndUsrMerge
|
||||||
|
%{_sbindir}/rckexec-load
|
||||||
|
%{_sbindir}/kexec
|
||||||
|
%{_sbindir}/kexec-bootloader
|
||||||
|
%{_sbindir}/vmcore-dmesg
|
||||||
|
%{_unitdir}/kexec-load.service
|
||||||
|
|
||||||
|
%changelog
|
Loading…
Add table
Reference in a new issue