Subject: Quick hack to select boot drive permanently...
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Christos Zoulas <christos@deshaw.com>
List: current-users
Date: 01/22/1994 17:29:30
Here's what I came up to permanently boot from my scsi drive.
[I have a wd and a scsi drive, but I want to use the scsi]
It is a miserable hack, but it works.
Maybe someone should fix the boot blocks to support changing 
the boot device permanently.

christos

*** boot.c.dist	Fri Jan 21 14:18:20 1994
--- boot.c	Sat Jan 22 17:06:04 1994
***************
*** 240,246 ****
  	startprog((int)startaddr, argv);
  }
  
! char namebuf[100];
  getbootdev(howto)
       int *howto;
  {
--- 240,247 ----
  	startprog((int)startaddr, argv);
  }
  
! char namebuf[100] = "hd(1,a)/netbsd";
! 
  getbootdev(howto)
       int *howto;
  {
***************
*** 250,285 ****
  			, unit
  			, 'a'+part
  			, name);
! 	if (gets(namebuf)) {
! 		while (c = *ptr) {
! 			while (c == ' ')
! 				c = *++ptr;
! 			if (!c)
! 				return;
! 			if (c == '-')
! 				while ((c = *++ptr) && c != ' ')
! 					switch (c) {
! 					case 'a':
! 						*howto |= RB_ASKNAME;
! 						continue;
! 					case 's':
! 						*howto |= RB_SINGLE;
! 						continue;
! 					case 'd':
! 						*howto |= RB_KDB;
! 						continue;
! 					case 'b':
! 						*howto |= RB_HALT;
! 						continue;
! 					}
! 			else {
! 				name = ptr;
! 				while ((c = *++ptr) && c != ' ');
! 				if (c)
! 					*ptr++ = 0;
! 			}
! 		}
! 	} else
  		printf("\n");
  }
  
--- 251,287 ----
  			, unit
  			, 'a'+part
  			, name);
! 
! 	if (!gets(namebuf))
  		printf("\n");
+ 
+ 	while (c = *ptr) {
+ 		while (c == ' ')
+ 			c = *++ptr;
+ 		if (!c)
+ 			return;
+ 		if (c == '-')
+ 			while ((c = *++ptr) && c != ' ')
+ 				switch (c) {
+ 				case 'a':
+ 					*howto |= RB_ASKNAME;
+ 					continue;
+ 				case 's':
+ 					*howto |= RB_SINGLE;
+ 					continue;
+ 				case 'd':
+ 					*howto |= RB_KDB;
+ 					continue;
+ 				case 'b':
+ 					*howto |= RB_HALT;
+ 					continue;
+ 				}
+ 		else {
+ 			name = ptr;
+ 			while ((c = *++ptr) && c != ' ');
+ 			if (c)
+ 				*ptr++ = 0;
+ 		}
+ 	}
  }
  

------------------------------------------------------------------------------