* include/grub/disk.h (grub_disk): Remove has_partitions.

All users updated.
	* disk/loopback.c (grub_loopback): Remove has_partitions.
	All users updated.
	(options): Remove partitions. All users updated.
	* util/grub-fstest.c (fstest): Don't pass "-p" to loopback.
	* util/i386/pc/grub-setup.c (setup): copy partition table only when
	actual partition table is found.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-09-13 23:59:22 +02:00
parent 3352800b99
commit 94564f81a8
21 changed files with 49 additions and 71 deletions

View file

@ -723,7 +723,6 @@ grub_ata_open (const char *name, grub_disk_t disk)
disk->id = (unsigned long) dev;
disk->has_partitions = 1;
disk->data = dev;
return 0;

View file

@ -514,16 +514,12 @@ grub_efidisk_open (const char *name, struct grub_disk *disk)
switch (name[0])
{
case 'f':
disk->has_partitions = 0;
d = get_device (fd_devices, num);
break;
case 'c':
/* FIXME: a CDROM should have partitions, but not implemented yet. */
disk->has_partitions = 0;
d = get_device (cd_devices, num);
break;
case 'h':
disk->has_partitions = 1;
d = get_device (hd_devices, num);
break;
default:

View file

@ -43,7 +43,6 @@ grub_host_open (const char *name, grub_disk_t disk)
disk->total_sectors = 0;
disk->id = (unsigned long) "host";
disk->has_partitions = 0;
disk->data = 0;
return GRUB_ERR_NONE;

View file

@ -327,7 +327,6 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
if (drive < 0)
return grub_errno;
disk->has_partitions = 1;
disk->id = drive;
data = (struct grub_biosdisk_data *) grub_zalloc (sizeof (*data));

View file

@ -113,7 +113,6 @@ grub_nand_open (const char *name, grub_disk_t disk)
disk->id = dev_ihandle;
disk->has_partitions = 0;
disk->data = data;
return 0;

View file

@ -256,8 +256,6 @@ grub_ofdisk_open (const char *name, grub_disk_t disk)
disk->data = op->devpath;
}
/* XXX: Read this, somehow. */
disk->has_partitions = 1;
return 0;
}

View file

@ -29,7 +29,6 @@ struct grub_loopback
{
char *devname;
grub_file_t file;
int has_partitions;
struct grub_loopback *next;
};
@ -38,7 +37,6 @@ static struct grub_loopback *loopback_list;
static const struct grub_arg_option options[] =
{
{"delete", 'd', 0, N_("Delete the loopback device entry."), 0, 0},
{"partitions", 'p', 0, N_("Simulate a hard drive with partitions."), 0, 0},
{0, 0, 0, 0, 0, 0}
};
@ -106,9 +104,6 @@ grub_cmd_loopback (grub_extcmd_context_t ctxt, int argc, char **args)
grub_file_close (newdev->file);
newdev->file = file;
/* Set has_partitions when `--partitions' was used. */
newdev->has_partitions = state[1].set;
return 0;
}
@ -126,9 +121,6 @@ grub_cmd_loopback (grub_extcmd_context_t ctxt, int argc, char **args)
newdev->file = file;
/* Set has_partitions when `--partitions' was used. */
newdev->has_partitions = state[1].set;
/* Add the new entry to the list. */
newdev->next = loopback_list;
loopback_list = newdev;
@ -174,7 +166,6 @@ grub_loopback_open (const char *name, grub_disk_t disk)
disk->total_sectors = GRUB_DISK_SIZE_UNKNOWN;
disk->id = (unsigned long) dev;
disk->has_partitions = dev->has_partitions;
disk->data = dev->file;
return 0;

View file

@ -150,7 +150,6 @@ grub_lvm_open (const char *name, grub_disk_t disk)
if (! lv)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown LVM device %s", name);
disk->has_partitions = 0;
disk->id = lv->number;
disk->data = lv;
disk->total_sectors = lv->size;
@ -280,7 +279,11 @@ grub_lvm_scan_device (const char *name)
disk = grub_disk_open (name);
if (!disk)
return 0;
{
if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
grub_errno = GRUB_ERR_NONE;
return 0;
}
/* Search for label. */
for (i = 0; i < GRUB_LVM_LABEL_SCAN_SECTORS; i++)
@ -725,6 +728,8 @@ grub_lvm_scan_device (const char *name)
grub_free (metadatabuf);
fail:
grub_disk_close (disk);
if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
grub_errno = GRUB_ERR_NONE;
return 0;
}

View file

@ -41,7 +41,6 @@ grub_memdisk_open (const char *name, grub_disk_t disk)
disk->total_sectors = memdisk_size / GRUB_DISK_SECTOR_SIZE;
disk->id = (unsigned long) "mdsk";
disk->has_partitions = 0;
return GRUB_ERR_NONE;
}

View file

@ -126,7 +126,6 @@ grub_raid_open (const char *name, grub_disk_t disk)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown RAID device %s",
name);
disk->has_partitions = 1;
disk->id = array->number;
disk->data = array;

View file

@ -431,12 +431,6 @@ grub_scsi_open (const char *name, grub_disk_t disk)
"unknown SCSI device");
}
if (scsi->devtype == grub_scsi_devtype_cdrom)
disk->has_partitions = 0;
else
disk->has_partitions = 1;
/* According to USB MS tests specification, issue Test Unit Ready
* until OK */
maxtime = grub_get_time_ms () + 5000; /* It is safer value */