diff options
| -rw-r--r-- | block/partitions/msdos.c | 21 | ||||
| -rw-r--r-- | init/do_mounts.c | 4 |
2 files changed, 23 insertions, 2 deletions
diff --git a/block/partitions/msdos.c b/block/partitions/msdos.c index 5f79a6677c69..8752a5d26565 100644 --- a/block/partitions/msdos.c +++ b/block/partitions/msdos.c | |||
| @@ -94,6 +94,17 @@ static int aix_magic_present(struct parsed_partitions *state, unsigned char *p) | |||
| 94 | return ret; | 94 | return ret; |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | static void set_info(struct parsed_partitions *state, int slot, | ||
| 98 | u32 disksig) | ||
| 99 | { | ||
| 100 | struct partition_meta_info *info = &state->parts[slot].info; | ||
| 101 | |||
| 102 | snprintf(info->uuid, sizeof(info->uuid), "%08x-%02x", disksig, | ||
| 103 | slot); | ||
| 104 | info->volname[0] = 0; | ||
| 105 | state->parts[slot].has_info = true; | ||
| 106 | } | ||
| 107 | |||
| 97 | /* | 108 | /* |
| 98 | * Create devices for each logical partition in an extended partition. | 109 | * Create devices for each logical partition in an extended partition. |
| 99 | * The logical partitions form a linked list, with each entry being | 110 | * The logical partitions form a linked list, with each entry being |
| @@ -106,7 +117,8 @@ static int aix_magic_present(struct parsed_partitions *state, unsigned char *p) | |||
| 106 | */ | 117 | */ |
| 107 | 118 | ||
| 108 | static void parse_extended(struct parsed_partitions *state, | 119 | static void parse_extended(struct parsed_partitions *state, |
| 109 | sector_t first_sector, sector_t first_size) | 120 | sector_t first_sector, sector_t first_size, |
| 121 | u32 disksig) | ||
| 110 | { | 122 | { |
| 111 | struct partition *p; | 123 | struct partition *p; |
| 112 | Sector sect; | 124 | Sector sect; |
| @@ -166,6 +178,7 @@ static void parse_extended(struct parsed_partitions *state, | |||
| 166 | } | 178 | } |
| 167 | 179 | ||
| 168 | put_partition(state, state->next, next, size); | 180 | put_partition(state, state->next, next, size); |
| 181 | set_info(state, state->next, disksig); | ||
| 169 | if (SYS_IND(p) == LINUX_RAID_PARTITION) | 182 | if (SYS_IND(p) == LINUX_RAID_PARTITION) |
| 170 | state->parts[state->next].flags = ADDPART_FLAG_RAID; | 183 | state->parts[state->next].flags = ADDPART_FLAG_RAID; |
| 171 | loopct = 0; | 184 | loopct = 0; |
| @@ -437,6 +450,7 @@ int msdos_partition(struct parsed_partitions *state) | |||
| 437 | struct partition *p; | 450 | struct partition *p; |
| 438 | struct fat_boot_sector *fb; | 451 | struct fat_boot_sector *fb; |
| 439 | int slot; | 452 | int slot; |
| 453 | u32 disksig; | ||
| 440 | 454 | ||
| 441 | data = read_part_sector(state, 0, §); | 455 | data = read_part_sector(state, 0, §); |
| 442 | if (!data) | 456 | if (!data) |
| @@ -491,6 +505,8 @@ int msdos_partition(struct parsed_partitions *state) | |||
| 491 | #endif | 505 | #endif |
| 492 | p = (struct partition *) (data + 0x1be); | 506 | p = (struct partition *) (data + 0x1be); |
| 493 | 507 | ||
| 508 | disksig = le32_to_cpup((__le32 *)(data + 0x1b8)); | ||
| 509 | |||
| 494 | /* | 510 | /* |
| 495 | * Look for partitions in two passes: | 511 | * Look for partitions in two passes: |
| 496 | * First find the primary and DOS-type extended partitions. | 512 | * First find the primary and DOS-type extended partitions. |
| @@ -515,11 +531,12 @@ int msdos_partition(struct parsed_partitions *state) | |||
| 515 | put_partition(state, slot, start, n); | 531 | put_partition(state, slot, start, n); |
| 516 | 532 | ||
| 517 | strlcat(state->pp_buf, " <", PAGE_SIZE); | 533 | strlcat(state->pp_buf, " <", PAGE_SIZE); |
| 518 | parse_extended(state, start, size); | 534 | parse_extended(state, start, size, disksig); |
| 519 | strlcat(state->pp_buf, " >", PAGE_SIZE); | 535 | strlcat(state->pp_buf, " >", PAGE_SIZE); |
| 520 | continue; | 536 | continue; |
| 521 | } | 537 | } |
| 522 | put_partition(state, slot, start, size); | 538 | put_partition(state, slot, start, size); |
| 539 | set_info(state, slot, disksig); | ||
| 523 | if (SYS_IND(p) == LINUX_RAID_PARTITION) | 540 | if (SYS_IND(p) == LINUX_RAID_PARTITION) |
| 524 | state->parts[slot].flags = ADDPART_FLAG_RAID; | 541 | state->parts[slot].flags = ADDPART_FLAG_RAID; |
| 525 | if (SYS_IND(p) == DM6_PARTITION) | 542 | if (SYS_IND(p) == DM6_PARTITION) |
diff --git a/init/do_mounts.c b/init/do_mounts.c index c950d7c93f98..1d1b6348f903 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c | |||
| @@ -189,6 +189,10 @@ done: | |||
| 189 | * used when disk name of partitioned disk ends on a digit. | 189 | * used when disk name of partitioned disk ends on a digit. |
| 190 | * 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the | 190 | * 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the |
| 191 | * unique id of a partition if the partition table provides it. | 191 | * unique id of a partition if the partition table provides it. |
| 192 | * The UUID may be either an EFI/GPT UUID, or refer to an MSDOS | ||
| 193 | * partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero- | ||
| 194 | * filled hex representation of the 32-bit "NT disk signature", and PP | ||
| 195 | * is a zero-filled hex representation of the 1-based partition number. | ||
| 192 | * 7) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation to | 196 | * 7) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation to |
| 193 | * a partition with a known unique id. | 197 | * a partition with a known unique id. |
| 194 | * | 198 | * |
