Line 439... |
Line 439... |
* Now that the 55aa signature is present, this is probably
|
* Now that the 55aa signature is present, this is probably
|
* either the boot sector of a FAT filesystem or a DOS-type
|
* either the boot sector of a FAT filesystem or a DOS-type
|
* partition table. Reject this in case the boot indicator
|
* partition table. Reject this in case the boot indicator
|
* is not 0 or 0x80.
|
* is not 0 or 0x80.
|
*/
|
*/
|
|
|
p = (struct partition *) (data + 0x1be);
|
p = (struct partition *) (data + 0x1be);
|
|
|
for (slot = 1; slot <= 4; slot++, p++) {
|
for (slot = 1; slot <= 4; slot++, p++) {
|
|
|
if (p->boot_ind != 0 && p->boot_ind != 0x80) {
|
if (p->boot_ind != 0 && p->boot_ind != 0x80) {
|
put_dev_sector(sect);
|
put_dev_sector(sect);
|
return 0;
|
return 0;
|
}
|
}
|
}
|
}
|
Line 466... |
Line 469... |
* First find the primary and DOS-type extended partitions.
|
* First find the primary and DOS-type extended partitions.
|
* On the second pass look inside *BSD, Unixware and Solaris partitions.
|
* On the second pass look inside *BSD, Unixware and Solaris partitions.
|
*/
|
*/
|
|
|
state->next = 5;
|
state->next = 5;
|
|
|
for (slot = 1 ; slot <= 4 ; slot++, p++) {
|
for (slot = 1 ; slot <= 4 ; slot++, p++) {
|
u32 start = START_SECT(p)*sector_size;
|
u32 start = START_SECT(p)*sector_size;
|
u32 size = NR_SECTS(p)*sector_size;
|
u32 size = NR_SECTS(p)*sector_size;
|
|
|
if (!size)
|
if (!size)
|
continue;
|
continue;
|
if (is_extended_partition(p)) {
|
if (is_extended_partition(p)) {
|
|
|
/* prevent someone doing mkfs or mkswap on an
|
/* prevent someone doing mkfs or mkswap on an
|
extended partition, but leave room for LILO */
|
extended partition, but leave room for LILO */
|
put_partition(state, slot, start, size == 1 ? 1 : 2);
|
put_partition(state, slot, start, size == 1 ? 1 : 2);
|
printk(" <");
|
printk(" <");
|
parse_extended(state, bdev, start, size);
|
parse_extended(state, bdev, start, size);
|
printk(" >");
|
printk(" >");
|
continue;
|
continue;
|
|
|
}
|
}
|
|
printk( "I");
|
put_partition(state, slot, start, size);
|
put_partition(state, slot, start, size);
|
if (SYS_IND(p) == LINUX_RAID_PARTITION)
|
if (SYS_IND(p) == LINUX_RAID_PARTITION)
|
state->parts[slot].flags = 1;
|
state->parts[slot].flags = 1;
|
if (SYS_IND(p) == DM6_PARTITION)
|
if (SYS_IND(p) == DM6_PARTITION)
|
printk("[DM]");
|
printk("[DM]");
|
if (SYS_IND(p) == EZD_PARTITION)
|
if (SYS_IND(p) == EZD_PARTITION)
|
printk("[EZD]");
|
printk("[EZD]");
|
}
|
}
|
|
|
printk("\n");
|
|
|
|
/* second pass - output for each on a separate line */
|
/* second pass - output for each on a separate line */
|
p = (struct partition *) (0x1be + data);
|
p = (struct partition *) (0x1be + data);
|
for (slot = 1 ; slot <= 4 ; slot++, p++) {
|
for (slot = 1 ; slot <= 4 ; slot++, p++) {
|
unsigned char id = SYS_IND(p);
|
unsigned char id = SYS_IND(p);
|
int n;
|
int n;
|
|
|
if (!NR_SECTS(p))
|
if (!NR_SECTS(p))
|
continue;
|
continue;
|
|
|
for (n = 0; subtypes[n].parse && id != subtypes[n].id; n++)
|
for (n = 0; subtypes[n].parse && id != subtypes[n].id; n++)
|
;
|
;
|
|
|
if (!subtypes[n].parse)
|
if (!subtypes[n].parse)
|
continue;
|
continue;
|