rpms/yaboot/devel yaboot-1.3.13-bplan.patch, NONE, 1.1 yaboot.spec, 1.41, 1.42

David Woodhouse (dwmw2) fedora-extras-commits at redhat.com
Tue Nov 27 18:03:25 UTC 2007


Author: dwmw2

Update of /cvs/pkgs/rpms/yaboot/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11773

Modified Files:
	yaboot.spec 
Added Files:
	yaboot-1.3.13-bplan.patch 
Log Message:
fix partition numbering handling with bplan firmware

yaboot-1.3.13-bplan.patch:

--- NEW FILE yaboot-1.3.13-bplan.patch ---
--- yaboot-1.3.13/include/bootinfo.h.nocolonzero	2001-12-01 09:58:10.000000000 +0000
+++ yaboot-1.3.13/include/bootinfo.h	2007-11-27 17:17:28.000000000 +0000
@@ -34,6 +34,7 @@
 #define _MACH_classic	0x00000400	/* RPCG RPX-Classic 8xx board */
 #define _MACH_oak	0x00000800	/* IBM "Oak" 403 eval. board */
 #define _MACH_walnut	0x00001000	/* IBM "Walnut" 405GP eval. board */
+#define _MACH_bplan	0x00002000	/* Pegasos/Efika, broken partition #s */
 
 struct bi_record {
      unsigned long tag;			/* tag ID */
@@ -51,6 +52,8 @@ struct bi_record {
 
 #endif /* _PPC_BOOTINFO_H */
 
+extern int _machine;
+
 /* 
  * Local variables:
  * c-file-style: "k&r"
--- yaboot-1.3.13/second/fs_ext2.c.nocolonzero	2007-11-27 17:16:21.000000000 +0000
+++ yaboot-1.3.13/second/fs_ext2.c	2007-11-27 17:17:43.000000000 +0000
@@ -35,6 +35,7 @@
 #include "fs.h"
 #include "errors.h"
 #include "debug.h"
+#include "bootinfo.h"
 
 #define FAST_VERSION
 #define MAX_READ_RANGE	256
@@ -159,7 +160,8 @@ ext2_open(	struct boot_file_t*	file,
 
      /* Open the OF device for the entire disk */
      strncpy(buffer, dev_name, 1020);
-     strcat(buffer, ":0");
+     if (_machine != _MACH_bplan)
+	  strcat(buffer, ":0");
 
      DEBUG_F("<%s>\n", buffer);
 
--- yaboot-1.3.13/second/fs_reiserfs.c.nocolonzero	2001-12-01 09:58:10.000000000 +0000
+++ yaboot-1.3.13/second/fs_reiserfs.c	2007-11-27 17:18:14.000000000 +0000
@@ -29,6 +29,7 @@
 #include "fs.h"
 #include "errors.h"
 #include "debug.h"
+#include "bootinfo.h"
 #include "reiserfs/reiserfs.h"
 
 /* Exported in struct fs_t */
@@ -84,7 +85,10 @@ reiserfs_open( struct boot_file_t *file,
      else
 	  INFO->partition_offset = 0;
 
-     sprintf( buffer, "%s:%d", dev_name, 0 ); /* 0 is full disk in OF */
+     strncpy(buffer, dev_name, 1020);
+     if (_machine != _MACH_bplan)
+	  strcat(buffer, ":0");  /* 0 is full disk in (non-buggy) OF */
+
      file->of_device = prom_open( buffer );
      DEBUG_F( "Trying to open dev_name=%s; filename=%s; partition offset=%Lu\n",
 	      buffer, file_name, INFO->partition_offset );
--- yaboot-1.3.13/second/fs_xfs.c.nocolonzero	2002-09-15 04:12:21.000000000 +0100
+++ yaboot-1.3.13/second/fs_xfs.c	2007-11-27 17:17:57.000000000 +0000
@@ -30,6 +30,7 @@
 #include "xfs/xfs.h"
 #include "errors.h"
 #include "debug.h"
+#include "bootinfo.h"
 
 #define SECTOR_BITS 9
 
@@ -77,7 +78,9 @@ xfs_open(struct boot_file_t *file, const
 	else
 		partition_offset = 0;
 
-	sprintf(buffer, "%s:%d", dev_name, 0); /* 0 is full disk in OF */
+	strncpy(buffer, dev_name, 1020);
+	if (_machine != _MACH_bplan)
+		strcat(buffer, ":0");  /* 0 is full disk in (non-buggy) OF */
 	DEBUG_F("Trying to open dev_name=%s; filename=%s; partition offset=%Lu\n",
 		buffer, file_name, partition_offset);
 	file->of_device = prom_open(buffer);
--- yaboot-1.3.13/second/partition.c.nocolonzero	2007-11-27 17:16:21.000000000 +0000
+++ yaboot-1.3.13/second/partition.c	2007-11-27 17:17:16.000000000 +0000
@@ -40,6 +40,7 @@
 #include "linux/iso_fs.h"
 #include "debug.h"
 #include "errors.h"
+#include "bootinfo.h"
 
 /* We currently don't check the partition type, some users
  * are putting crap there and still expect it to work...
@@ -337,7 +338,8 @@ partitions_lookup(const char *device)
      unsigned int prom_blksize, iso_root_block;
 	
      strncpy(block_buffer, device, 2040);
-     strcat(block_buffer, ":0");
+     if (_machine != _MACH_bplan)
+	  strcat(block_buffer, ":0");
 	
      /* Open device */
      disk = prom_open(block_buffer);
--- yaboot-1.3.13/second/yaboot.c.nocolonzero	2007-11-27 17:16:21.000000000 +0000
+++ yaboot-1.3.13/second/yaboot.c	2007-11-27 17:16:21.000000000 +0000
@@ -222,7 +222,10 @@ yaboot_start (unsigned long r3, unsigned
      root = prom_finddevice("/");
      if (root != 0) {
 	  static char model[256];
-	  if (prom_getprop(root, "device_type", model, 256 ) > 0 &&
+	  if (prom_getprop(root, "CODEGEN,vendor", model, 256) > 0 &&
+	      !strncmp("bplan", model, 5))
+	       _machine = _MACH_bplan;
+	  else if (prom_getprop(root, "device_type", model, 256 ) > 0 &&
 	      !strncmp("chrp", model, 4))
 	       _machine = _MACH_chrp;
 	  else {
@@ -1490,7 +1493,7 @@ yaboot_main(void)
 	     boot.dev, boot.part, boot.file);
 
      if (!conf_given) {
-	  if (_machine == _MACH_chrp)
+	  if (_machine == _MACH_chrp || _machine == _MACH_bplan)
 	       boot.file = "/etc/";
 	  else if (strlen(boot.file)) {
 	       if (!strncmp(boot.file, "\\\\", 2))


Index: yaboot.spec
===================================================================
RCS file: /cvs/pkgs/rpms/yaboot/devel/yaboot.spec,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- yaboot.spec	21 Aug 2007 18:42:44 -0000	1.41
+++ yaboot.spec	27 Nov 2007 18:02:51 -0000	1.42
@@ -1,7 +1,7 @@
 Summary: Linux bootloader for Power Macintosh "New World" computers.
 Name: yaboot
 Version: 1.3.13
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: GPL
 Group: System Environment/Base
 Source: http://yaboot.ozlabs.org/releases/yaboot-%{version}.tar.gz
@@ -36,6 +36,8 @@
 Patch29: yaboot-1.3.13-dontwritehome.patch
 Patch30: yaboot-1.3.12-addnote.patch
 Patch31: yaboot-1.3.13-ofpath-firewire-usb.patch
+Patch32: yaboot-1.3.13-bplan.patch
+
 URL: http://yaboot.ozlabs.org/
 BuildRoot: %{_tmppath}/%{name}-root
 Obsoletes: ybin
@@ -81,6 +83,7 @@
 %patch29 -p1 -b .bootwrite
 %patch30 -p1 -b .addnote
 %patch31 -p1 -b .firewire
+%patch32 -p1 -b .bplan
 
 %build
 make VERSIONEXTRA='\ (Red Hat %version-%release)'
@@ -114,6 +117,9 @@
 %ghost %config(noreplace) %{_sysconfdir}/yaboot.conf
 
 %changelog
+* Tue Nov 27 2007 David Woodhouse <dwmw2 at redhat.com> - 1.3.13-6
+- Detect broken bplan firmware and don't add ":0" to block device names
+
 * Tue Aug 21 2007 David Cantrell <dcantrell at redhat.com> - 1.3.13-5
 - Rebuild
 




More information about the fedora-extras-commits mailing list