Module Name: src
Committed By: riz
Date: Wed Feb 22 18:45:27 UTC 2012
Modified Files:
src/sys/arch/macppc/stand/ofwboot [netbsd-6]: boot.c boot.h ofdev.c
Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #22):
sys/arch/macppc/stand/ofwboot/boot.c: revision 1.27
sys/arch/macppc/stand/ofwboot/boot.h: revision 1.4
sys/arch/macppc/stand/ofwboot/ofdev.c: revision 1.26
Fix boot failure on OF 2.0 machines.
Discussed with phx@ on port-macppc@:
http://mail-index.NetBSD.org/port-macppc/2012/02/18/msg001556.html
Should be pulled up to netbsd-6.
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.10.1 src/sys/arch/macppc/stand/ofwboot/boot.c
cvs rdiff -u -r1.3 -r1.3.20.1 src/sys/arch/macppc/stand/ofwboot/boot.h
cvs rdiff -u -r1.25 -r1.25.2.1 src/sys/arch/macppc/stand/ofwboot/ofdev.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/macppc/stand/ofwboot/boot.c
diff -u src/sys/arch/macppc/stand/ofwboot/boot.c:1.26 src/sys/arch/macppc/stand/ofwboot/boot.c:1.26.10.1
--- src/sys/arch/macppc/stand/ofwboot/boot.c:1.26 Sat Jan 22 19:19:19 2011
+++ src/sys/arch/macppc/stand/ofwboot/boot.c Wed Feb 22 18:45:26 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: boot.c,v 1.26 2011/01/22 19:19:19 joerg Exp $ */
+/* $NetBSD: boot.c,v 1.26.10.1 2012/02/22 18:45:26 riz Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -96,8 +96,8 @@ char bootdev[MAXBOOTPATHLEN];
char bootfile[MAXBOOTPATHLEN];
int boothowto;
bool floppyboot;
+int ofw_version = 0;
-static int ofw_version = 0;
static const char *kernels[] = { "/netbsd", "/netbsd.gz", "/netbsd.macppc", NULL };
static void
Index: src/sys/arch/macppc/stand/ofwboot/boot.h
diff -u src/sys/arch/macppc/stand/ofwboot/boot.h:1.3 src/sys/arch/macppc/stand/ofwboot/boot.h:1.3.20.1
--- src/sys/arch/macppc/stand/ofwboot/boot.h:1.3 Wed Jan 28 15:03:28 2009
+++ src/sys/arch/macppc/stand/ofwboot/boot.h Wed Feb 22 18:45:26 2012
@@ -10,6 +10,7 @@ void main(void);
#define MAXBOOTPATHLEN 256
extern char bootdev[MAXBOOTPATHLEN];
extern bool floppyboot;
+extern int ofw_version;
#ifdef HAVE_CHANGEDISK_HOOK
struct open_file;
Index: src/sys/arch/macppc/stand/ofwboot/ofdev.c
diff -u src/sys/arch/macppc/stand/ofwboot/ofdev.c:1.25 src/sys/arch/macppc/stand/ofwboot/ofdev.c:1.25.2.1
--- src/sys/arch/macppc/stand/ofwboot/ofdev.c:1.25 Wed Feb 1 21:48:22 2012
+++ src/sys/arch/macppc/stand/ofwboot/ofdev.c Wed Feb 22 18:45:26 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ofdev.c,v 1.25 2012/02/01 21:48:22 matt Exp $ */
+/* $NetBSD: ofdev.c,v 1.25.2.1 2012/02/22 18:45:26 riz Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -425,7 +425,8 @@ devopen(struct open_file *of, const char
return ENXIO;
if (!strcmp(buf, "block") && strrchr(devname, ':') == NULL)
/* indicate raw partition, when missing */
- strlcat(devname, ":0", sizeof(devname));
+ if (ofw_version >= 3)
+ strlcat(devname, ":0", sizeof(devname));
if ((handle = OF_open(devname)) == -1)
return ENXIO;
memset(&ofdev, 0, sizeof ofdev);