diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-05-05 19:10:36 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-05-05 19:10:36 +0000 |
commit | 8bbb30772d659e098a7affbcc7186b3742ac390b (patch) | |
tree | d6bd11d1017d9620f59414ecb34a9dd2ab2a52d9 | |
parent | 26a12994911b71b41fa46e4f2ca5d28b31c6c4d3 (diff) |
Reserve the first cylinder for bootblock if NUMBOOT=1. Basically treat
it the same as the space we reserver on i386 to avoid fdisk trouncing.
The user can change this via the 'b' command and a message is printed
at startup to this effect.
-rw-r--r-- | sbin/disklabel/editor.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index c8d28074d22..5b2fbf69d5a 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.69 2000/04/04 16:29:27 millert Exp $ */ +/* $OpenBSD: editor.c,v 1.70 2000/05/05 19:10:35 millert Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -28,7 +28,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.69 2000/04/04 16:29:27 millert Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.70 2000/05/05 19:10:35 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -518,13 +518,6 @@ editor_add(lp, mp, freep, p) pp->p_fsize = 1024; pp->p_frag = 8; pp->p_cpg = 16; -#if NUMBOOT == 1 - /* Don't clobber boot blocks */ - if (pp->p_offset == 0) { - pp->p_offset = lp->d_secpercyl; - pp->p_size -= lp->d_secpercyl; - } -#endif old_offset = pp->p_offset; old_size = pp->p_size; @@ -1739,6 +1732,11 @@ find_bounds(lp, bios_lp) "disk.\nYou can use the 'b' command to change this.\n", starting_sector, ending_sector); } +#elif (NUMBOOT == 1) + /* Boot blocks take up the first cylinder */ + starting_sector = lp->d_secpercyl; + printf("\nReserving the first data cylinder for boot blocks.\n" + "You can use the 'b' command to change this.\n"); #endif } |