diff -Nru kexec-tools-2.0.6/debian/changelog kexec-tools-2.0.6/debian/changelog --- kexec-tools-2.0.6/debian/changelog 2014-10-06 16:04:58.000000000 +0000 +++ kexec-tools-2.0.6/debian/changelog 2015-07-10 16:42:41.000000000 +0000 @@ -1,3 +1,9 @@ +kexec-tools (1:2.0.6-0ubuntu2.2) trusty; urgency=medium + + * Fixes kexec load failure on Power8 (LP: #1461078) + + -- Louis Bouchard Fri, 10 Jul 2015 11:42:41 -0500 + kexec-tools (1:2.0.6-0ubuntu2.1) trusty; urgency=medium * Add the following patches to enable kexec-tools on ppc64el (LP: #1364427): diff -Nru kexec-tools-2.0.6/debian/patches/series kexec-tools-2.0.6/debian/patches/series --- kexec-tools-2.0.6/debian/patches/series 2014-10-02 14:12:41.000000000 +0000 +++ kexec-tools-2.0.6/debian/patches/series 2015-07-10 16:42:39.000000000 +0000 @@ -13,3 +13,4 @@ kexec-ppc64-move-to-device-tree-version-17.patch kexec-ppc64-disabling-exception-handling-when-buildi.patch ppc64-kdump-Fix-ELF-header-endianess.patch +Use-slurp_file_len-to-avoid-partial-read.patch diff -Nru kexec-tools-2.0.6/debian/patches/Use-slurp_file_len-to-avoid-partial-read.patch kexec-tools-2.0.6/debian/patches/Use-slurp_file_len-to-avoid-partial-read.patch --- kexec-tools-2.0.6/debian/patches/Use-slurp_file_len-to-avoid-partial-read.patch 1970-01-01 00:00:00.000000000 +0000 +++ kexec-tools-2.0.6/debian/patches/Use-slurp_file_len-to-avoid-partial-read.patch 2015-07-10 16:42:39.000000000 +0000 @@ -0,0 +1,79 @@ +From d1932cd592e2a6aaf50ed22cfa2d7562b583854a Mon Sep 17 00:00:00 2001 +From: Anton Blanchard +Date: Tue, 2 Dec 2014 10:59:40 +1100 +Subject: [PATCH] kexec/fs2dt: Use slurp_file_len to avoid partial read of + files + +The OPAL firmware is going to embed its symbol map in the device tree. +The size is large enough to be more than a page, and it takes +multiple reads to get the whole file. This is because sysfs uses +the seq_file helpers which do a page at a time. + +Unfortunately fs2dt has no handling for short reads and we die with: + +unrecoverable error: short read from"/proc/device-tree//ibm,opal/firmware/symbol-map" + +This patch uses the slurp_file_len helper which does the right thing. +It moves the explicit open of the file further down for +add_usable_mem_property and add_dyn_reconf_usable_mem_property. +We should convert both of these to use the buffer provided by +slurp_file_len at some stage. + +Signed-off-by: Anton Blanchard +Signed-off-by: Simon Horman + +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/kexec-tools/+bug/1461078 +Index: kexec-tools-2.0.6/kexec/fs2dt.c +=================================================================== +--- kexec-tools-2.0.6.orig/kexec/fs2dt.c 2015-07-10 10:09:15.000000000 +0200 ++++ kexec-tools-2.0.6/kexec/fs2dt.c 2015-07-10 10:10:22.771944081 +0200 +@@ -381,8 +381,8 @@ + { + struct dirent *dp; + int i = 0, fd; +- size_t len; +- ssize_t slen; ++ off_t len; ++ off_t slen; + struct stat statbuf; + + for (i = 0; i < numlist; i++) { +@@ -443,23 +443,27 @@ + *dt++ = cpu_to_be32(propnum(fn)); + pad_structure_block(len); + +- fd = open(pathname, O_RDONLY); +- if (fd == -1) +- die("unrecoverable error: could not open \"%s\": %s\n", +- pathname, strerror(errno)); ++ if (len) { ++ char *buf; + +- slen = read(fd, dt, len); +- if (slen < 0) +- die("unrecoverable error: could not read \"%s\": %s\n", +- pathname, strerror(errno)); +- if ((size_t)slen != len) +- die("unrecoverable error: short read from\"%s\"\n", +- pathname); ++ buf = slurp_file_len(pathname, len, &slen); ++ if (slen != len) ++ die("unrecoverable error: short read from\"%s\"\n", ++ pathname); ++ ++ memcpy(dt, buf, slen); ++ free(buf); ++ } + + checkprop(fn, dt, len); + + dt += (len + 3)/4; + ++ fd = open(pathname, O_RDONLY); ++ if (fd == -1) ++ die("unrecoverable error: could not open \"%s\": %s\n", ++ pathname, strerror(errno)); ++ + if (!strcmp(dp->d_name, "reg") && usablemem_rgns.size) + add_usable_mem_property(fd, len); + add_dyn_reconf_usable_mem_property(dp, fd);