plan 9 kernel history: overview | file list | diff list

1995/02021/boot/local.c (diff list | history)

1994/0312/sys/src/9/boot/local.c:4,101995/02021/sys/src/9/boot/local.c:4,9 (short | long | prev | next)
1992/0317    
 
1994/0312    
static char diskname[2*NAMELEN]; 
1992/0317    
static char *disk; 
1993/0403    
static char *niob; 
1992/0317    
 
void 
configlocal(Method *mp) 
1994/0312/sys/src/9/boot/local.c:12,311995/02021/sys/src/9/boot/local.c:11,49
1994/0312    
	char *p; 
	int n; 
 
	disk = mp->arg;			/* 1st try from config file */ 
	if(disk && (niob = strchr(disk, ' ')))	/* assign = */ 
		*niob++ = 0; 
	if(strncmp(argv0, "dksc(0,", 7) == 0){ 
1995/02021    
	if(*sys == '/' || *sys == '#'){ 
		/* 
		 *  if the user specifies the disk in the boot cmd or 
		 * 'root is from' prompt, use it 
		 */ 
		disk = sys; 
	} else if(strncmp(argv0, "dksc(0,", 7) == 0){ 
		/* 
		 *  on many mips arg0 of the boot command specifies the 
		 *  scsi logical unit number 
		 */ 
1994/0312    
		p = strchr(argv0, ','); 
		n = strtoul(p+1, 0, 10); 
		sprint(diskname, "#w%d/sd%dfs", n, n); 
		disk = diskname; 
		/*print("argv0=\"%s\" --> disk = \"%s\"\n", argv0, disk);/**/ 
1995/02021    
	} else if(mp->arg){ 
		/* 
		 *  a default is supplied when the kernel is made 
		 */ 
		disk = mp->arg; 
	} else if(*bootdisk){ 
		/* 
		 *  an environment variable from a pc's plan9.ini or 
		 *  from the mips nvram or generated by the kernel 
		 *  is the last resort. 
		 */ 
		disk = bootdisk; 
1994/0312    
	} 
1992/0826    
	if(*sys == '/' || *sys == '#') 
		disk = sys; 
1995/02021    
 
	/* if we've decided on one, pass it on to all programs */ 
1994/0312    
	if(disk) 
		setenv("bootdisk", disk); 
1995/02021    
 
1992/0317    
	USED(mp); 
} 
 
1994/0312/sys/src/9/boot/local.c:72,811995/02021/sys/src/9/boot/local.c:90,95
1992/0902    
		close(p[1]); 
1993/0403    
		argp = args; 
		*argp++ = "fs"; 
		if(niob){ 
			*argp++ = "-B"; 
			*argp++ = niob; 
		} 
		*argp++ = "-f"; 
		*argp++ = partition; 
		*argp++ = "-s"; 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)