diff options
Diffstat (limited to 'util-linux/fdisk_sun.c')
-rw-r--r-- | util-linux/fdisk_sun.c | 167 |
1 files changed, 84 insertions, 83 deletions
diff --git a/util-linux/fdisk_sun.c b/util-linux/fdisk_sun.c index 10107783e..2fa7b2b86 100644 --- a/util-linux/fdisk_sun.c +++ b/util-linux/fdisk_sun.c | |||
@@ -1,5 +1,8 @@ | |||
1 | #if ENABLE_FEATURE_SUN_LABEL | 1 | #if ENABLE_FEATURE_SUN_LABEL |
2 | 2 | ||
3 | #define SUNOS_SWAP 3 | ||
4 | #define SUN_WHOLE_DISK 5 | ||
5 | |||
3 | #define SUN_LABEL_MAGIC 0xDABE | 6 | #define SUN_LABEL_MAGIC 0xDABE |
4 | #define SUN_LABEL_MAGIC_SWAPPED 0xBEDA | 7 | #define SUN_LABEL_MAGIC_SWAPPED 0xBEDA |
5 | #define SUN_SSWAP16(x) (sun_other_endian ? fdisk_swap16(x) : (uint16_t)(x)) | 8 | #define SUN_SSWAP16(x) (sun_other_endian ? fdisk_swap16(x) : (uint16_t)(x)) |
@@ -57,22 +60,22 @@ guess_device_type(void) | |||
57 | } | 60 | } |
58 | } | 61 | } |
59 | 62 | ||
60 | static const struct systypes sun_sys_types[] = { | 63 | static const char *const sun_sys_types[] = { |
61 | { "\x00" "Empty" }, /* 0 */ | 64 | "\x00" "Empty" , /* 0 */ |
62 | { "\x01" "Boot" }, /* 1 */ | 65 | "\x01" "Boot" , /* 1 */ |
63 | { "\x02" "SunOS root" }, /* 2 */ | 66 | "\x02" "SunOS root" , /* 2 */ |
64 | { "\x03" "SunOS swap" }, /* SUNOS_SWAP */ | 67 | "\x03" "SunOS swap" , /* SUNOS_SWAP */ |
65 | { "\x04" "SunOS usr" }, /* 4 */ | 68 | "\x04" "SunOS usr" , /* 4 */ |
66 | { "\x05" "Whole disk" }, /* SUN_WHOLE_DISK */ | 69 | "\x05" "Whole disk" , /* SUN_WHOLE_DISK */ |
67 | { "\x06" "SunOS stand" }, /* 6 */ | 70 | "\x06" "SunOS stand" , /* 6 */ |
68 | { "\x07" "SunOS var" }, /* 7 */ | 71 | "\x07" "SunOS var" , /* 7 */ |
69 | { "\x08" "SunOS home" }, /* 8 */ | 72 | "\x08" "SunOS home" , /* 8 */ |
70 | { "\x82" "Linux swap" }, /* LINUX_SWAP */ | 73 | "\x82" "Linux swap" , /* LINUX_SWAP */ |
71 | { "\x83" "Linux native" }, /* LINUX_NATIVE */ | 74 | "\x83" "Linux native", /* LINUX_NATIVE */ |
72 | { "\x8e" "Linux LVM" }, /* 0x8e */ | 75 | "\x8e" "Linux LVM" , /* 0x8e */ |
73 | /* New (2.2.x) raid partition with autodetect using persistent superblock */ | 76 | /* New (2.2.x) raid partition with autodetect using persistent superblock */ |
74 | { "\xfd" "Linux raid autodetect" }, /* 0xfd */ | 77 | "\xfd" "Linux raid autodetect", /* 0xfd */ |
75 | { NULL } | 78 | NULL |
76 | }; | 79 | }; |
77 | 80 | ||
78 | 81 | ||
@@ -103,10 +106,10 @@ check_sun_label(void) | |||
103 | ush = ((unsigned short *) (sunlabel + 1)) - 1; | 106 | ush = ((unsigned short *) (sunlabel + 1)) - 1; |
104 | for (csum = 0; ush >= (unsigned short *)sunlabel;) csum ^= *ush--; | 107 | for (csum = 0; ush >= (unsigned short *)sunlabel;) csum ^= *ush--; |
105 | if (csum) { | 108 | if (csum) { |
106 | fprintf(stderr,_("Detected sun disklabel with wrong checksum.\n" | 109 | printf("Detected sun disklabel with wrong checksum.\n" |
107 | "Probably you'll have to set all the values,\n" | 110 | "Probably you'll have to set all the values,\n" |
108 | "e.g. heads, sectors, cylinders and partitions\n" | 111 | "e.g. heads, sectors, cylinders and partitions\n" |
109 | "or force a fresh label (s command in main menu)\n")); | 112 | "or force a fresh label (s command in main menu)\n"); |
110 | } else { | 113 | } else { |
111 | heads = SUN_SSWAP16(sunlabel->ntrks); | 114 | heads = SUN_SSWAP16(sunlabel->ntrks); |
112 | cylinders = SUN_SSWAP16(sunlabel->ncyl); | 115 | cylinders = SUN_SSWAP16(sunlabel->ncyl); |
@@ -209,7 +212,7 @@ sun_autoconfigure_scsi(void) | |||
209 | continue; | 212 | continue; |
210 | if (!strstr(model, sun_drives[i].model)) | 213 | if (!strstr(model, sun_drives[i].model)) |
211 | continue; | 214 | continue; |
212 | printf(_("Autoconfigure found a %s%s%s\n"), | 215 | printf("Autoconfigure found a %s%s%s\n", |
213 | sun_drives[i].vendor, | 216 | sun_drives[i].vendor, |
214 | (*sun_drives[i].vendor) ? " " : "", | 217 | (*sun_drives[i].vendor) ? " " : "", |
215 | sun_drives[i].model); | 218 | sun_drives[i].model); |
@@ -232,17 +235,15 @@ create_sunlabel(void) | |||
232 | unsigned char c; | 235 | unsigned char c; |
233 | const struct sun_predefined_drives *p = NULL; | 236 | const struct sun_predefined_drives *p = NULL; |
234 | 237 | ||
235 | fprintf(stderr, | 238 | printf(msg_building_new_label, "sun disklabel"); |
236 | _("Building a new sun disklabel. Changes will remain in memory only,\n" | 239 | |
237 | "until you decide to write them. After that, of course, the previous\n" | ||
238 | "content won't be recoverable.\n\n")); | ||
239 | sun_other_endian = BB_LITTLE_ENDIAN; | 240 | sun_other_endian = BB_LITTLE_ENDIAN; |
240 | memset(MBRbuffer, 0, sizeof(MBRbuffer)); | 241 | memset(MBRbuffer, 0, sizeof(MBRbuffer)); |
241 | sunlabel->magic = SUN_SSWAP16(SUN_LABEL_MAGIC); | 242 | sunlabel->magic = SUN_SSWAP16(SUN_LABEL_MAGIC); |
242 | if (!floppy) { | 243 | if (!floppy) { |
243 | puts(_("Drive type\n" | 244 | puts("Drive type\n" |
244 | " ? auto configure\n" | 245 | " ? auto configure\n" |
245 | " 0 custom (with hardware detected defaults)")); | 246 | " 0 custom (with hardware detected defaults)"); |
246 | for (i = 0; i < SIZE(sun_drives); i++) { | 247 | for (i = 0; i < SIZE(sun_drives); i++) { |
247 | printf(" %c %s%s%s\n", | 248 | printf(" %c %s%s%s\n", |
248 | i + 'a', sun_drives[i].vendor, | 249 | i + 'a', sun_drives[i].vendor, |
@@ -250,21 +251,23 @@ create_sunlabel(void) | |||
250 | sun_drives[i].model); | 251 | sun_drives[i].model); |
251 | } | 252 | } |
252 | while (1) { | 253 | while (1) { |
253 | c = read_nonempty(_("Select type (? for auto, 0 for custom): ")); | 254 | c = read_nonempty("Select type (? for auto, 0 for custom): "); |
255 | if (c == '0') { | ||
256 | break; | ||
257 | } | ||
254 | if (c >= 'a' && c < 'a' + SIZE(sun_drives)) { | 258 | if (c >= 'a' && c < 'a' + SIZE(sun_drives)) { |
255 | p = sun_drives + c - 'a'; | 259 | p = sun_drives + c - 'a'; |
256 | break; | 260 | break; |
257 | } else if (c >= 'A' && c < 'A' + SIZE(sun_drives)) { | 261 | } |
262 | if (c >= 'A' && c < 'A' + SIZE(sun_drives)) { | ||
258 | p = sun_drives + c - 'A'; | 263 | p = sun_drives + c - 'A'; |
259 | break; | 264 | break; |
260 | } else if (c == '0') { | 265 | } |
261 | break; | 266 | if (c == '?' && scsi_disk) { |
262 | } else if (c == '?' && scsi_disk) { | ||
263 | p = sun_autoconfigure_scsi(); | 267 | p = sun_autoconfigure_scsi(); |
264 | if (!p) | 268 | if (p) |
265 | printf(_("Autoconfigure failed.\n")); | 269 | break; |
266 | else | 270 | printf("Autoconfigure failed\n"); |
267 | break; | ||
268 | } | 271 | } |
269 | } | 272 | } |
270 | } | 273 | } |
@@ -285,17 +288,17 @@ create_sunlabel(void) | |||
285 | sunlabel->ilfact = SUN_SSWAP16(1); | 288 | sunlabel->ilfact = SUN_SSWAP16(1); |
286 | sunlabel->sparecyl = 0; | 289 | sunlabel->sparecyl = 0; |
287 | } else { | 290 | } else { |
288 | heads = read_int(1,heads,1024,0,_("Heads")); | 291 | heads = read_int(1, heads, 1024, 0, "Heads"); |
289 | sectors = read_int(1,sectors,1024,0,_("Sectors/track")); | 292 | sectors = read_int(1, sectors, 1024, 0, "Sectors/track"); |
290 | if (cylinders) | 293 | if (cylinders) |
291 | cylinders = read_int(1,cylinders-2,65535,0,_("Cylinders")); | 294 | cylinders = read_int(1, cylinders-2, 65535, 0, "Cylinders"); |
292 | else | 295 | else |
293 | cylinders = read_int(1,0,65535,0,_("Cylinders")); | 296 | cylinders = read_int(1, 0, 65535, 0, "Cylinders"); |
294 | sunlabel->nacyl = SUN_SSWAP16(read_int(0,2,65535,0, _("Alternate cylinders"))); | 297 | sunlabel->nacyl = SUN_SSWAP16(read_int(0, 2, 65535, 0, "Alternate cylinders")); |
295 | sunlabel->pcylcount = SUN_SSWAP16(read_int(0,cylinders+SUN_SSWAP16(sunlabel->nacyl), 65535,0, _("Physical cylinders"))); | 298 | sunlabel->pcylcount = SUN_SSWAP16(read_int(0, cylinders+SUN_SSWAP16(sunlabel->nacyl), 65535, 0, "Physical cylinders")); |
296 | sunlabel->rspeed = SUN_SSWAP16(read_int(1,5400,100000,0, _("Rotation speed (rpm)"))); | 299 | sunlabel->rspeed = SUN_SSWAP16(read_int(1, 5400, 100000, 0, "Rotation speed (rpm)")); |
297 | sunlabel->ilfact = SUN_SSWAP16(read_int(1,1,32,0, _("Interleave factor"))); | 300 | sunlabel->ilfact = SUN_SSWAP16(read_int(1, 1, 32, 0, "Interleave factor")); |
298 | sunlabel->sparecyl = SUN_SSWAP16(read_int(0,0,sectors,0, _("Extra sectors per cylinder"))); | 301 | sunlabel->sparecyl = SUN_SSWAP16(read_int(0, 0, sectors, 0, "Extra sectors per cylinder")); |
299 | } | 302 | } |
300 | } else { | 303 | } else { |
301 | sunlabel->sparecyl = SUN_SSWAP16(p->sparecyl); | 304 | sunlabel->sparecyl = SUN_SSWAP16(p->sparecyl); |
@@ -309,13 +312,13 @@ create_sunlabel(void) | |||
309 | cylinders = p->ncyl; | 312 | cylinders = p->ncyl; |
310 | heads = p->ntrks; | 313 | heads = p->ntrks; |
311 | sectors = p->nsect; | 314 | sectors = p->nsect; |
312 | puts(_("You may change all the disk params from the x menu")); | 315 | puts("You may change all the disk params from the x menu"); |
313 | } | 316 | } |
314 | 317 | ||
315 | snprintf((char *)(sunlabel->info), sizeof(sunlabel->info), | 318 | snprintf((char *)(sunlabel->info), sizeof(sunlabel->info), |
316 | "%s%s%s cyl %d alt %d hd %d sec %d", | 319 | "%s%s%s cyl %d alt %d hd %d sec %d", |
317 | p ? p->vendor : "", (p && *p->vendor) ? " " : "", | 320 | p ? p->vendor : "", (p && *p->vendor) ? " " : "", |
318 | p ? p->model : (floppy ? _("3,5\" floppy") : _("Linux custom")), | 321 | p ? p->model : (floppy ? "3,5\" floppy" : "Linux custom"), |
319 | cylinders, SUN_SSWAP16(sunlabel->nacyl), heads, sectors); | 322 | cylinders, SUN_SSWAP16(sunlabel->nacyl), heads, sectors); |
320 | 323 | ||
321 | sunlabel->ntrks = SUN_SSWAP16(heads); | 324 | sunlabel->ntrks = SUN_SSWAP16(heads); |
@@ -409,7 +412,7 @@ verify_sun(void) | |||
409 | for (k = 0; k < 7; k++) { | 412 | for (k = 0; k < 7; k++) { |
410 | for (i = 0; i < 8; i++) { | 413 | for (i = 0; i < 8; i++) { |
411 | if (k && (lens[i] % (heads * sectors))) { | 414 | if (k && (lens[i] % (heads * sectors))) { |
412 | printf(_("Partition %d doesn't end on cylinder boundary\n"), i+1); | 415 | printf("Partition %d doesn't end on cylinder boundary\n", i+1); |
413 | } | 416 | } |
414 | if (lens[i]) { | 417 | if (lens[i]) { |
415 | for (j = 0; j < i; j++) | 418 | for (j = 0; j < i; j++) |
@@ -429,8 +432,8 @@ verify_sun(void) | |||
429 | endo = starts[i]+lens[i]; | 432 | endo = starts[i]+lens[i]; |
430 | if (starts[j]+lens[j] < endo) | 433 | if (starts[j]+lens[j] < endo) |
431 | endo = starts[j]+lens[j]; | 434 | endo = starts[j]+lens[j]; |
432 | printf(_("Partition %d overlaps with others in " | 435 | printf("Partition %d overlaps with others in " |
433 | "sectors %d-%d\n"), i+1, starto, endo); | 436 | "sectors %d-%d\n", i+1, starto, endo); |
434 | } | 437 | } |
435 | } | 438 | } |
436 | } | 439 | } |
@@ -446,18 +449,18 @@ verify_sun(void) | |||
446 | qsort(array,SIZE(array),sizeof(array[0]), | 449 | qsort(array,SIZE(array),sizeof(array[0]), |
447 | (int (*)(const void *,const void *)) verify_sun_cmp); | 450 | (int (*)(const void *,const void *)) verify_sun_cmp); |
448 | if (array[0] == -1) { | 451 | if (array[0] == -1) { |
449 | printf(_("No partitions defined\n")); | 452 | printf("No partitions defined\n"); |
450 | return; | 453 | return; |
451 | } | 454 | } |
452 | stop = cylinders * heads * sectors; | 455 | stop = cylinders * heads * sectors; |
453 | if (starts[array[0]]) | 456 | if (starts[array[0]]) |
454 | printf(_("Unused gap - sectors 0-%d\n"),starts[array[0]]); | 457 | printf("Unused gap - sectors 0-%d\n", starts[array[0]]); |
455 | for (i = 0; i < 7 && array[i+1] != -1; i++) { | 458 | for (i = 0; i < 7 && array[i+1] != -1; i++) { |
456 | printf(_("Unused gap - sectors %d-%d\n"),starts[array[i]]+lens[array[i]],starts[array[i+1]]); | 459 | printf("Unused gap - sectors %d-%d\n", starts[array[i]]+lens[array[i]], starts[array[i+1]]); |
457 | } | 460 | } |
458 | start = starts[array[i]] + lens[array[i]]; | 461 | start = starts[array[i]] + lens[array[i]]; |
459 | if (start < stop) | 462 | if (start < stop) |
460 | printf(_("Unused gap - sectors %d-%d\n"),start,stop); | 463 | printf("Unused gap - sectors %d-%d\n", start, stop); |
461 | } | 464 | } |
462 | 465 | ||
463 | static void | 466 | static void |
@@ -471,8 +474,7 @@ add_sun_partition(int n, int sys) | |||
471 | int i, first, last; | 474 | int i, first, last; |
472 | 475 | ||
473 | if (sunlabel->partitions[n].num_sectors && sunlabel->infos[n].id) { | 476 | if (sunlabel->partitions[n].num_sectors && sunlabel->infos[n].id) { |
474 | printf(_("Partition %d is already defined. Delete " | 477 | printf(msg_part_already_defined, n + 1); |
475 | "it before re-adding it.\n"), n + 1); | ||
476 | return; | 478 | return; |
477 | } | 479 | } |
478 | 480 | ||
@@ -481,12 +483,12 @@ add_sun_partition(int n, int sys) | |||
481 | if (n == 2) | 483 | if (n == 2) |
482 | whole_disk = 1; | 484 | whole_disk = 1; |
483 | else { | 485 | else { |
484 | printf(_("Other partitions already cover the whole disk.\nDelete " | 486 | printf("Other partitions already cover the whole disk.\n" |
485 | "some/shrink them before retry.\n")); | 487 | "Delete/shrink them before retry.\n"); |
486 | return; | 488 | return; |
487 | } | 489 | } |
488 | } | 490 | } |
489 | snprintf(mesg, sizeof(mesg), _("First %s"), str_units(SINGULAR)); | 491 | snprintf(mesg, sizeof(mesg), "First %s", str_units(SINGULAR)); |
490 | while (1) { | 492 | while (1) { |
491 | if (whole_disk) | 493 | if (whole_disk) |
492 | first = read_int(0, 0, 0, 0, mesg); | 494 | first = read_int(0, 0, 0, 0, mesg); |
@@ -501,7 +503,7 @@ add_sun_partition(int n, int sys) | |||
501 | if (n == 2 && first != 0) | 503 | if (n == 2 && first != 0) |
502 | printf("\ | 504 | printf("\ |
503 | It is highly recommended that the third partition covers the whole disk\n\ | 505 | It is highly recommended that the third partition covers the whole disk\n\ |
504 | and is of type `Whole disk'\n"); | 506 | and is of type 'Whole disk'\n"); |
505 | /* ewt asks to add: "don't start a partition at cyl 0" | 507 | /* ewt asks to add: "don't start a partition at cyl 0" |
506 | However, edmundo@rano.demon.co.uk writes: | 508 | However, edmundo@rano.demon.co.uk writes: |
507 | "In addition to having a Sun partition table, to be able to | 509 | "In addition to having a Sun partition table, to be able to |
@@ -526,7 +528,7 @@ and is of type `Whole disk'\n"); | |||
526 | whole_disk = 1; | 528 | whole_disk = 1; |
527 | break; | 529 | break; |
528 | } | 530 | } |
529 | printf(_("Sector %d is already allocated\n"), first); | 531 | printf("Sector %d is already allocated\n", first); |
530 | } else | 532 | } else |
531 | break; | 533 | break; |
532 | } | 534 | } |
@@ -537,7 +539,7 @@ and is of type `Whole disk'\n"); | |||
537 | stop = starts[i]; | 539 | stop = starts[i]; |
538 | } | 540 | } |
539 | snprintf(mesg, sizeof(mesg), | 541 | snprintf(mesg, sizeof(mesg), |
540 | _("Last %s or +size or +sizeM or +sizeK"), | 542 | "Last %s or +size or +sizeM or +sizeK", |
541 | str_units(SINGULAR)); | 543 | str_units(SINGULAR)); |
542 | if (whole_disk) | 544 | if (whole_disk) |
543 | last = read_int(scround(stop2), scround(stop2), scround(stop2), | 545 | last = read_int(scround(stop2), scround(stop2), scround(stop2), |
@@ -555,11 +557,10 @@ and is of type `Whole disk'\n"); | |||
555 | whole_disk = 1; | 557 | whole_disk = 1; |
556 | last = stop2; | 558 | last = stop2; |
557 | } else if (last > stop) { | 559 | } else if (last > stop) { |
558 | printf(_("You haven't covered the whole disk with " | 560 | printf( |
559 | "the 3rd partition, but your value\n" | 561 | "You haven't covered the whole disk with the 3rd partition,\n" |
560 | "%d %s covers some other partition. " | 562 | "but your value %d %s covers some other partition.\n" |
561 | "Your entry has been changed\n" | 563 | "Your entry has been changed to %d %s\n", |
562 | "to %d %s\n"), | ||
563 | scround(last), str_units(SINGULAR), | 564 | scround(last), str_units(SINGULAR), |
564 | scround(stop), str_units(SINGULAR)); | 565 | scround(stop), str_units(SINGULAR)); |
565 | last = stop; | 566 | last = stop; |
@@ -581,10 +582,10 @@ sun_delete_partition(int i) | |||
581 | && sunlabel->infos[i].id == SUN_WHOLE_DISK | 582 | && sunlabel->infos[i].id == SUN_WHOLE_DISK |
582 | && !sunlabel->partitions[i].start_cylinder | 583 | && !sunlabel->partitions[i].start_cylinder |
583 | && (nsec = SUN_SSWAP32(sunlabel->partitions[i].num_sectors)) == heads * sectors * cylinders) | 584 | && (nsec = SUN_SSWAP32(sunlabel->partitions[i].num_sectors)) == heads * sectors * cylinders) |
584 | printf(_("If you want to maintain SunOS/Solaris compatibility, " | 585 | printf("If you want to maintain SunOS/Solaris compatibility, " |
585 | "consider leaving this\n" | 586 | "consider leaving this\n" |
586 | "partition as Whole disk (5), starting at 0, with %u " | 587 | "partition as Whole disk (5), starting at 0, with %u " |
587 | "sectors\n"), nsec); | 588 | "sectors\n", nsec); |
588 | sunlabel->infos[i].id = 0; | 589 | sunlabel->infos[i].id = 0; |
589 | sunlabel->partitions[i].num_sectors = 0; | 590 | sunlabel->partitions[i].num_sectors = 0; |
590 | } | 591 | } |
@@ -594,12 +595,12 @@ sun_change_sysid(int i, int sys) | |||
594 | { | 595 | { |
595 | if (sys == LINUX_SWAP && !sunlabel->partitions[i].start_cylinder) { | 596 | if (sys == LINUX_SWAP && !sunlabel->partitions[i].start_cylinder) { |
596 | read_maybe_empty( | 597 | read_maybe_empty( |
597 | _("It is highly recommended that the partition at offset 0\n" | 598 | "It is highly recommended that the partition at offset 0\n" |
598 | "is UFS, EXT2FS filesystem or SunOS swap. Putting Linux swap\n" | 599 | "is UFS, EXT2FS filesystem or SunOS swap. Putting Linux swap\n" |
599 | "there may destroy your partition table and bootblock.\n" | 600 | "there may destroy your partition table and bootblock.\n" |
600 | "Type YES if you're very sure you would like that partition\n" | 601 | "Type YES if you're very sure you would like that partition\n" |
601 | "tagged with 82 (Linux swap): ")); | 602 | "tagged with 82 (Linux swap): "); |
602 | if (strcmp (line_ptr, _("YES\n"))) | 603 | if (strcmp (line_ptr, "YES\n")) |
603 | return; | 604 | return; |
604 | } | 605 | } |
605 | switch (sys) { | 606 | switch (sys) { |
@@ -625,11 +626,11 @@ sun_list_table(int xtra) | |||
625 | w = strlen(disk_device); | 626 | w = strlen(disk_device); |
626 | if (xtra) | 627 | if (xtra) |
627 | printf( | 628 | printf( |
628 | _("\nDisk %s (Sun disk label): %d heads, %d sectors, %d rpm\n" | 629 | "\nDisk %s (Sun disk label): %d heads, %d sectors, %d rpm\n" |
629 | "%d cylinders, %d alternate cylinders, %d physical cylinders\n" | 630 | "%d cylinders, %d alternate cylinders, %d physical cylinders\n" |
630 | "%d extra sects/cyl, interleave %d:1\n" | 631 | "%d extra sects/cyl, interleave %d:1\n" |
631 | "%s\n" | 632 | "%s\n" |
632 | "Units = %s of %d * 512 bytes\n\n"), | 633 | "Units = %s of %d * 512 bytes\n\n", |
633 | disk_device, heads, sectors, SUN_SSWAP16(sunlabel->rspeed), | 634 | disk_device, heads, sectors, SUN_SSWAP16(sunlabel->rspeed), |
634 | cylinders, SUN_SSWAP16(sunlabel->nacyl), | 635 | cylinders, SUN_SSWAP16(sunlabel->nacyl), |
635 | SUN_SSWAP16(sunlabel->pcylcount), | 636 | SUN_SSWAP16(sunlabel->pcylcount), |
@@ -639,13 +640,13 @@ sun_list_table(int xtra) | |||
639 | str_units(PLURAL), units_per_sector); | 640 | str_units(PLURAL), units_per_sector); |
640 | else | 641 | else |
641 | printf( | 642 | printf( |
642 | _("\nDisk %s (Sun disk label): %d heads, %d sectors, %d cylinders\n" | 643 | "\nDisk %s (Sun disk label): %d heads, %d sectors, %d cylinders\n" |
643 | "Units = %s of %d * 512 bytes\n\n"), | 644 | "Units = %s of %d * 512 bytes\n\n", |
644 | disk_device, heads, sectors, cylinders, | 645 | disk_device, heads, sectors, cylinders, |
645 | str_units(PLURAL), units_per_sector); | 646 | str_units(PLURAL), units_per_sector); |
646 | 647 | ||
647 | printf(_("%*s Flag Start End Blocks Id System\n"), | 648 | printf("%*s Flag Start End Blocks Id System\n", |
648 | w + 1, _("Device")); | 649 | w + 1, "Device"); |
649 | for (i = 0 ; i < partitions; i++) { | 650 | for (i = 0 ; i < partitions; i++) { |
650 | if (sunlabel->partitions[i].num_sectors) { | 651 | if (sunlabel->partitions[i].num_sectors) { |
651 | uint32_t start = SUN_SSWAP32(sunlabel->partitions[i].start_cylinder) * heads * sectors; | 652 | uint32_t start = SUN_SSWAP32(sunlabel->partitions[i].start_cylinder) * heads * sectors; |
@@ -669,8 +670,8 @@ static void | |||
669 | sun_set_alt_cyl(void) | 670 | sun_set_alt_cyl(void) |
670 | { | 671 | { |
671 | sunlabel->nacyl = | 672 | sunlabel->nacyl = |
672 | SUN_SSWAP16(read_int(0,SUN_SSWAP16(sunlabel->nacyl), 65535, 0, | 673 | SUN_SSWAP16(read_int(0, SUN_SSWAP16(sunlabel->nacyl), 65535, 0, |
673 | _("Number of alternate cylinders"))); | 674 | "Number of alternate cylinders")); |
674 | } | 675 | } |
675 | 676 | ||
676 | static void | 677 | static void |
@@ -684,7 +685,7 @@ sun_set_xcyl(void) | |||
684 | { | 685 | { |
685 | sunlabel->sparecyl = | 686 | sunlabel->sparecyl = |
686 | SUN_SSWAP16(read_int(0, SUN_SSWAP16(sunlabel->sparecyl), sectors, 0, | 687 | SUN_SSWAP16(read_int(0, SUN_SSWAP16(sunlabel->sparecyl), sectors, 0, |
687 | _("Extra sectors per cylinder"))); | 688 | "Extra sectors per cylinder")); |
688 | } | 689 | } |
689 | 690 | ||
690 | static void | 691 | static void |
@@ -692,7 +693,7 @@ sun_set_ilfact(void) | |||
692 | { | 693 | { |
693 | sunlabel->ilfact = | 694 | sunlabel->ilfact = |
694 | SUN_SSWAP16(read_int(1, SUN_SSWAP16(sunlabel->ilfact), 32, 0, | 695 | SUN_SSWAP16(read_int(1, SUN_SSWAP16(sunlabel->ilfact), 32, 0, |
695 | _("Interleave factor"))); | 696 | "Interleave factor")); |
696 | } | 697 | } |
697 | 698 | ||
698 | static void | 699 | static void |
@@ -700,7 +701,7 @@ sun_set_rspeed(void) | |||
700 | { | 701 | { |
701 | sunlabel->rspeed = | 702 | sunlabel->rspeed = |
702 | SUN_SSWAP16(read_int(1, SUN_SSWAP16(sunlabel->rspeed), 100000, 0, | 703 | SUN_SSWAP16(read_int(1, SUN_SSWAP16(sunlabel->rspeed), 100000, 0, |
703 | _("Rotation speed (rpm)"))); | 704 | "Rotation speed (rpm)")); |
704 | } | 705 | } |
705 | 706 | ||
706 | static void | 707 | static void |
@@ -708,7 +709,7 @@ sun_set_pcylcount(void) | |||
708 | { | 709 | { |
709 | sunlabel->pcylcount = | 710 | sunlabel->pcylcount = |
710 | SUN_SSWAP16(read_int(0, SUN_SSWAP16(sunlabel->pcylcount), 65535, 0, | 711 | SUN_SSWAP16(read_int(0, SUN_SSWAP16(sunlabel->pcylcount), 65535, 0, |
711 | _("Number of physical cylinders"))); | 712 | "Number of physical cylinders")); |
712 | } | 713 | } |
713 | #endif /* FEATURE_FDISK_ADVANCED */ | 714 | #endif /* FEATURE_FDISK_ADVANCED */ |
714 | 715 | ||