Also test for type efi everywhere we currently test for type fat.

With this change there's no a priori difference between EFI and
FAT partitions. With this change and the corresponding change to
libdisk, we can create EFI partitions, just like regular FAT
partitions.
This commit is contained in:
marcel 2002-11-13 05:39:59 +00:00
parent c02d224c79
commit f76e12575f
10 changed files with 22 additions and 12 deletions

View File

@ -113,7 +113,7 @@ mount_point(Chunk *c1)
{
if (c1->type == part && c1->subtype == FS_SWAP)
return "none";
else if (c1->type == part || c1->type == fat)
else if (c1->type == part || c1->type == fat || c1->type == efi)
return ((PartInfo *)c1->private_data)->mountpoint;
return "/bogus";
}
@ -121,7 +121,7 @@ mount_point(Chunk *c1)
static char *
fstype(Chunk *c1)
{
if (c1->type == fat)
if (c1->type == fat || c1->type == efi)
return "msdosfs";
else if (c1->type == part) {
if (c1->subtype != FS_SWAP)
@ -151,6 +151,9 @@ fstype_short(Chunk *c1)
else
return "ro";
}
else if (c1->type == efi)
return "rw";
return "bog";
}
@ -208,7 +211,7 @@ configFstab(dialogMenuItem *self)
chunk_list[nchunks++] = c2;
}
}
else if (c1->type == fat && c1->private_data)
else if ((c1->type == fat || c1->type == efi) && c1->private_data)
chunk_list[nchunks++] = c1;
}
}

View File

@ -460,7 +460,7 @@ skipif:
/* Look for existing DOS partitions to register as "DOS media devices" */
for (c1 = d->chunks->part; c1; c1 = c1->next) {
if (c1->type == fat || c1->type == extended) {
if (c1->type == fat || c1->type == efi || c1->type == extended) {
Device *dev;
char devname[80];

View File

@ -508,6 +508,8 @@ diskPartition(Device *dev)
partitiontype = freebsd;
else if (subtype == SUBTYPE_FAT)
partitiontype = fat;
else if (subtype == SUBTYPE_EFI)
partitiontype = efi;
else
partitiontype = unknown;
chunk_info[current_chunk]->type = partitiontype;

View File

@ -1038,7 +1038,7 @@ installFilesystems(dialogMenuItem *self)
}
}
}
else if (c1->type == fat && c1->private_data && (root->newfs || upgrade)) {
else if ((c1->type == fat || c1->type == efi) && c1->private_data && (root->newfs || upgrade)) {
char name[FILENAME_MAX];
sprintf(name, "%s/%s", RunningAsInit ? "/mnt" : "", ((PartInfo *)c1->private_data)->mountpoint);

View File

@ -305,7 +305,7 @@ record_label_chunks(Device **devs, Device *dev)
}
}
}
else if (c1->type == fat) {
else if (c1->type == fat || c1->type == efi) {
label_chunk_info[j].type = PART_FAT;
label_chunk_info[j].c = c1;
++j;

View File

@ -113,7 +113,7 @@ mount_point(Chunk *c1)
{
if (c1->type == part && c1->subtype == FS_SWAP)
return "none";
else if (c1->type == part || c1->type == fat)
else if (c1->type == part || c1->type == fat || c1->type == efi)
return ((PartInfo *)c1->private_data)->mountpoint;
return "/bogus";
}
@ -121,7 +121,7 @@ mount_point(Chunk *c1)
static char *
fstype(Chunk *c1)
{
if (c1->type == fat)
if (c1->type == fat || c1->type == efi)
return "msdosfs";
else if (c1->type == part) {
if (c1->subtype != FS_SWAP)
@ -151,6 +151,9 @@ fstype_short(Chunk *c1)
else
return "ro";
}
else if (c1->type == efi)
return "rw";
return "bog";
}
@ -208,7 +211,7 @@ configFstab(dialogMenuItem *self)
chunk_list[nchunks++] = c2;
}
}
else if (c1->type == fat && c1->private_data)
else if ((c1->type == fat || c1->type == efi) && c1->private_data)
chunk_list[nchunks++] = c1;
}
}

View File

@ -460,7 +460,7 @@ skipif:
/* Look for existing DOS partitions to register as "DOS media devices" */
for (c1 = d->chunks->part; c1; c1 = c1->next) {
if (c1->type == fat || c1->type == extended) {
if (c1->type == fat || c1->type == efi || c1->type == extended) {
Device *dev;
char devname[80];

View File

@ -508,6 +508,8 @@ diskPartition(Device *dev)
partitiontype = freebsd;
else if (subtype == SUBTYPE_FAT)
partitiontype = fat;
else if (subtype == SUBTYPE_EFI)
partitiontype = efi;
else
partitiontype = unknown;
chunk_info[current_chunk]->type = partitiontype;

View File

@ -1038,7 +1038,7 @@ installFilesystems(dialogMenuItem *self)
}
}
}
else if (c1->type == fat && c1->private_data && (root->newfs || upgrade)) {
else if ((c1->type == fat || c1->type == efi) && c1->private_data && (root->newfs || upgrade)) {
char name[FILENAME_MAX];
sprintf(name, "%s/%s", RunningAsInit ? "/mnt" : "", ((PartInfo *)c1->private_data)->mountpoint);

View File

@ -305,7 +305,7 @@ record_label_chunks(Device **devs, Device *dev)
}
}
}
else if (c1->type == fat) {
else if (c1->type == fat || c1->type == efi) {
label_chunk_info[j].type = PART_FAT;
label_chunk_info[j].c = c1;
++j;