summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-05-01 06:48:29 +0000
committerpeter <peter@FreeBSD.org>2002-05-01 06:48:29 +0000
commit6059c4954f62f6da3f3f461b41524c9c8038f609 (patch)
tree4a5eb74c34921807d3244ff9635574f8c909c48b /sbin
parent6b0c9026c6322f63603f8716a3da2bcf9ca230b6 (diff)
downloadFreeBSD-src-6059c4954f62f6da3f3f461b41524c9c8038f609.zip
FreeBSD-src-6059c4954f62f6da3f3f461b41524c9c8038f609.tar.gz
Add a hack so that fdisk(8) can initialize an ia64 disk. There is
no /boot/mbr to read the boot code from (ia64 does not *have* bootblocks!). fdisk depended on magic in the /boot/mbr file to initialize some fields.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fdisk/fdisk.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c
index 8564c27..cfbf085 100644
--- a/sbin/fdisk/fdisk.c
+++ b/sbin/fdisk/fdisk.c
@@ -472,6 +472,7 @@ print_part(int i)
static void
init_boot(void)
{
+#ifndef __ia64__
const char *fname;
int fdesc, n;
struct stat sb;
@@ -491,6 +492,15 @@ init_boot(void)
err(1, "%s", fname);
if (n != mboot.bootinst_size)
errx(1, "%s: short read", fname);
+#else
+ if (mboot.bootinst != NULL)
+ free(mboot.bootinst);
+ mboot.bootinst_size = secsize;
+ if ((mboot.bootinst = malloc(mboot.bootinst_size)) == NULL)
+ errx(1, "unable to allocate boot block buffer");
+ memset(mboot.bootinst, 0, mboot.bootinst_size);
+ *(uint16_t *)&mboot.bootinst[MBRSIGOFF] = BOOT_MAGIC;
+#endif
}
OpenPOWER on IntegriCloud