summaryrefslogtreecommitdiffstats
path: root/sbin/bsdlabel
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2004-03-15 23:10:34 +0000
committerjhb <jhb@FreeBSD.org>2004-03-15 23:10:34 +0000
commit5670428480819d6b4dc534f51a1cf1be95fe9d23 (patch)
tree0377ac8eef436c81d91f5f1ff64bd93feca52b63 /sbin/bsdlabel
parent216c5338ff83f75176a9b67a37c2ea2b1e6ed543 (diff)
downloadFreeBSD-src-5670428480819d6b4dc534f51a1cf1be95fe9d23.zip
FreeBSD-src-5670428480819d6b4dc534f51a1cf1be95fe9d23.tar.gz
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
Diffstat (limited to 'sbin/bsdlabel')
-rw-r--r--sbin/bsdlabel/bsdlabel.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index 094e84a..8ad7def 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -327,6 +327,7 @@ readboot(void)
{
int fd, i;
struct stat st;
+ uint64_t *p;
if (xxboot == NULL)
xxboot = "/boot/boot";
@@ -338,6 +339,15 @@ readboot(void)
i = read(fd, bootarea + 512, st.st_size);
if (i != st.st_size)
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;
} else if ((!alphacksum) && st.st_size <= BBSIZE) {
i = read(fd, bootarea, st.st_size);
OpenPOWER on IntegriCloud