mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 10:19:26 +00:00
- Support MBR boot loaders that are larger than one sector size.
- Axe the 1024 cylinder checks as they are no longer relevant.
This commit is contained in:
parent
be0fdc4646
commit
fcb7c05133
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63031
@ -60,7 +60,9 @@ makedevs.c: Makefile rtermcap keymap.h
|
|||||||
>> makedevs.tmp
|
>> makedevs.tmp
|
||||||
.if ${MACHINE} == "i386"
|
.if ${MACHINE} == "i386"
|
||||||
file2c 'u_char boot0[] = {' '};' < /boot/boot0 >> makedevs.tmp
|
file2c 'u_char boot0[] = {' '};' < /boot/boot0 >> makedevs.tmp
|
||||||
|
echo "size_t boot0_size = sizeof(boot0);" >> makedevs.tmp
|
||||||
file2c 'u_char mbr[] = {' '};' < /boot/mbr >> makedevs.tmp
|
file2c 'u_char mbr[] = {' '};' < /boot/mbr >> makedevs.tmp
|
||||||
|
echo "size_t mbr_size = sizeof(mbr);" >> makedevs.tmp
|
||||||
.endif
|
.endif
|
||||||
mv makedevs.tmp makedevs.c
|
mv makedevs.tmp makedevs.c
|
||||||
|
|
||||||
|
@ -164,11 +164,12 @@ print_command_summary()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PC98
|
#ifndef PC98
|
||||||
static u_char *
|
static void
|
||||||
getBootMgr(char *dname)
|
getBootMgr(char *dname, u_char **bootCode, size_t *bootCodeSize)
|
||||||
{
|
{
|
||||||
#ifndef __alpha__ /* only meaningful on x86 */
|
#ifndef __alpha__ /* only meaningful on x86 */
|
||||||
extern u_char mbr[], boot0[];
|
extern u_char mbr[], boot0[];
|
||||||
|
extern size_t mbr_size, boot0_size;
|
||||||
char str[80];
|
char str[80];
|
||||||
char *cp;
|
char *cp;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -191,18 +192,21 @@ getBootMgr(char *dname)
|
|||||||
if (cp || i) {
|
if (cp || i) {
|
||||||
switch (BootMgr) {
|
switch (BootMgr) {
|
||||||
case 0:
|
case 0:
|
||||||
return boot0;
|
*bootCode = boot0;
|
||||||
|
*bootCodeSize = boot0_size;
|
||||||
|
return;
|
||||||
case 1:
|
case 1:
|
||||||
return mbr;
|
*bootCode = mbr;
|
||||||
|
*bootCodeSize = mbr_size;
|
||||||
|
return;
|
||||||
case 2:
|
case 2:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return NULL;
|
*bootCode = NULL;
|
||||||
|
*bootCodeSize = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -234,6 +238,7 @@ diskPartition(Device *dev)
|
|||||||
char *msg = NULL;
|
char *msg = NULL;
|
||||||
#ifndef PC98
|
#ifndef PC98
|
||||||
u_char *mbrContents;
|
u_char *mbrContents;
|
||||||
|
size_t mbrSize;
|
||||||
#endif
|
#endif
|
||||||
WINDOW *w = savescr();
|
WINDOW *w = savescr();
|
||||||
Disk *d = (Disk *)dev->private;
|
Disk *d = (Disk *)dev->private;
|
||||||
@ -511,10 +516,12 @@ diskPartition(Device *dev)
|
|||||||
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
|
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
|
||||||
*/
|
*/
|
||||||
if (((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)))
|
if (((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)))
|
||||||
mbrContents = getBootMgr(d->name);
|
getBootMgr(d->name, &mbrContents, &mbrSize);
|
||||||
else
|
else {
|
||||||
mbrContents = NULL;
|
mbrContents = NULL;
|
||||||
Set_Boot_Mgr(d, mbrContents);
|
mbrSize = 0;
|
||||||
|
}
|
||||||
|
Set_Boot_Mgr(d, mbrContents, mbrSize);
|
||||||
#endif /* !PC98 */
|
#endif /* !PC98 */
|
||||||
|
|
||||||
if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS)
|
if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS)
|
||||||
@ -548,17 +555,22 @@ diskPartition(Device *dev)
|
|||||||
* booteasy or a "standard" MBR -- both would be fatal in this case.
|
* booteasy or a "standard" MBR -- both would be fatal in this case.
|
||||||
*/
|
*/
|
||||||
#if 0
|
#if 0
|
||||||
if ((d->chunks->part->flags & CHUNK_FORCE_ALL) != CHUNK_FORCE_ALL
|
if ((d->chunks->part->flags & CHUNK_FORCE_ALL) != CHUNK_FORCE_ALL) {
|
||||||
&& (mbrContents = getBootMgr(d->name)) != NULL)
|
getBootMgr(d->name, &mbrContents, &mbrSize);
|
||||||
Set_Boot_Mgr(d, mbrContents);
|
if (mbrContents != NULL)
|
||||||
|
Set_Boot_Mgr(d, mbrContents, mbrSize);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* Don't offer to update the MBR on this disk if the first "real" chunk looks like
|
* Don't offer to update the MBR on this disk if the first "real" chunk looks like
|
||||||
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
|
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
|
||||||
*/
|
*/
|
||||||
if (((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)) &&
|
if ((d->chunks->part->type != freebsd) ||
|
||||||
(mbrContents = getBootMgr(d->name)) != NULL)
|
(d->chunks->part->offset > 1)) {
|
||||||
Set_Boot_Mgr(d, mbrContents);
|
getBootMgr(d->name, &mbrContents, &mbrSize);
|
||||||
|
if (mbrContents != NULL)
|
||||||
|
Set_Boot_Mgr(d, mbrContents, mbrSize);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* !PC98 */
|
#endif /* !PC98 */
|
||||||
break;
|
break;
|
||||||
@ -764,6 +776,7 @@ diskPartitionNonInteractive(Device *dev)
|
|||||||
int i, sz, all_disk = 0;
|
int i, sz, all_disk = 0;
|
||||||
#ifndef PC98
|
#ifndef PC98
|
||||||
u_char *mbrContents;
|
u_char *mbrContents;
|
||||||
|
size_t mbrSize;
|
||||||
#endif
|
#endif
|
||||||
Disk *d = (Disk *)dev->private;
|
Disk *d = (Disk *)dev->private;
|
||||||
|
|
||||||
@ -857,8 +870,8 @@ diskPartitionNonInteractive(Device *dev)
|
|||||||
}
|
}
|
||||||
#ifndef PC98
|
#ifndef PC98
|
||||||
if (!all_disk) {
|
if (!all_disk) {
|
||||||
mbrContents = getBootMgr(d->name);
|
getBootMgr(d->name, &mbrContents, &mbrSize);
|
||||||
Set_Boot_Mgr(d, mbrContents);
|
Set_Boot_Mgr(d, mbrContents, mbrSize);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
variable_set2(DISK_PARTITIONED, "yes", 0);
|
variable_set2(DISK_PARTITIONED, "yes", 0);
|
||||||
|
@ -969,15 +969,6 @@ diskLabel(Device *dev)
|
|||||||
clear_wins();
|
clear_wins();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((flags & CHUNK_IS_ROOT) && (tmp->flags & CHUNK_PAST_1024)) {
|
|
||||||
msgConfirm("This region cannot be used for your root partition as it starts\n"
|
|
||||||
"or extends past the 1024'th cylinder mark and is thus a\n"
|
|
||||||
"poor location to boot from. Please choose another\n"
|
|
||||||
"location (or smaller size) for your root partition and try again!");
|
|
||||||
Delete_Chunk(label_chunk_info[here].c->disk, tmp);
|
|
||||||
clear_wins();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (type != PART_SWAP) {
|
if (type != PART_SWAP) {
|
||||||
/* This is needed to tell the newfs -u about the size */
|
/* This is needed to tell the newfs -u about the size */
|
||||||
tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size);
|
tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size);
|
||||||
|
@ -60,7 +60,9 @@ makedevs.c: Makefile rtermcap keymap.h
|
|||||||
>> makedevs.tmp
|
>> makedevs.tmp
|
||||||
.if ${MACHINE} == "i386"
|
.if ${MACHINE} == "i386"
|
||||||
file2c 'u_char boot0[] = {' '};' < /boot/boot0 >> makedevs.tmp
|
file2c 'u_char boot0[] = {' '};' < /boot/boot0 >> makedevs.tmp
|
||||||
|
echo "size_t boot0_size = sizeof(boot0);" >> makedevs.tmp
|
||||||
file2c 'u_char mbr[] = {' '};' < /boot/mbr >> makedevs.tmp
|
file2c 'u_char mbr[] = {' '};' < /boot/mbr >> makedevs.tmp
|
||||||
|
echo "size_t mbr_size = sizeof(mbr);" >> makedevs.tmp
|
||||||
.endif
|
.endif
|
||||||
mv makedevs.tmp makedevs.c
|
mv makedevs.tmp makedevs.c
|
||||||
|
|
||||||
|
@ -164,11 +164,12 @@ print_command_summary()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PC98
|
#ifndef PC98
|
||||||
static u_char *
|
static void
|
||||||
getBootMgr(char *dname)
|
getBootMgr(char *dname, u_char **bootCode, size_t *bootCodeSize)
|
||||||
{
|
{
|
||||||
#ifndef __alpha__ /* only meaningful on x86 */
|
#ifndef __alpha__ /* only meaningful on x86 */
|
||||||
extern u_char mbr[], boot0[];
|
extern u_char mbr[], boot0[];
|
||||||
|
extern size_t mbr_size, boot0_size;
|
||||||
char str[80];
|
char str[80];
|
||||||
char *cp;
|
char *cp;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -191,18 +192,21 @@ getBootMgr(char *dname)
|
|||||||
if (cp || i) {
|
if (cp || i) {
|
||||||
switch (BootMgr) {
|
switch (BootMgr) {
|
||||||
case 0:
|
case 0:
|
||||||
return boot0;
|
*bootCode = boot0;
|
||||||
|
*bootCodeSize = boot0_size;
|
||||||
|
return;
|
||||||
case 1:
|
case 1:
|
||||||
return mbr;
|
*bootCode = mbr;
|
||||||
|
*bootCodeSize = mbr_size;
|
||||||
|
return;
|
||||||
case 2:
|
case 2:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return NULL;
|
*bootCode = NULL;
|
||||||
|
*bootCodeSize = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -234,6 +238,7 @@ diskPartition(Device *dev)
|
|||||||
char *msg = NULL;
|
char *msg = NULL;
|
||||||
#ifndef PC98
|
#ifndef PC98
|
||||||
u_char *mbrContents;
|
u_char *mbrContents;
|
||||||
|
size_t mbrSize;
|
||||||
#endif
|
#endif
|
||||||
WINDOW *w = savescr();
|
WINDOW *w = savescr();
|
||||||
Disk *d = (Disk *)dev->private;
|
Disk *d = (Disk *)dev->private;
|
||||||
@ -511,10 +516,12 @@ diskPartition(Device *dev)
|
|||||||
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
|
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
|
||||||
*/
|
*/
|
||||||
if (((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)))
|
if (((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)))
|
||||||
mbrContents = getBootMgr(d->name);
|
getBootMgr(d->name, &mbrContents, &mbrSize);
|
||||||
else
|
else {
|
||||||
mbrContents = NULL;
|
mbrContents = NULL;
|
||||||
Set_Boot_Mgr(d, mbrContents);
|
mbrSize = 0;
|
||||||
|
}
|
||||||
|
Set_Boot_Mgr(d, mbrContents, mbrSize);
|
||||||
#endif /* !PC98 */
|
#endif /* !PC98 */
|
||||||
|
|
||||||
if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS)
|
if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS)
|
||||||
@ -548,17 +555,22 @@ diskPartition(Device *dev)
|
|||||||
* booteasy or a "standard" MBR -- both would be fatal in this case.
|
* booteasy or a "standard" MBR -- both would be fatal in this case.
|
||||||
*/
|
*/
|
||||||
#if 0
|
#if 0
|
||||||
if ((d->chunks->part->flags & CHUNK_FORCE_ALL) != CHUNK_FORCE_ALL
|
if ((d->chunks->part->flags & CHUNK_FORCE_ALL) != CHUNK_FORCE_ALL) {
|
||||||
&& (mbrContents = getBootMgr(d->name)) != NULL)
|
getBootMgr(d->name, &mbrContents, &mbrSize);
|
||||||
Set_Boot_Mgr(d, mbrContents);
|
if (mbrContents != NULL)
|
||||||
|
Set_Boot_Mgr(d, mbrContents, mbrSize);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* Don't offer to update the MBR on this disk if the first "real" chunk looks like
|
* Don't offer to update the MBR on this disk if the first "real" chunk looks like
|
||||||
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
|
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
|
||||||
*/
|
*/
|
||||||
if (((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)) &&
|
if ((d->chunks->part->type != freebsd) ||
|
||||||
(mbrContents = getBootMgr(d->name)) != NULL)
|
(d->chunks->part->offset > 1)) {
|
||||||
Set_Boot_Mgr(d, mbrContents);
|
getBootMgr(d->name, &mbrContents, &mbrSize);
|
||||||
|
if (mbrContents != NULL)
|
||||||
|
Set_Boot_Mgr(d, mbrContents, mbrSize);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* !PC98 */
|
#endif /* !PC98 */
|
||||||
break;
|
break;
|
||||||
@ -764,6 +776,7 @@ diskPartitionNonInteractive(Device *dev)
|
|||||||
int i, sz, all_disk = 0;
|
int i, sz, all_disk = 0;
|
||||||
#ifndef PC98
|
#ifndef PC98
|
||||||
u_char *mbrContents;
|
u_char *mbrContents;
|
||||||
|
size_t mbrSize;
|
||||||
#endif
|
#endif
|
||||||
Disk *d = (Disk *)dev->private;
|
Disk *d = (Disk *)dev->private;
|
||||||
|
|
||||||
@ -857,8 +870,8 @@ diskPartitionNonInteractive(Device *dev)
|
|||||||
}
|
}
|
||||||
#ifndef PC98
|
#ifndef PC98
|
||||||
if (!all_disk) {
|
if (!all_disk) {
|
||||||
mbrContents = getBootMgr(d->name);
|
getBootMgr(d->name, &mbrContents, &mbrSize);
|
||||||
Set_Boot_Mgr(d, mbrContents);
|
Set_Boot_Mgr(d, mbrContents, mbrSize);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
variable_set2(DISK_PARTITIONED, "yes", 0);
|
variable_set2(DISK_PARTITIONED, "yes", 0);
|
||||||
|
@ -969,15 +969,6 @@ diskLabel(Device *dev)
|
|||||||
clear_wins();
|
clear_wins();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((flags & CHUNK_IS_ROOT) && (tmp->flags & CHUNK_PAST_1024)) {
|
|
||||||
msgConfirm("This region cannot be used for your root partition as it starts\n"
|
|
||||||
"or extends past the 1024'th cylinder mark and is thus a\n"
|
|
||||||
"poor location to boot from. Please choose another\n"
|
|
||||||
"location (or smaller size) for your root partition and try again!");
|
|
||||||
Delete_Chunk(label_chunk_info[here].c->disk, tmp);
|
|
||||||
clear_wins();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (type != PART_SWAP) {
|
if (type != PART_SWAP) {
|
||||||
/* This is needed to tell the newfs -u about the size */
|
/* This is needed to tell the newfs -u about the size */
|
||||||
tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size);
|
tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size);
|
||||||
|
@ -60,7 +60,9 @@ makedevs.c: Makefile rtermcap keymap.h
|
|||||||
>> makedevs.tmp
|
>> makedevs.tmp
|
||||||
.if ${MACHINE} == "i386"
|
.if ${MACHINE} == "i386"
|
||||||
file2c 'u_char boot0[] = {' '};' < /boot/boot0 >> makedevs.tmp
|
file2c 'u_char boot0[] = {' '};' < /boot/boot0 >> makedevs.tmp
|
||||||
|
echo "size_t boot0_size = sizeof(boot0);" >> makedevs.tmp
|
||||||
file2c 'u_char mbr[] = {' '};' < /boot/mbr >> makedevs.tmp
|
file2c 'u_char mbr[] = {' '};' < /boot/mbr >> makedevs.tmp
|
||||||
|
echo "size_t mbr_size = sizeof(mbr);" >> makedevs.tmp
|
||||||
.endif
|
.endif
|
||||||
mv makedevs.tmp makedevs.c
|
mv makedevs.tmp makedevs.c
|
||||||
|
|
||||||
|
@ -164,11 +164,12 @@ print_command_summary()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PC98
|
#ifndef PC98
|
||||||
static u_char *
|
static void
|
||||||
getBootMgr(char *dname)
|
getBootMgr(char *dname, u_char **bootCode, size_t *bootCodeSize)
|
||||||
{
|
{
|
||||||
#ifndef __alpha__ /* only meaningful on x86 */
|
#ifndef __alpha__ /* only meaningful on x86 */
|
||||||
extern u_char mbr[], boot0[];
|
extern u_char mbr[], boot0[];
|
||||||
|
extern size_t mbr_size, boot0_size;
|
||||||
char str[80];
|
char str[80];
|
||||||
char *cp;
|
char *cp;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -191,18 +192,21 @@ getBootMgr(char *dname)
|
|||||||
if (cp || i) {
|
if (cp || i) {
|
||||||
switch (BootMgr) {
|
switch (BootMgr) {
|
||||||
case 0:
|
case 0:
|
||||||
return boot0;
|
*bootCode = boot0;
|
||||||
|
*bootCodeSize = boot0_size;
|
||||||
|
return;
|
||||||
case 1:
|
case 1:
|
||||||
return mbr;
|
*bootCode = mbr;
|
||||||
|
*bootCodeSize = mbr_size;
|
||||||
|
return;
|
||||||
case 2:
|
case 2:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return NULL;
|
*bootCode = NULL;
|
||||||
|
*bootCodeSize = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -234,6 +238,7 @@ diskPartition(Device *dev)
|
|||||||
char *msg = NULL;
|
char *msg = NULL;
|
||||||
#ifndef PC98
|
#ifndef PC98
|
||||||
u_char *mbrContents;
|
u_char *mbrContents;
|
||||||
|
size_t mbrSize;
|
||||||
#endif
|
#endif
|
||||||
WINDOW *w = savescr();
|
WINDOW *w = savescr();
|
||||||
Disk *d = (Disk *)dev->private;
|
Disk *d = (Disk *)dev->private;
|
||||||
@ -511,10 +516,12 @@ diskPartition(Device *dev)
|
|||||||
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
|
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
|
||||||
*/
|
*/
|
||||||
if (((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)))
|
if (((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)))
|
||||||
mbrContents = getBootMgr(d->name);
|
getBootMgr(d->name, &mbrContents, &mbrSize);
|
||||||
else
|
else {
|
||||||
mbrContents = NULL;
|
mbrContents = NULL;
|
||||||
Set_Boot_Mgr(d, mbrContents);
|
mbrSize = 0;
|
||||||
|
}
|
||||||
|
Set_Boot_Mgr(d, mbrContents, mbrSize);
|
||||||
#endif /* !PC98 */
|
#endif /* !PC98 */
|
||||||
|
|
||||||
if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS)
|
if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS)
|
||||||
@ -548,17 +555,22 @@ diskPartition(Device *dev)
|
|||||||
* booteasy or a "standard" MBR -- both would be fatal in this case.
|
* booteasy or a "standard" MBR -- both would be fatal in this case.
|
||||||
*/
|
*/
|
||||||
#if 0
|
#if 0
|
||||||
if ((d->chunks->part->flags & CHUNK_FORCE_ALL) != CHUNK_FORCE_ALL
|
if ((d->chunks->part->flags & CHUNK_FORCE_ALL) != CHUNK_FORCE_ALL) {
|
||||||
&& (mbrContents = getBootMgr(d->name)) != NULL)
|
getBootMgr(d->name, &mbrContents, &mbrSize);
|
||||||
Set_Boot_Mgr(d, mbrContents);
|
if (mbrContents != NULL)
|
||||||
|
Set_Boot_Mgr(d, mbrContents, mbrSize);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* Don't offer to update the MBR on this disk if the first "real" chunk looks like
|
* Don't offer to update the MBR on this disk if the first "real" chunk looks like
|
||||||
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
|
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
|
||||||
*/
|
*/
|
||||||
if (((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)) &&
|
if ((d->chunks->part->type != freebsd) ||
|
||||||
(mbrContents = getBootMgr(d->name)) != NULL)
|
(d->chunks->part->offset > 1)) {
|
||||||
Set_Boot_Mgr(d, mbrContents);
|
getBootMgr(d->name, &mbrContents, &mbrSize);
|
||||||
|
if (mbrContents != NULL)
|
||||||
|
Set_Boot_Mgr(d, mbrContents, mbrSize);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* !PC98 */
|
#endif /* !PC98 */
|
||||||
break;
|
break;
|
||||||
@ -764,6 +776,7 @@ diskPartitionNonInteractive(Device *dev)
|
|||||||
int i, sz, all_disk = 0;
|
int i, sz, all_disk = 0;
|
||||||
#ifndef PC98
|
#ifndef PC98
|
||||||
u_char *mbrContents;
|
u_char *mbrContents;
|
||||||
|
size_t mbrSize;
|
||||||
#endif
|
#endif
|
||||||
Disk *d = (Disk *)dev->private;
|
Disk *d = (Disk *)dev->private;
|
||||||
|
|
||||||
@ -857,8 +870,8 @@ diskPartitionNonInteractive(Device *dev)
|
|||||||
}
|
}
|
||||||
#ifndef PC98
|
#ifndef PC98
|
||||||
if (!all_disk) {
|
if (!all_disk) {
|
||||||
mbrContents = getBootMgr(d->name);
|
getBootMgr(d->name, &mbrContents, &mbrSize);
|
||||||
Set_Boot_Mgr(d, mbrContents);
|
Set_Boot_Mgr(d, mbrContents, mbrSize);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
variable_set2(DISK_PARTITIONED, "yes", 0);
|
variable_set2(DISK_PARTITIONED, "yes", 0);
|
||||||
|
@ -969,15 +969,6 @@ diskLabel(Device *dev)
|
|||||||
clear_wins();
|
clear_wins();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((flags & CHUNK_IS_ROOT) && (tmp->flags & CHUNK_PAST_1024)) {
|
|
||||||
msgConfirm("This region cannot be used for your root partition as it starts\n"
|
|
||||||
"or extends past the 1024'th cylinder mark and is thus a\n"
|
|
||||||
"poor location to boot from. Please choose another\n"
|
|
||||||
"location (or smaller size) for your root partition and try again!");
|
|
||||||
Delete_Chunk(label_chunk_info[here].c->disk, tmp);
|
|
||||||
clear_wins();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (type != PART_SWAP) {
|
if (type != PART_SWAP) {
|
||||||
/* This is needed to tell the newfs -u about the size */
|
/* This is needed to tell the newfs -u about the size */
|
||||||
tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size);
|
tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size);
|
||||||
|
Loading…
Reference in New Issue
Block a user