diff options
| author | cvs2svn <cvs2svn@FreeBSD.org> | 1999-01-21 00:55:32 +0000 | 
|---|---|---|
| committer | cvs2svn <cvs2svn@FreeBSD.org> | 1999-01-21 00:55:32 +0000 | 
| commit | 76b5366091f76c9bc73570149ef5055648fc2c39 (patch) | |
| tree | 590d020e0f2a5bea6e09d66d951a674443b21d67 /sbin/disklabel/disklabel.c | |
| parent | 4b4d01da6f07f7754ff6a6e4f5223e9f0984d1a6 (diff) | |
Diffstat (limited to 'sbin/disklabel/disklabel.c')
| -rw-r--r-- | sbin/disklabel/disklabel.c | 36 | 
1 files changed, 27 insertions, 9 deletions
| diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index ff04e4b9d17c5..be60d542768a3 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -46,7 +46,7 @@ static char sccsid[] = "@(#)disklabel.c	8.2 (Berkeley) 1/7/94";  /* from static char sccsid[] = "@(#)disklabel.c	1.2 (Symmetric) 11/28/85"; */  #endif  static const char rcsid[] = -	"$Id: disklabel.c,v 1.23 1998/10/23 18:57:39 bde Exp $"; +	"$Id: disklabel.c,v 1.20 1998/08/21 23:44:16 gpalmer Exp $";  #endif /* not lint */  #include <sys/param.h> @@ -76,6 +76,12 @@ static const char rcsid[] =   * for the label on such machines.   */ +#ifdef tahoe +#define RAWPARTITION	'a' +#else +#define RAWPARTITION	'c' +#endif +  #ifndef BBSIZE  #define	BBSIZE	8192			/* size of boot area, with label */  #endif @@ -226,7 +232,7 @@ main(argc, argv)  	dkname = argv[0];  	if (dkname[0] != '/') { -		(void)sprintf(np, "%sr%s%c", _PATH_DEV, dkname, 'a' + RAW_PART); +		(void)sprintf(np, "%sr%s%c", _PATH_DEV, dkname, RAWPARTITION);  		specname = np;  		np += strlen(specname) + 1;  	} else @@ -477,7 +483,7 @@ l_perror(s)  	case ESRCH:  		warnx("%s: no disk label on disk;", s);  		fprintf(stderr, -		    "use \"disklabel -r\" to install initial label\n"); +			"use \"disklabel -r\" to install initial label\n");  		break;  	case EINVAL: @@ -490,8 +496,8 @@ l_perror(s)  		break;  	case EXDEV: -		warnx("%s: '%c' partition must start at beginning of disk", -		    s, 'a' + RAW_PART); +		warnx( + "%s: labeled partition or 'a' partition must start at beginning of disk", s);  		break;  	default: @@ -595,13 +601,25 @@ makebootarea(boot, dp, f)  		*np++ = '\0';  		if (!xxboot) { -			(void)sprintf(boot0, "%s/boot1", _PATH_BOOTDIR); -			xxboot = boot0; +			(void)sprintf(np, "%s/%sboot", +				      _PATH_BOOTDIR, dkbasename); +			if (access(np, F_OK) < 0 && dkbasename[0] == 'r') +				dkbasename++; +			xxboot = np; +			(void)sprintf(xxboot, "%s/%sboot", +				      _PATH_BOOTDIR, dkbasename); +			np += strlen(xxboot) + 1;  		}  #if NUMBOOT > 1  		if (!bootxx) { -			(void)sprintf(boot1, "%s/boot2", _PATH_BOOTDIR); -			bootxx = boot1; +			(void)sprintf(np, "%s/boot%s", +				      _PATH_BOOTDIR, dkbasename); +			if (access(np, F_OK) < 0 && dkbasename[0] == 'r') +				dkbasename++; +			bootxx = np; +			(void)sprintf(bootxx, "%s/boot%s", +				      _PATH_BOOTDIR, dkbasename); +			np += strlen(bootxx) + 1;  		}  #endif  	} | 
