[yaboot/f16] fixes #746408 - yaboot discards parameters after CAS reboot
Jiri Skala
jskala at fedoraproject.org
Mon Oct 17 20:51:17 UTC 2011
commit d9256fdd62b46a5409d4162b6fc3163f8ee0c2ce
Author: Jiri Skala <jskala at redhat.com>
Date: Mon Oct 17 22:51:14 2011 +0200
fixes #746408 - yaboot discards parameters after CAS reboot
yaboot-1.3.14-dhcp_truncate.patch | 17 +++++++++++++
yaboot-1.3.16-args-cas.patch | 32 +++++++++++++++++++++++++
yaboot-1.3.16-no-strict-aliasing.patch | 11 ++++++++
yaboot-1.3.16-powervm.patch | 40 ++++++++++++++++++++++++++++++++
yaboot.spec | 28 +++++++++++++++++++++-
5 files changed, 127 insertions(+), 1 deletions(-)
---
diff --git a/yaboot-1.3.14-dhcp_truncate.patch b/yaboot-1.3.14-dhcp_truncate.patch
new file mode 100644
index 0000000..749408a
--- /dev/null
+++ b/yaboot-1.3.14-dhcp_truncate.patch
@@ -0,0 +1,17 @@
+diff -ru yaboot-1.3.16.orig/second/file.c yaboot-1.3.16/second/file.c
+--- yaboot-1.3.16.orig/second/file.c 2011-08-11 10:32:58.654006637 +1000
++++ yaboot-1.3.16/second/file.c 2011-08-11 10:34:04.877846737 +1000
+@@ -223,7 +223,12 @@
+ continue;
+
+ len = options[i++];
+- memcpy(&value, &options[i], len);
++ /* Clamp the maxium length of the memcpy() to the right size for
++ * value. */
++ if (len > sizeof(value))
++ memcpy(&value, &options[i], sizeof(value));
++ else
++ memcpy(&value, &options[i], len);
+
+ #if DEBUG
+ {
diff --git a/yaboot-1.3.16-args-cas.patch b/yaboot-1.3.16-args-cas.patch
new file mode 100644
index 0000000..28ff872
--- /dev/null
+++ b/yaboot-1.3.16-args-cas.patch
@@ -0,0 +1,32 @@
+diff -up yaboot-1.3.16/second/yaboot.c.args-cas yaboot-1.3.16/second/yaboot.c
+--- yaboot-1.3.16/second/yaboot.c.args-cas 2011-10-17 21:56:53.728000031 +0200
++++ yaboot-1.3.16/second/yaboot.c 2011-10-17 21:56:53.731000031 +0200
+@@ -751,9 +751,10 @@ int get_params(struct boot_param_t* para
+ if (!imagename) {
+ if (bootoncelabel[0] != 0)
+ imagename = bootoncelabel;
+- else if (bootlastlabel[0] != 0)
+- imagename = bootlastlabel;
+- else
++ else if (bootlastlabel[0] != 0) {
++ imagename = bootlastlabel;
++ word_split(&imagename, ¶ms->args);
++ } else
+ imagename = cfg_get_default();
+ }
+ if (imagename)
+@@ -815,7 +816,13 @@ int get_params(struct boot_param_t* para
+ imagename = cfg_get_default();
+
+ /* write the imagename out so it can be reused on reboot if necessary */
+- prom_set_options("boot-last-label", imagename, strlen(imagename));
++ strcpy(bootlastlabel, imagename);
++ if (params->args && params->args[0]) {
++ strcat(bootlastlabel, " ");
++ strcat(bootlastlabel, params->args);
++ }
++ prom_set_options("boot-last-label", bootlastlabel,
++ strlen(bootlastlabel) + 1);
+
+ label = 0;
+ defdevice = boot.dev;
diff --git a/yaboot-1.3.16-no-strict-aliasing.patch b/yaboot-1.3.16-no-strict-aliasing.patch
new file mode 100644
index 0000000..7895bd6
--- /dev/null
+++ b/yaboot-1.3.16-no-strict-aliasing.patch
@@ -0,0 +1,11 @@
+diff -uNr yaboot-1.3.16.orig/Makefile yaboot-1.3.16/Makefile
+--- yaboot-1.3.16.orig/Makefile 2011-08-31 15:24:40.920001343 +1000
++++ yaboot-1.3.16/Makefile 2011-08-31 15:38:22.050001354 +1000
+@@ -42,6 +42,7 @@
+ YBCFLAGS += -DMALLOCADDR=$(MALLOCADDR) -DMALLOCSIZE=$(MALLOCSIZE)
+ YBCFLAGS += -DKERNELADDR=$(KERNELADDR)
+ YBCFLAGS += -I ./include
++YBCFLAGS += -fno-strict-aliasing
+
+ ifeq ($(CONFIG_COLOR_TEXT),y)
+ YBCFLAGS += -DCONFIG_COLOR_TEXT
diff --git a/yaboot-1.3.16-powervm.patch b/yaboot-1.3.16-powervm.patch
new file mode 100644
index 0000000..ebdd970
--- /dev/null
+++ b/yaboot-1.3.16-powervm.patch
@@ -0,0 +1,40 @@
+diff -uNr yaboot-1.3.16.orig/second/yaboot.c yaboot-1.3.16/second/yaboot.c
+--- yaboot-1.3.16.orig/second/yaboot.c 2011-08-31 15:24:40.940001350 +1000
++++ yaboot-1.3.16/second/yaboot.c 2011-08-31 15:30:43.890002019 +1000
+@@ -233,6 +233,9 @@
+ else if (prom_getprop(root, "device_type", model, 256 ) > 0 &&
+ !strncmp("chrp", model, 4))
+ _machine = _MACH_chrp;
++ else if (prom_getprop(root, "compatible", model, 256 ) > 0 &&
++ strstr(model, "ibm,powernv"))
++ _machine = _MACH_chrp;
+ else {
+ if (prom_getprop(root, "model", model, 256 ) > 0 &&
+ !strncmp(model, "IBM", 3))
+diff -uNr yaboot-1.3.16.orig/ybin/ybin yaboot-1.3.16/ybin/ybin
+--- yaboot-1.3.16.orig/ybin/ybin 2011-08-31 15:24:40.910001339 +1000
++++ yaboot-1.3.16/ybin/ybin 2011-08-31 15:34:58.630001563 +1000
+@@ -73,7 +73,9 @@
+
+ ## defaults
+ usemount=no
+-if (cat /proc/cpuinfo 2> /dev/null | grep ^machine | grep -q 'CHRP IBM') ; then
++if (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'pSeries') ; then
++ fstype=raw
++elif (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'PowerNV') ; then
+ fstype=raw
+ elif (cat /proc/cpuinfo 2> /dev/null | grep ^machine | grep -q 'Pegasos') ; then
+ fstype=ext2
+@@ -508,7 +510,11 @@
+ echo 1>&2
+ [ "$nonvram" = 0 ] && echo 1>&2 "$PRG: OldWorld PowerMac, nvram will not be updated"
+ nonvram=1
+- elif (cat /proc/cpuinfo 2> /dev/null | grep ^machine | grep -q 'CHRP IBM') ; then
++ elif (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'pSeries') ; then
++ ## IBM hardware does not need nvram update AFAICT
++ nonvram=1
++ ADDNOTE=yes
++ elif (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'PowerNV') ; then
+ ## IBM hardware does not need nvram update AFAICT
+ nonvram=1
+ ADDNOTE=yes
diff --git a/yaboot.spec b/yaboot.spec
index f39fd03..d9315c2 100644
--- a/yaboot.spec
+++ b/yaboot.spec
@@ -1,7 +1,7 @@
Summary: Linux bootloader for Power Macintosh "New World" computers.
Name: yaboot
Version: 1.3.16
-Release: 3%{?dist}
+Release: 7%{?dist}
License: GPLv2+
Group: System Environment/Base
Source: http://yaboot.ozlabs.org/releases/yaboot-%{version}.tar.gz
@@ -53,6 +53,15 @@ Patch44: yaboot-1.3.14-256-RMA.patch
# Create dummy instance of posix_memalign for e3fsprogs
Patch45: yaboot-1.3.16-memalign.patch
+# Truncate memcpy() in extract_vendor_options()
+# https://bugzilla.redhat.com/show_bug.cgi?id=729684
+Patch46: yaboot-1.3.14-dhcp_truncate.patch
+Patch47: yaboot-1.3.16-no-strict-aliasing.patch
+Patch48: yaboot-1.3.16-powervm.patch
+
+# Yaboot discards parameters after CAS reboot
+Patch49: yaboot-1.3.16-args-cas.patch
+
URL: http://yaboot.ozlabs.org/
BuildRoot: %{_tmppath}/%{name}-root
Obsoletes: ybin
@@ -104,6 +113,10 @@ yaboot can also bootload IBM pSeries machines.
%patch43 -p1 -b .prom_getchars
%patch44 -p1 -b .256-RMA
%patch45 -p1 -b .posix
+%patch46 -p1 -b .dhcppad
+%patch47 -p1 -b .aliasing
+%patch48 -p1 -b .powervm
+%patch49 -p1 -b .args-cas
%build
make VERSIONEXTRA='\ (Red Hat %version-%release)' DEBUG=1
@@ -144,6 +157,19 @@ rm -rf $RPM_BUILD_ROOT
%ghost %config(noreplace) %{_sysconfdir}/yaboot.conf
%changelog
+* Mon Oct 17 2011 Jiri Skala <jskala at redhat.com> - 1.3.16-7
+- fixes #746408 - yaboot discards parameters after CAS reboot
+
+* Mon Sep 26 2011 Tony Breeds <tony at bakeyournoodle.com> - 1.3.16-6
+- Add no-strict-aliasing to YBCFLAGS
+- Add detection for PowerVM Firmware.
+
+* Wed Aug 31 2011 Tony Breeds <tony at bakeyournoodle.com> - 1.3.16-5
+- yaboot-ppc64.patch incorrectly removed the -melfppc32linux from LDFLAGS. DOn't know why this hasn't been a problem 'til now.
+
+* Thu Aug 11 2011 Tony Breeds <tony at bakeyournoodle.com> - 1.3.16-4
+- truncate memcpy() extract_vendor_options() to avoid clobbering the stack. (closes 729684)
+
* Tue Apr 12 2011 Tony Breeds <tony at bakeyournoodle.com> - 1.3.16-3
- Add fix for failing to link against posix_memalign() (closes 689415)
More information about the scm-commits
mailing list