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.
This commit is contained in:
Peter Wemm 2002-05-01 06:48:29 +00:00
parent 0f56b10c4b
commit 29ea697d8a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95860

View File

@ -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
}