[yaboot] Fix fs_swap to not break DVD boots.

Tony Breeds tbreeds at fedoraproject.org
Wed Oct 19 04:06:37 UTC 2011


commit 15ed53c8e0c93ff3893a314797c3141c38e284e4
Author: Tony Breeds <tony at bakeyournoodle.com>
Date:   Wed Oct 19 13:51:41 2011 +1100

    Fix fs_swap to not break DVD boots.
    
    Signed-off-by: Tony Breeds <tony at bakeyournoodle.com>

 yaboot-1.3.17-fs_swap.patch |   41 +++++++++++++++++++++++++++++++++++++++++
 yaboot.spec                 |    9 ++++++++-
 2 files changed, 49 insertions(+), 1 deletions(-)
---
diff --git a/yaboot-1.3.17-fs_swap.patch b/yaboot-1.3.17-fs_swap.patch
new file mode 100644
index 0000000..a754ea5
--- /dev/null
+++ b/yaboot-1.3.17-fs_swap.patch
@@ -0,0 +1,41 @@
+From f6058147054159eba994eb9589e2ebabe4a05570 Mon Sep 17 00:00:00 2001
+From: Tony Breeds <tony at bakeyournoodle.com>
+Date: Wed, 19 Oct 2011 13:36:49 +1100
+Subject: [PATCH] fs_swap: Reduce severity of not finding a partition table on
+ boot device.
+
+When booted from a cdrom the fs_swap would exit with FILE_ERR_BADDEV,
+this causes fs_open to abort too early.
+
+We don't need to check file->device_kind != FILE_DEVICE_BLOCK as we're
+only called when that is true.
+
+Demote the return value to FILE_ERR_BAD_FSYS which allows fs_open to
+look for other filesystems on the device.
+
+Signed-off-by: Tony Breeds <tony at bakeyournoodle.com>
+---
+ second/fs_swap.c |    7 ++++---
+ 1 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/second/fs_swap.c b/second/fs_swap.c
+index 87da877..1efb96e 100644
+--- a/second/fs_swap.c
++++ b/second/fs_swap.c
+@@ -59,9 +59,10 @@ swap_open(struct boot_file_t* file, struct partition_t* part,
+      DEBUG_ENTER;
+      DEBUG_OPEN;
+ 
+-     if (file->device_kind != FILE_DEVICE_BLOCK || part == NULL) {
+-	  DEBUG_LEAVE(FILE_ERR_BADDEV);
+-	  return FILE_ERR_BADDEV;
++     if (part == NULL) {
++          DEBUG_F("No partions on %s, not checking for swap\n", device_name);
++	  DEBUG_LEAVE(FILE_ERR_BAD_FSYS);
++	  return FILE_ERR_BAD_FSYS;
+      }
+ 
+      /* We assume that device is "short" and is correctly NULL terminsated */
+-- 
+1.7.6.4
+
diff --git a/yaboot.spec b/yaboot.spec
index cf35e42..e8d4935 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.17
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source: http://yaboot.ozlabs.org/releases/yaboot-%{version}.tar.gz
@@ -27,6 +27,9 @@ Patch40: yaboot-sha2.patch
 # Do not use Werror, the compiler in F16/Rawhide is hitting warnings that
 # Upstream doesn't see.  Bypass them for now.
 Patch41: yaboot-1.3.17-no-werror.patch
+# When booted from a cdrom the fs_swap would exit with FILE_ERR_BADDEV,
+# this causes fs_open to abort too early and breaks booting from DVD
+Patch42: yaboot-1.3.17-fs_swap.patch
 
 URL: http://yaboot.ozlabs.org/
 BuildRoot: %{_tmppath}/%{name}-root
@@ -69,6 +72,7 @@ yaboot can also bootload IBM pSeries machines.
 %patch28 -p1
 %patch40 -p1
 %patch41 -p1
+%patch42 -p1
 
 %build
 make VERSIONEXTRA='\ (Red Hat %version-%release)' DEBUG=1
@@ -109,6 +113,9 @@ rm -rf $RPM_BUILD_ROOT
 %ghost %config(noreplace) %{_sysconfdir}/yaboot.conf
 
 %changelog
+* Mon Oct 19 2011 Tony Breeds <tony at bakeyournoodle.com> - 1.3.17-2
+- Fix fs_swap to not break boot CDs
+
 * Mon Oct 18 2011 Tony Breeds <tony at bakeyournoodle.com> - 1.3.17-1
 - Update to upstream 1.3.18 release
 


More information about the scm-commits mailing list