From efba76d7ff3e88a334aa782e1a7ef27d1da6c808 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Thu, 17 Dec 1998 16:50:10 +0000 Subject: [PATCH] Look for boot blocks in new default location. --- sbin/bsdlabel/bsdlabel.8 | 30 ++++++++++++------------------ sbin/bsdlabel/bsdlabel.c | 22 +++++----------------- sbin/bsdlabel/pathnames.h | 2 +- sbin/disklabel/disklabel.8 | 30 ++++++++++++------------------ sbin/disklabel/disklabel.c | 22 +++++----------------- sbin/disklabel/pathnames.h | 2 +- 6 files changed, 36 insertions(+), 72 deletions(-) diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8 index 94426b42c256..9dfca468e1dd 100644 --- a/sbin/bsdlabel/bsdlabel.8 +++ b/sbin/bsdlabel/bsdlabel.8 @@ -33,7 +33,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94 -.\" $Id: disklabel.8,v 1.8 1998/06/04 06:49:13 charnier Exp $ +.\" $Id: disklabel.8,v 1.9 1998/11/28 09:43:31 rnordier Exp $ .\" .Dd April 19, 1994 .Dt DISKLABEL 8 @@ -251,25 +251,19 @@ indicates the primary boot program and the secondary boot program. If the names are not explicitly given, standard boot programs will be used. The boot programs are located in -.Pa /usr/mdec . +.Pa /boot . The names of the programs are taken from the ``b0'' and ``b1'' parameters of the .Xr disktab 5 entry for the disk if .Ar disktype was given and its disktab entry exists and includes those parameters. -Otherwise, boot program names are derived from the name of the disk. -These names are of the form -.Pa basename Ns boot -for the primary (or only) bootstrap, and -.Pf boot Pa basename -for the secondary bootstrap; -for example, -.Pa /usr/mdec/daboot +Otherwise, the default boot image names are used, these being: +.Pa /boot/boot1 and -.Pa /usr/mdec/bootda -if the disk device is -.Em da0 . +.Pa /boot/boot2 +for the standard stage1 and stage2 boot images (details may vary +on architectures like the Alpha, where only a single-stage boot is used). .Pp The first of the three boot-installation forms is used to install bootstrap code without changing the existing label. @@ -281,8 +275,8 @@ except that they will install bootstrap code in addition to a new label. .Sh FILES .Bl -tag -width Pa -compact .It Pa /etc/disktab -.It Pa /usr/mdec/ Ns Em xx Ns boot -.It Pa /usr/mdec/boot Ns Em xx +.It Pa /boot/ +.It Pa /boot/boot .El .Sh EXAMPLES .Dl disklabel da0 @@ -318,9 +312,9 @@ Existing bootstrap code is unaffected. .Pp Install a new bootstrap on da0. The boot code comes from -.Pa /usr/mdec/daboot +.Pa /boot/boot1 and possibly -.Pa /usr/mdec/bootda . +.Pa /boot/boot2 . On-disk and in-core labels are unchanged. .Pp .Dl disklabel -w -B /dev/rda0c -b newboot da2212 @@ -329,7 +323,7 @@ Install a new label and bootstrap. The label is derived from disktab information for ``da2212'' and installed both in-core and on-disk. The bootstrap code comes from the file -.Pa /usr/mdec/newboot . +.Pa /boot/newboot . .Sh SEE ALSO .Xr disklabel 5 , .Xr disktab 5 diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index bf18a3753e21..ff04e4b9d17c 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.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.22 1998/10/17 09:56:32 bde Exp $"; + "$Id: disklabel.c,v 1.23 1998/10/23 18:57:39 bde Exp $"; #endif /* not lint */ #include @@ -595,25 +595,13 @@ makebootarea(boot, dp, f) *np++ = '\0'; if (!xxboot) { - (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; + (void)sprintf(boot0, "%s/boot1", _PATH_BOOTDIR); + xxboot = boot0; } #if NUMBOOT > 1 if (!bootxx) { - (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; + (void)sprintf(boot1, "%s/boot2", _PATH_BOOTDIR); + bootxx = boot1; } #endif } diff --git a/sbin/bsdlabel/pathnames.h b/sbin/bsdlabel/pathnames.h index def3297d205e..a24bdefe68d1 100644 --- a/sbin/bsdlabel/pathnames.h +++ b/sbin/bsdlabel/pathnames.h @@ -35,6 +35,6 @@ #include -#define _PATH_BOOTDIR "/usr/mdec" +#define _PATH_BOOTDIR "/boot" #undef _PATH_TMP #define _PATH_TMP "/tmp/EdDk.aXXXXXX" diff --git a/sbin/disklabel/disklabel.8 b/sbin/disklabel/disklabel.8 index 94426b42c256..9dfca468e1dd 100644 --- a/sbin/disklabel/disklabel.8 +++ b/sbin/disklabel/disklabel.8 @@ -33,7 +33,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94 -.\" $Id: disklabel.8,v 1.8 1998/06/04 06:49:13 charnier Exp $ +.\" $Id: disklabel.8,v 1.9 1998/11/28 09:43:31 rnordier Exp $ .\" .Dd April 19, 1994 .Dt DISKLABEL 8 @@ -251,25 +251,19 @@ indicates the primary boot program and the secondary boot program. If the names are not explicitly given, standard boot programs will be used. The boot programs are located in -.Pa /usr/mdec . +.Pa /boot . The names of the programs are taken from the ``b0'' and ``b1'' parameters of the .Xr disktab 5 entry for the disk if .Ar disktype was given and its disktab entry exists and includes those parameters. -Otherwise, boot program names are derived from the name of the disk. -These names are of the form -.Pa basename Ns boot -for the primary (or only) bootstrap, and -.Pf boot Pa basename -for the secondary bootstrap; -for example, -.Pa /usr/mdec/daboot +Otherwise, the default boot image names are used, these being: +.Pa /boot/boot1 and -.Pa /usr/mdec/bootda -if the disk device is -.Em da0 . +.Pa /boot/boot2 +for the standard stage1 and stage2 boot images (details may vary +on architectures like the Alpha, where only a single-stage boot is used). .Pp The first of the three boot-installation forms is used to install bootstrap code without changing the existing label. @@ -281,8 +275,8 @@ except that they will install bootstrap code in addition to a new label. .Sh FILES .Bl -tag -width Pa -compact .It Pa /etc/disktab -.It Pa /usr/mdec/ Ns Em xx Ns boot -.It Pa /usr/mdec/boot Ns Em xx +.It Pa /boot/ +.It Pa /boot/boot .El .Sh EXAMPLES .Dl disklabel da0 @@ -318,9 +312,9 @@ Existing bootstrap code is unaffected. .Pp Install a new bootstrap on da0. The boot code comes from -.Pa /usr/mdec/daboot +.Pa /boot/boot1 and possibly -.Pa /usr/mdec/bootda . +.Pa /boot/boot2 . On-disk and in-core labels are unchanged. .Pp .Dl disklabel -w -B /dev/rda0c -b newboot da2212 @@ -329,7 +323,7 @@ Install a new label and bootstrap. The label is derived from disktab information for ``da2212'' and installed both in-core and on-disk. The bootstrap code comes from the file -.Pa /usr/mdec/newboot . +.Pa /boot/newboot . .Sh SEE ALSO .Xr disklabel 5 , .Xr disktab 5 diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index bf18a3753e21..ff04e4b9d17c 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.22 1998/10/17 09:56:32 bde Exp $"; + "$Id: disklabel.c,v 1.23 1998/10/23 18:57:39 bde Exp $"; #endif /* not lint */ #include @@ -595,25 +595,13 @@ makebootarea(boot, dp, f) *np++ = '\0'; if (!xxboot) { - (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; + (void)sprintf(boot0, "%s/boot1", _PATH_BOOTDIR); + xxboot = boot0; } #if NUMBOOT > 1 if (!bootxx) { - (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; + (void)sprintf(boot1, "%s/boot2", _PATH_BOOTDIR); + bootxx = boot1; } #endif } diff --git a/sbin/disklabel/pathnames.h b/sbin/disklabel/pathnames.h index def3297d205e..a24bdefe68d1 100644 --- a/sbin/disklabel/pathnames.h +++ b/sbin/disklabel/pathnames.h @@ -35,6 +35,6 @@ #include -#define _PATH_BOOTDIR "/usr/mdec" +#define _PATH_BOOTDIR "/boot" #undef _PATH_TMP #define _PATH_TMP "/tmp/EdDk.aXXXXXX"