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:
parent
6b0c9026c6
commit
6059c4954f
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user