Subject: port-hpcarm/34814: hpcboot(8) supports dk(4) wedge driver
To: None <port-hpcarm-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <tnozaki@NetBSD.org>
List: netbsd-bugs
Date: 10/14/2006 15:55:00
>Number:         34814
>Category:       port-hpcarm
>Synopsis:       hpcboot(8) supports dk(4) wedge driver
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-hpcarm-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 14 15:55:00 +0000 2006
>Originator:     Takehiko NOZAKI
>Release:        NetBSD 4.99.3 hpcarm
>Organization:
>Environment:
NetBSD jetstream 4.99.3 NetBSD 4.99.3 (JETSTREAM) #0: Sat Oct 14 01:05:56 JST 2006 root@spooky.example.com:/usr/obj/sys/arch/hpcarm/compile/JETSTREAM hpcarm
>Description:
hpcboot(8) can't boot kernel when root device is dk(4).


>How-To-Repeat:

>Fix:
apply this patch.

Index: sys/arch/hpc/stand/hpcboot/hpcmenu.cpp
===================================================================
RCS file: /cvsroot/src/sys/arch/hpc/stand/hpcboot/hpcmenu.cpp,v
retrieving revision 1.17
diff -u -r1.17 hpcmenu.cpp
--- sys/arch/hpc/stand/hpcboot/hpcmenu.cpp	5 Mar 2006 04:05:39 -0000	1.17
+++ sys/arch/hpc/stand/hpcboot/hpcmenu.cpp	14 Oct 2006 15:43:17 -0000
@@ -274,6 +274,12 @@
 		loc += 6;
 		locp += 6;
 		break;
+	case 4: // dkwedge
+		argv[argc++] = ptokv(locp);
+		strncpy(loc, "b=dk0", 6);
+		loc += 6;
+		locp += 6;
+		break;
 	}
 
 	// Extra kernel options. (Option tab window)
Index: sys/arch/hpc/stand/hpcboot/menu/menu.cpp
===================================================================
RCS file: /cvsroot/src/sys/arch/hpc/stand/hpcboot/menu/menu.cpp,v
retrieving revision 1.10
diff -u -r1.10 menu.cpp
--- sys/arch/hpc/stand/hpcboot/menu/menu.cpp	11 Dec 2005 12:17:28 -0000	1.10
+++ sys/arch/hpc/stand/hpcboot/menu/menu.cpp	14 Oct 2006 15:43:18 -0000
@@ -266,6 +266,8 @@
 		pref.rootfs = 2;
 	else if (_is_checked(IDC_MAIN_ROOT_NFS))
 		pref.rootfs = 3;
+	else if (_is_checked(IDC_MAIN_ROOT_DK))
+		pref.rootfs = 4;
 
 	pref.boot_ask_for_name	= _is_checked(IDC_MAIN_OPTION_A);
 	pref.boot_debugger	= _is_checked(IDC_MAIN_OPTION_D);
@@ -294,6 +296,8 @@
 	case IDC_MAIN_ROOT_MD:
 		/* FALLTHROUGH */
 	case IDC_MAIN_ROOT_NFS:
+		/* FALLTHROUGH */
+	case IDC_MAIN_ROOT_DK:
 		EnableWindow(_edit_md_root, _is_checked(IDC_MAIN_ROOT_MD));
 	}
 }
Index: sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc
===================================================================
RCS file: /cvsroot/src/sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc,v
retrieving revision 1.15
diff -u -r1.15 hpcmenu.rc
--- sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc	11 Dec 2005 12:17:28 -0000	1.15
+++ sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc	14 Oct 2006 15:43:23 -0000
@@ -88,11 +88,12 @@
 	AUTORADIOBUTTON	"sd",	IDC_MAIN_ROOT_SD,	35, 40, 22, 10
 	AUTORADIOBUTTON	"md",	IDC_MAIN_ROOT_MD,	60, 40, 22, 10
 	AUTORADIOBUTTON	"nfs",	IDC_MAIN_ROOT_NFS,	85, 40, 22, 10
+	AUTORADIOBUTTON	"dk",	IDC_MAIN_ROOT_DK,	110, 40, 22, 10
 	EDITTEXT	IDC_MAIN_ROOT_MD_OPS		10, 53, 100, 12,
 		WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP |
 		ES_LEFT | ES_AUTOHSCROLL
 	GROUPBOX	"root file system"	IDC_MAIN_ROOT_OPTION
-							5, 33, 110, 35
+							5, 33, 135, 35
 	// boot options
 	AUTOCHECKBOX	"boot verbosely"	IDC_MAIN_OPTION_V
 							5, 59, 120, 9
Index: sys/arch/hpc/stand/hpcboot/res/resource.h
===================================================================
RCS file: /cvsroot/src/sys/arch/hpc/stand/hpcboot/res/resource.h,v
retrieving revision 1.8
diff -u -r1.8 resource.h
--- sys/arch/hpc/stand/hpcboot/res/resource.h	11 Dec 2005 12:17:28 -0000	1.8
+++ sys/arch/hpc/stand/hpcboot/res/resource.h	14 Oct 2006 15:43:23 -0000
@@ -69,7 +69,8 @@
 #define	IDC_MAIN_ROOT_SD	102
 #define	IDC_MAIN_ROOT_MD	103
 #define	IDC_MAIN_ROOT_NFS	104
-#define	IDC_MAIN_ROOT_MD_OPS	105
+#define	IDC_MAIN_ROOT_DK	105
+#define	IDC_MAIN_ROOT_MD_OPS	106
 
 #define	IDC_MAIN_OPTION_A	150
 #define	IDC_MAIN_OPTION_S	151