Look for boot blocks in new default location.

This commit is contained in:
Jordan K. Hubbard 1998-12-17 16:50:10 +00:00
parent 630dc76f4e
commit efba76d7ff
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=41901
6 changed files with 36 additions and 72 deletions

View File

@ -33,7 +33,7 @@
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94 .\" @(#)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 .Dd April 19, 1994
.Dt DISKLABEL 8 .Dt DISKLABEL 8
@ -251,25 +251,19 @@ indicates the primary boot program and
the secondary boot program. the secondary boot program.
If the names are not explicitly given, standard boot programs will be used. If the names are not explicitly given, standard boot programs will be used.
The boot programs are located in The boot programs are located in
.Pa /usr/mdec . .Pa /boot .
The names of the programs are taken from the ``b0'' and ``b1'' parameters The names of the programs are taken from the ``b0'' and ``b1'' parameters
of the of the
.Xr disktab 5 .Xr disktab 5
entry for the disk if entry for the disk if
.Ar disktype .Ar disktype
was given and its disktab entry exists and includes those parameters. was given and its disktab entry exists and includes those parameters.
Otherwise, boot program names are derived from the name of the disk. Otherwise, the default boot image names are used, these being:
These names are of the form .Pa /boot/boot1
.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
and and
.Pa /usr/mdec/bootda .Pa /boot/boot2
if the disk device is for the standard stage1 and stage2 boot images (details may vary
.Em da0 . on architectures like the Alpha, where only a single-stage boot is used).
.Pp .Pp
The first of the three boot-installation forms is used to install The first of the three boot-installation forms is used to install
bootstrap code without changing the existing label. 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 .Sh FILES
.Bl -tag -width Pa -compact .Bl -tag -width Pa -compact
.It Pa /etc/disktab .It Pa /etc/disktab
.It Pa /usr/mdec/ Ns Em xx Ns boot .It Pa /boot/
.It Pa /usr/mdec/boot Ns Em xx .It Pa /boot/boot<n>
.El .El
.Sh EXAMPLES .Sh EXAMPLES
.Dl disklabel da0 .Dl disklabel da0
@ -318,9 +312,9 @@ Existing bootstrap code is unaffected.
.Pp .Pp
Install a new bootstrap on da0. Install a new bootstrap on da0.
The boot code comes from The boot code comes from
.Pa /usr/mdec/daboot .Pa /boot/boot1
and possibly and possibly
.Pa /usr/mdec/bootda . .Pa /boot/boot2 .
On-disk and in-core labels are unchanged. On-disk and in-core labels are unchanged.
.Pp .Pp
.Dl disklabel -w -B /dev/rda0c -b newboot da2212 .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 The label is derived from disktab information for ``da2212'' and
installed both in-core and on-disk. installed both in-core and on-disk.
The bootstrap code comes from the file The bootstrap code comes from the file
.Pa /usr/mdec/newboot . .Pa /boot/newboot .
.Sh SEE ALSO .Sh SEE ALSO
.Xr disklabel 5 , .Xr disklabel 5 ,
.Xr disktab 5 .Xr disktab 5

View File

@ -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"; */ /* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */
#endif #endif
static const char rcsid[] = 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 */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -595,25 +595,13 @@ makebootarea(boot, dp, f)
*np++ = '\0'; *np++ = '\0';
if (!xxboot) { if (!xxboot) {
(void)sprintf(np, "%s/%sboot", (void)sprintf(boot0, "%s/boot1", _PATH_BOOTDIR);
_PATH_BOOTDIR, dkbasename); xxboot = boot0;
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 NUMBOOT > 1
if (!bootxx) { if (!bootxx) {
(void)sprintf(np, "%s/boot%s", (void)sprintf(boot1, "%s/boot2", _PATH_BOOTDIR);
_PATH_BOOTDIR, dkbasename); bootxx = boot1;
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 #endif
} }

View File

@ -35,6 +35,6 @@
#include <paths.h> #include <paths.h>
#define _PATH_BOOTDIR "/usr/mdec" #define _PATH_BOOTDIR "/boot"
#undef _PATH_TMP #undef _PATH_TMP
#define _PATH_TMP "/tmp/EdDk.aXXXXXX" #define _PATH_TMP "/tmp/EdDk.aXXXXXX"

View File

@ -33,7 +33,7 @@
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94 .\" @(#)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 .Dd April 19, 1994
.Dt DISKLABEL 8 .Dt DISKLABEL 8
@ -251,25 +251,19 @@ indicates the primary boot program and
the secondary boot program. the secondary boot program.
If the names are not explicitly given, standard boot programs will be used. If the names are not explicitly given, standard boot programs will be used.
The boot programs are located in The boot programs are located in
.Pa /usr/mdec . .Pa /boot .
The names of the programs are taken from the ``b0'' and ``b1'' parameters The names of the programs are taken from the ``b0'' and ``b1'' parameters
of the of the
.Xr disktab 5 .Xr disktab 5
entry for the disk if entry for the disk if
.Ar disktype .Ar disktype
was given and its disktab entry exists and includes those parameters. was given and its disktab entry exists and includes those parameters.
Otherwise, boot program names are derived from the name of the disk. Otherwise, the default boot image names are used, these being:
These names are of the form .Pa /boot/boot1
.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
and and
.Pa /usr/mdec/bootda .Pa /boot/boot2
if the disk device is for the standard stage1 and stage2 boot images (details may vary
.Em da0 . on architectures like the Alpha, where only a single-stage boot is used).
.Pp .Pp
The first of the three boot-installation forms is used to install The first of the three boot-installation forms is used to install
bootstrap code without changing the existing label. 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 .Sh FILES
.Bl -tag -width Pa -compact .Bl -tag -width Pa -compact
.It Pa /etc/disktab .It Pa /etc/disktab
.It Pa /usr/mdec/ Ns Em xx Ns boot .It Pa /boot/
.It Pa /usr/mdec/boot Ns Em xx .It Pa /boot/boot<n>
.El .El
.Sh EXAMPLES .Sh EXAMPLES
.Dl disklabel da0 .Dl disklabel da0
@ -318,9 +312,9 @@ Existing bootstrap code is unaffected.
.Pp .Pp
Install a new bootstrap on da0. Install a new bootstrap on da0.
The boot code comes from The boot code comes from
.Pa /usr/mdec/daboot .Pa /boot/boot1
and possibly and possibly
.Pa /usr/mdec/bootda . .Pa /boot/boot2 .
On-disk and in-core labels are unchanged. On-disk and in-core labels are unchanged.
.Pp .Pp
.Dl disklabel -w -B /dev/rda0c -b newboot da2212 .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 The label is derived from disktab information for ``da2212'' and
installed both in-core and on-disk. installed both in-core and on-disk.
The bootstrap code comes from the file The bootstrap code comes from the file
.Pa /usr/mdec/newboot . .Pa /boot/newboot .
.Sh SEE ALSO .Sh SEE ALSO
.Xr disklabel 5 , .Xr disklabel 5 ,
.Xr disktab 5 .Xr disktab 5

View File

@ -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"; */ /* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */
#endif #endif
static const char rcsid[] = 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 */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -595,25 +595,13 @@ makebootarea(boot, dp, f)
*np++ = '\0'; *np++ = '\0';
if (!xxboot) { if (!xxboot) {
(void)sprintf(np, "%s/%sboot", (void)sprintf(boot0, "%s/boot1", _PATH_BOOTDIR);
_PATH_BOOTDIR, dkbasename); xxboot = boot0;
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 NUMBOOT > 1
if (!bootxx) { if (!bootxx) {
(void)sprintf(np, "%s/boot%s", (void)sprintf(boot1, "%s/boot2", _PATH_BOOTDIR);
_PATH_BOOTDIR, dkbasename); bootxx = boot1;
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 #endif
} }

View File

@ -35,6 +35,6 @@
#include <paths.h> #include <paths.h>
#define _PATH_BOOTDIR "/usr/mdec" #define _PATH_BOOTDIR "/boot"
#undef _PATH_TMP #undef _PATH_TMP
#define _PATH_TMP "/tmp/EdDk.aXXXXXX" #define _PATH_TMP "/tmp/EdDk.aXXXXXX"