When installing boot blocks into an Alpha BSD label, setup the location,
length, and flags fields at the end of the SRM boot sector so that SRM can find the bootstrap code. This fixes bsdlabel -m alpha to generate bootable disklabels. Reviewed by: phk
This commit is contained in:
parent
659dc72f99
commit
c8785325a6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127044
@ -327,6 +327,7 @@ readboot(void)
|
|||||||
{
|
{
|
||||||
int fd, i;
|
int fd, i;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
uint64_t *p;
|
||||||
|
|
||||||
if (xxboot == NULL)
|
if (xxboot == NULL)
|
||||||
xxboot = "/boot/boot";
|
xxboot = "/boot/boot";
|
||||||
@ -338,6 +339,15 @@ readboot(void)
|
|||||||
i = read(fd, bootarea + 512, st.st_size);
|
i = read(fd, bootarea + 512, st.st_size);
|
||||||
if (i != st.st_size)
|
if (i != st.st_size)
|
||||||
err(1, "read error %s", xxboot);
|
err(1, "read error %s", xxboot);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set the location and length so SRM can find the
|
||||||
|
* boot blocks.
|
||||||
|
*/
|
||||||
|
p = (uint64_t *)bootarea;
|
||||||
|
p[60] = (st.st_size + secsize - 1) / secsize;
|
||||||
|
p[61] = 1;
|
||||||
|
p[62] = 0;
|
||||||
return;
|
return;
|
||||||
} else if ((!alphacksum) && st.st_size <= BBSIZE) {
|
} else if ((!alphacksum) && st.st_size <= BBSIZE) {
|
||||||
i = read(fd, bootarea, st.st_size);
|
i = read(fd, bootarea, st.st_size);
|
||||||
|
Loading…
Reference in New Issue
Block a user