|
@@ -213,10 +213,18 @@ static void parse_solaris_x86(struct parsed_partitions *state,
|
|
put_dev_sector(sect);
|
|
put_dev_sector(sect);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- printk(" %s%d: <solaris:", state->name, origin);
|
|
|
|
|
|
+ {
|
|
|
|
+ char tmp[1 + BDEVNAME_SIZE + 10 + 11 + 1];
|
|
|
|
+
|
|
|
|
+ snprintf(tmp, sizeof(tmp), " %s%d: <solaris:", state->name, origin);
|
|
|
|
+ strlcat(state->pp_buf, tmp, PAGE_SIZE);
|
|
|
|
+ }
|
|
if (le32_to_cpu(v->v_version) != 1) {
|
|
if (le32_to_cpu(v->v_version) != 1) {
|
|
- printk(" cannot handle version %d vtoc>\n",
|
|
|
|
- le32_to_cpu(v->v_version));
|
|
|
|
|
|
+ char tmp[64];
|
|
|
|
+
|
|
|
|
+ snprintf(tmp, sizeof(tmp), " cannot handle version %d vtoc>\n",
|
|
|
|
+ le32_to_cpu(v->v_version));
|
|
|
|
+ strlcat(state->pp_buf, tmp, PAGE_SIZE);
|
|
put_dev_sector(sect);
|
|
put_dev_sector(sect);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -224,9 +232,12 @@ static void parse_solaris_x86(struct parsed_partitions *state,
|
|
max_nparts = le16_to_cpu (v->v_nparts) > 8 ? SOLARIS_X86_NUMSLICE : 8;
|
|
max_nparts = le16_to_cpu (v->v_nparts) > 8 ? SOLARIS_X86_NUMSLICE : 8;
|
|
for (i=0; i<max_nparts && state->next<state->limit; i++) {
|
|
for (i=0; i<max_nparts && state->next<state->limit; i++) {
|
|
struct solaris_x86_slice *s = &v->v_slice[i];
|
|
struct solaris_x86_slice *s = &v->v_slice[i];
|
|
|
|
+ char tmp[3 + 10 + 1 + 1];
|
|
|
|
+
|
|
if (s->s_size == 0)
|
|
if (s->s_size == 0)
|
|
continue;
|
|
continue;
|
|
- printk(" [s%d]", i);
|
|
|
|
|
|
+ snprintf(tmp, sizeof(tmp), " [s%d]", i);
|
|
|
|
+ strlcat(state->pp_buf, tmp, PAGE_SIZE);
|
|
/* solaris partitions are relative to current MS-DOS
|
|
/* solaris partitions are relative to current MS-DOS
|
|
* one; must add the offset of the current partition */
|
|
* one; must add the offset of the current partition */
|
|
put_partition(state, state->next++,
|
|
put_partition(state, state->next++,
|
|
@@ -234,7 +245,7 @@ static void parse_solaris_x86(struct parsed_partitions *state,
|
|
le32_to_cpu(s->s_size));
|
|
le32_to_cpu(s->s_size));
|
|
}
|
|
}
|
|
put_dev_sector(sect);
|
|
put_dev_sector(sect);
|
|
- printk(" >\n");
|
|
|
|
|
|
+ strlcat(state->pp_buf, " >\n", PAGE_SIZE);
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|
|
@@ -250,6 +261,7 @@ static void parse_bsd(struct parsed_partitions *state,
|
|
Sector sect;
|
|
Sector sect;
|
|
struct bsd_disklabel *l;
|
|
struct bsd_disklabel *l;
|
|
struct bsd_partition *p;
|
|
struct bsd_partition *p;
|
|
|
|
+ char tmp[64];
|
|
|
|
|
|
l = read_part_sector(state, offset + 1, §);
|
|
l = read_part_sector(state, offset + 1, §);
|
|
if (!l)
|
|
if (!l)
|
|
@@ -258,7 +270,9 @@ static void parse_bsd(struct parsed_partitions *state,
|
|
put_dev_sector(sect);
|
|
put_dev_sector(sect);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- printk(" %s%d: <%s:", state->name, origin, flavour);
|
|
|
|
|
|
+
|
|
|
|
+ snprintf(tmp, sizeof(tmp), " %s%d: <%s:", state->name, origin, flavour);
|
|
|
|
+ strlcat(state->pp_buf, tmp, PAGE_SIZE);
|
|
|
|
|
|
if (le16_to_cpu(l->d_npartitions) < max_partitions)
|
|
if (le16_to_cpu(l->d_npartitions) < max_partitions)
|
|
max_partitions = le16_to_cpu(l->d_npartitions);
|
|
max_partitions = le16_to_cpu(l->d_npartitions);
|
|
@@ -275,16 +289,18 @@ static void parse_bsd(struct parsed_partitions *state,
|
|
/* full parent partition, we have it already */
|
|
/* full parent partition, we have it already */
|
|
continue;
|
|
continue;
|
|
if (offset > bsd_start || offset+size < bsd_start+bsd_size) {
|
|
if (offset > bsd_start || offset+size < bsd_start+bsd_size) {
|
|
- printk("bad subpartition - ignored\n");
|
|
|
|
|
|
+ strlcat(state->pp_buf, "bad subpartition - ignored\n", PAGE_SIZE);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
put_partition(state, state->next++, bsd_start, bsd_size);
|
|
put_partition(state, state->next++, bsd_start, bsd_size);
|
|
}
|
|
}
|
|
put_dev_sector(sect);
|
|
put_dev_sector(sect);
|
|
- if (le16_to_cpu(l->d_npartitions) > max_partitions)
|
|
|
|
- printk(" (ignored %d more)",
|
|
|
|
- le16_to_cpu(l->d_npartitions) - max_partitions);
|
|
|
|
- printk(" >\n");
|
|
|
|
|
|
+ if (le16_to_cpu(l->d_npartitions) > max_partitions) {
|
|
|
|
+ snprintf(tmp, sizeof(tmp), " (ignored %d more)",
|
|
|
|
+ le16_to_cpu(l->d_npartitions) - max_partitions);
|
|
|
|
+ strlcat(state->pp_buf, tmp, PAGE_SIZE);
|
|
|
|
+ }
|
|
|
|
+ strlcat(state->pp_buf, " >\n", PAGE_SIZE);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -333,7 +349,12 @@ static void parse_unixware(struct parsed_partitions *state,
|
|
put_dev_sector(sect);
|
|
put_dev_sector(sect);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- printk(" %s%d: <unixware:", state->name, origin);
|
|
|
|
|
|
+ {
|
|
|
|
+ char tmp[1 + BDEVNAME_SIZE + 10 + 12 + 1];
|
|
|
|
+
|
|
|
|
+ snprintf(tmp, sizeof(tmp), " %s%d: <unixware:", state->name, origin);
|
|
|
|
+ strlcat(state->pp_buf, tmp, PAGE_SIZE);
|
|
|
|
+ }
|
|
p = &l->vtoc.v_slice[1];
|
|
p = &l->vtoc.v_slice[1];
|
|
/* I omit the 0th slice as it is the same as whole disk. */
|
|
/* I omit the 0th slice as it is the same as whole disk. */
|
|
while (p - &l->vtoc.v_slice[0] < UNIXWARE_NUMSLICE) {
|
|
while (p - &l->vtoc.v_slice[0] < UNIXWARE_NUMSLICE) {
|
|
@@ -347,7 +368,7 @@ static void parse_unixware(struct parsed_partitions *state,
|
|
p++;
|
|
p++;
|
|
}
|
|
}
|
|
put_dev_sector(sect);
|
|
put_dev_sector(sect);
|
|
- printk(" >\n");
|
|
|
|
|
|
+ strlcat(state->pp_buf, " >\n", PAGE_SIZE);
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|
|
@@ -376,8 +397,10 @@ static void parse_minix(struct parsed_partitions *state,
|
|
* the normal boot sector. */
|
|
* the normal boot sector. */
|
|
if (msdos_magic_present (data + 510) &&
|
|
if (msdos_magic_present (data + 510) &&
|
|
SYS_IND(p) == MINIX_PARTITION) { /* subpartition table present */
|
|
SYS_IND(p) == MINIX_PARTITION) { /* subpartition table present */
|
|
|
|
+ char tmp[1 + BDEVNAME_SIZE + 10 + 9 + 1];
|
|
|
|
|
|
- printk(" %s%d: <minix:", state->name, origin);
|
|
|
|
|
|
+ snprintf(tmp, sizeof(tmp), " %s%d: <minix:", state->name, origin);
|
|
|
|
+ strlcat(state->pp_buf, tmp, PAGE_SIZE);
|
|
for (i = 0; i < MINIX_NR_SUBPARTITIONS; i++, p++) {
|
|
for (i = 0; i < MINIX_NR_SUBPARTITIONS; i++, p++) {
|
|
if (state->next == state->limit)
|
|
if (state->next == state->limit)
|
|
break;
|
|
break;
|
|
@@ -386,7 +409,7 @@ static void parse_minix(struct parsed_partitions *state,
|
|
put_partition(state, state->next++,
|
|
put_partition(state, state->next++,
|
|
start_sect(p), nr_sects(p));
|
|
start_sect(p), nr_sects(p));
|
|
}
|
|
}
|
|
- printk(" >\n");
|
|
|
|
|
|
+ strlcat(state->pp_buf, " >\n", PAGE_SIZE);
|
|
}
|
|
}
|
|
put_dev_sector(sect);
|
|
put_dev_sector(sect);
|
|
#endif /* CONFIG_MINIX_SUBPARTITION */
|
|
#endif /* CONFIG_MINIX_SUBPARTITION */
|
|
@@ -425,7 +448,7 @@ int msdos_partition(struct parsed_partitions *state)
|
|
|
|
|
|
if (aix_magic_present(state, data)) {
|
|
if (aix_magic_present(state, data)) {
|
|
put_dev_sector(sect);
|
|
put_dev_sector(sect);
|
|
- printk( " [AIX]");
|
|
|
|
|
|
+ strlcat(state->pp_buf, " [AIX]", PAGE_SIZE);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -446,7 +469,7 @@ int msdos_partition(struct parsed_partitions *state)
|
|
fb = (struct fat_boot_sector *) data;
|
|
fb = (struct fat_boot_sector *) data;
|
|
if (slot == 1 && fb->reserved && fb->fats
|
|
if (slot == 1 && fb->reserved && fb->fats
|
|
&& fat_valid_media(fb->media)) {
|
|
&& fat_valid_media(fb->media)) {
|
|
- printk("\n");
|
|
|
|
|
|
+ strlcat(state->pp_buf, "\n", PAGE_SIZE);
|
|
put_dev_sector(sect);
|
|
put_dev_sector(sect);
|
|
return 1;
|
|
return 1;
|
|
} else {
|
|
} else {
|
|
@@ -491,21 +514,21 @@ int msdos_partition(struct parsed_partitions *state)
|
|
n = min(size, max(sector_size, n));
|
|
n = min(size, max(sector_size, n));
|
|
put_partition(state, slot, start, n);
|
|
put_partition(state, slot, start, n);
|
|
|
|
|
|
- printk(" <");
|
|
|
|
|
|
+ strlcat(state->pp_buf, " <", PAGE_SIZE);
|
|
parse_extended(state, start, size);
|
|
parse_extended(state, start, size);
|
|
- printk(" >");
|
|
|
|
|
|
+ strlcat(state->pp_buf, " >", PAGE_SIZE);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
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 = ADDPART_FLAG_RAID;
|
|
state->parts[slot].flags = ADDPART_FLAG_RAID;
|
|
if (SYS_IND(p) == DM6_PARTITION)
|
|
if (SYS_IND(p) == DM6_PARTITION)
|
|
- printk("[DM]");
|
|
|
|
|
|
+ strlcat(state->pp_buf, "[DM]", PAGE_SIZE);
|
|
if (SYS_IND(p) == EZD_PARTITION)
|
|
if (SYS_IND(p) == EZD_PARTITION)
|
|
- printk("[EZD]");
|
|
|
|
|
|
+ strlcat(state->pp_buf, "[EZD]", PAGE_SIZE);
|
|
}
|
|
}
|
|
|
|
|
|
- printk("\n");
|
|
|
|
|
|
+ strlcat(state->pp_buf, "\n", PAGE_SIZE);
|
|
|
|
|
|
/* 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);
|