rpms/yaboot/devel yaboot-1.3.14-iscsi.patch, NONE, 1.1 yaboot-1.3.14-netinfo.patch, NONE, 1.1 yaboot-1.3.14-prom_getchars.patch, NONE, 1.1 yaboot.spec, 1.71, 1.72

Roman Rakus rrakus at fedoraproject.org
Wed May 26 15:31:33 UTC 2010


Author: rrakus

Update of /cvs/pkgs/rpms/yaboot/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv24261

Modified Files:
	yaboot.spec 
Added Files:
	yaboot-1.3.14-iscsi.patch yaboot-1.3.14-netinfo.patch 
	yaboot-1.3.14-prom_getchars.patch 
Log Message:
Include missing pacthes

yaboot-1.3.14-iscsi.patch:
 file.c      |    3 +++
 fs_ext2.c   |    3 ++-
 partition.c |    3 ++-
 prom.c      |    2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)

--- NEW FILE yaboot-1.3.14-iscsi.patch ---
Index: b/second/file.c
===================================================================
--- a/second/file.c
+++ b/second/file.c
@@ -671,6 +671,9 @@
      case FILE_DEVICE_BLOCK:
 	  DEBUG_F("device is a block device\n");
 	  return file_block_open(file, spec, spec->part);
+     case FILE_DEVICE_ISCSI:
+	  DEBUG_F("device is a iSCSI device\n");
+	  return file_block_open(file, spec, spec->part);
      case FILE_DEVICE_NET:
 	  DEBUG_F("device is a network device\n");
 	  return file_net_open(file, spec);
Index: b/second/partition.c
===================================================================
--- a/second/partition.c
+++ b/second/partition.c
@@ -400,7 +400,8 @@
      struct partition_t*	found;
      char *type = NULL;
 
-     if (prom_get_devtype(device) != FILE_DEVICE_BLOCK)
+     int device_kind = prom_get_devtype(device);
+     if (device_kind != FILE_DEVICE_BLOCK && device_kind != FILE_DEVICE_ISCSI)
 	  return NULL;
 
      parts = partitions_lookup(device);
Index: b/second/prom.c
===================================================================
--- a/second/prom.c
+++ b/second/prom.c
@@ -196,7 +196,7 @@
      char       tmp[64];
 
      if (strstr(device, TOK_ISCSI))
-	  device = strcpy(tmp, "/vdevice/gscsi/disk");
+	  return FILE_DEVICE_ISCSI;
 
      /* Find OF device phandle */
      dev = prom_finddevice(device);
Index: b/second/fs_ext2.c
===================================================================
--- a/second/fs_ext2.c
+++ b/second/fs_ext2.c
@@ -139,7 +139,8 @@
 	  DEBUG_LEAVE(FILE_ERR_FSBUSY);
 	  return FILE_ERR_FSBUSY;
      }
-     if (file->device_kind != FILE_DEVICE_BLOCK) {
+     if (file->device_kind != FILE_DEVICE_BLOCK
+         && file->device_kind != FILE_DEVICE_ISCSI) {
 	  DEBUG_LEAVE(FILE_ERR_BADDEV);
 	  return FILE_ERR_BADDEV;
      }

yaboot-1.3.14-netinfo.patch:
 file.c |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

--- NEW FILE yaboot-1.3.14-netinfo.patch ---
extract_netinfo_args() should be a void function.

If there is no "netinfo" packet, extract_netinfo_args() will fail and cause 
parse_device_path() to abort.  This basically meant that yaboot will fail to
load any kernel/initrd under those circumstances.

This fix changes extract_netinfo_args() to be a void function.

Signed-off-by: Tony Breeds <tonyb at au1.ibm.com>
---
I'll talk to FW about /why/ there is no netinfo data, but even if that is a FW bug we need to work around it.

 second/file.c |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

--- yaboot-1.3.14.orig/second/file.c	2010-03-06 09:23:12.174204856 +0800
+++ yaboot-1.3.14/second/file.c	2010-03-06 11:59:04.045205260 +0800
@@ -260,10 +260,8 @@ extract_vendor_options(struct bootp_pack
 /*
  * Check netinfo for ipv4 parameters and add them to the fspec iff the
  * fspec has no existing value.
- *
- * Returns 1 on success, 0 on failure.
  */
-static int
+static void
 extract_netinfo_args(struct boot_fspec_t *result)
 {
      struct bootp_packet *packet;
@@ -271,7 +269,7 @@ extract_netinfo_args(struct boot_fspec_t
      /* Check to see if we can get the [scyg]iaddr fields from netinfo */
      packet = prom_get_netinfo();
      if (packet == NULL)
-          return 0;
+          return;
 
      DEBUG_F("We have a boot packet\n");
      DEBUG_F(" siaddr = <%x>\n", packet->siaddr);
@@ -303,8 +301,6 @@ extract_netinfo_args(struct boot_fspec_t
           result->giaddr = ipv4_to_str(packet->siaddr);
           DEBUG_F("Forcing giaddr to siaddr <%s>\n", result->giaddr);
      }
-
-     return 1;
 }
 
 /*
@@ -370,7 +366,7 @@ extract_netboot_args(char *imagepath, st
      else
 	  ret = extract_ipv4_args(imagepath, result);
  
-     ret |= extract_netinfo_args(result);
+     extract_netinfo_args(result);
 
      DEBUG_F("ipv6 = <%d>\n", result->is_ipv6);
      DEBUG_F("siaddr = <%s>\n", result->siaddr);
@@ -526,8 +522,7 @@ parse_device_path(char *imagepath, char 
 		   return 0;
 	  } else {
                /* If we didn't get a ':' then look only in netinfo */
-	       if (extract_netinfo_args(result) == 0)
-		   return 0;
+	       extract_netinfo_args(result);
 	       result->file = strdup(ipath);
           }
 

yaboot-1.3.14-prom_getchars.patch:
 include/prom.h |    1 -
 second/prom.c  |   45 ++++-----------------------------------------
 2 files changed, 4 insertions(+), 42 deletions(-)

--- NEW FILE yaboot-1.3.14-prom_getchars.patch ---
Date: Sun, 11 Apr 2010 14:05:59 +1000
From: Anton Blanchard <anton at samba.org>
Subject: prom_getchar eats characters

This bug has been annoying me for a long time. If you copy and paste a
string into the yaboot prompt, or even type too fast, characters get
dropped.

It turns out we were asking OF for 4 characters, but only using the first one.
There is strange logic to look for \e[, and then oring the third character with
0x100. I haven't been able to find anyone that knows why that was there in the
first place, so just remove it and fix this bug once and for all.

Automated test infrastructures the world over will thank us for fixing this
bug!

Signed-off-by: Anton Blanchard <anton at samba.org>    
Signed-off-by: Tony Breeds <tony at bakeyournoodle.com>

---
diff -purN yaboot-1.3.14.orig/include/prom.h yaboot-1.3.14/include/prom.h
--- yaboot-1.3.14.orig/include/prom.h	2010-05-13 22:32:41.363286396 -0500
+++ yaboot-1.3.14/include/prom.h	2010-05-15 22:45:20.057035750 -0500
@@ -84,7 +84,6 @@ void prom_printf (char *fmt, ...);
 #endif
 
 void prom_perror (int error, char *filename);
-void prom_readline (char *prompt, char *line, int len);
 int prom_set_color(prom_handle device, int color, int r, int g, int b);
 
 /* memory */
diff -purN yaboot-1.3.14.orig/second/prom.c yaboot-1.3.14/second/prom.c
--- yaboot-1.3.14.orig/second/prom.c	2010-05-13 22:32:41.383286111 -0500
+++ yaboot-1.3.14/second/prom.c	2010-05-15 22:45:43.615473125 -0500
@@ -389,14 +389,12 @@ prom_readblocks (prom_handle dev, int bl
 int
 prom_getchar ()
 {
-     char c[4];
+     char c;
      int a;
 
-     while ((a = (int)call_prom ("read", 3, 1, prom_stdin, c, 4)) <= 0)
-	  ;
-     if (a == 3 && c[0] == '\e' && c[1] == '[')
-	  return 0x100 | c[2];
-     return c[0];
+     while ((a = (int)call_prom ("read", 3, 1, prom_stdin, &c, 1)) <= 0)
+	  continue;
+     return c;
 }
 
 int
@@ -500,41 +498,6 @@ prom_perror (int error, char *filename)
 	  prom_printf("%s: Unknown error\n", filename);
 }
 
-void
-prom_readline (char *prompt, char *buf, int len)
-{
-     int i = 0;
-     int c;
-
-     if (prompt)
-	  prom_puts (prom_stdout, prompt);
-
-     while (i < len-1 && (c = prom_getchar ()) != '\r')
-     {
-	  if (c >= 0x100)
-	       continue;
-	  if (c == 8)
-	  {
-	       if (i > 0)
-	       {
-		    prom_puts (prom_stdout, "\b \b");
-		    i--;
-	       }
-	       else
-		    prom_putchar ('\a');
-	  }
-	  else if (isprint (c))
-	  {
-	       prom_putchar (c);
-	       buf[i++] = c;
-	  }
-	  else
-	       prom_putchar ('\a');
-     }
-     prom_putchar ('\n');
-     buf[i] = 0;
-}
-
 #ifdef CONFIG_SET_COLORMAP
 int prom_set_color(prom_handle device, int color, int r, int g, int b)
 {


Index: yaboot.spec
===================================================================
RCS file: /cvs/pkgs/rpms/yaboot/devel/yaboot.spec,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -p -r1.71 -r1.72
--- yaboot.spec	22 Jan 2010 15:48:28 -0000	1.71
+++ yaboot.spec	26 May 2010 15:31:33 -0000	1.72
@@ -1,7 +1,7 @@
 Summary: Linux bootloader for Power Macintosh "New World" computers.
 Name: yaboot
 Version: 1.3.14
-Release: 22%{?dist}
+Release: 32%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source: http://yaboot.ozlabs.org/releases/yaboot-%{version}.tar.gz
@@ -46,6 +46,16 @@ Patch39: yaboot-1.3.14-move_kernel.patch
 # Don't use insecure MD5, use SHA-2
 Patch40: yaboot-sha2.patch
 
+# Solves the situation, when there is no netinfo packet
+Patch41: yaboot-1.3.14-netinfo.patch
+
+# Better ISCSI boot
+Patch42: yaboot-1.3.14-iscsi.patch
+
+# prom_getchar eats characters
+Patch43: yaboot-1.3.14-prom_getchars.patch
+
+
 URL: http://yaboot.ozlabs.org/
 BuildRoot: %{_tmppath}/%{name}-root
 Obsoletes: ybin
@@ -98,6 +108,9 @@ yaboot can also bootload IBM pSeries mac
 %patch38 -p1 -b .netboot2
 %patch39 -p1 -b .movekernel
 %patch40 -p1 -b .sha2
+%patch41 -p1 -b .netinfo
+%patch42 -p1 -b .iscsi
+%patch43 -p1 -b .prom_getchars
 
 %build
 make VERSIONEXTRA='\ (Red Hat %version-%release)' DEBUG=1
@@ -138,6 +151,15 @@ rm -rf $RPM_BUILD_ROOT
 %ghost %config(noreplace) %{_sysconfdir}/yaboot.conf
 
 %changelog
+* Wed May 26 2010 Roman Rakus <rrakus at redhat.com> - 1.3.14-32
+- Added missing yaboot-1.3.14-netinfo.patch
+  Resolves: #553061
+- Better iSCSI booting
+  Resolves: #553748
+- Allow copy&paste
+  Resolves: #593377
+- Bump release to 32 (as in RHEL6)
+
 * Fri Jan 22 2010 Roman Rakus <rrasku at redhat.com> 1.3.14-22
 - SHA2 support
 



More information about the scm-commits mailing list