# Croatian translation for isodumper package. # Copyright (C) 2013 THE isodumper'S COPYRIGHT HOLDER # This file is distributed under the same license as the isodumper package. # Automatically generated, 2013. # FIRST AUTHOR , 2012. # msgid "" msgstr "" "Project-Id-Version: isodumper\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-03-08 09:28+0100\n" "PO-Revision-Date: 2012-11-13 02:22+0000\n" "Last-Translator: gogo \n" "Language-Team: Croatian \n" "Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2013-07-03 20:32+0000\n" "X-Generator: Launchpad (build 16692)\n" #: lib/isodumper.py:103 #, python-format msgid "%r not known to UDisks2" msgstr "" #: lib/isodumper.py:263 msgid "UDisks2 is not available on your system" msgstr "" #: lib/isodumper.py:284 msgid "Mb" msgstr "" #: lib/isodumper.py:300 lib/isodumper.py:466 msgid "Target Device: " msgstr "Uređaj zapisivanja: " #: lib/isodumper.py:324 msgid "Backup in: " msgstr "" #: lib/isodumper.py:362 lib/isodumper.py:504 msgid "The device was formatted successfully." msgstr "" #: lib/isodumper.py:366 lib/isodumper.py:496 msgid "An error occurred while creating a partition." msgstr "" #: lib/isodumper.py:370 lib/isodumper.py:500 msgid "Authentication error." msgstr "" #: lib/isodumper.py:374 lib/isodumper.py:540 msgid "An error occurred." msgstr "" #: lib/isodumper.py:438 #, python-format msgid "" "The destination directory is too small to receive the backup (%s Mb needed)" msgstr "" #: lib/isodumper.py:443 share/isodumper/isodumper.glade.h:52 msgid "Backup in:" msgstr "" #: lib/isodumper.py:469 msgid "The device is too small to contain the ISO file." msgstr "" #: lib/isodumper.py:476 msgid "The device is bigger than 32 Gbytes. Are you sure you want use it?" msgstr "" #: lib/isodumper.py:519 lib/isodumper.py:537 #, python-format msgid "Error mounting the partition %s" msgstr "" #: lib/isodumper.py:523 msgid "Mounted in: " msgstr "" #: lib/isodumper.py:533 msgid "Error copying files" msgstr "" #: lib/isodumper.py:565 msgid "Unmounting all partitions of " msgstr "Demontiranje svih particija od " #: lib/isodumper.py:567 msgid "Trying to unmount " msgstr "Pokušavanje demontiranja " #: lib/isodumper.py:573 msgid " was terminated by signal " msgstr " je prekinuo signal " #: lib/isodumper.py:573 lib/isodumper.py:579 msgid "Error, umount " msgstr "Greška, demontiranje " #: lib/isodumper.py:577 msgid " successfully unmounted" msgstr " uspješno demontirani" #: lib/isodumper.py:579 msgid " returned " msgstr " vraćeno " #: lib/isodumper.py:582 msgid "Execution failed: " msgstr "Pokretanje neuspjelo: " #: lib/isodumper.py:590 msgid "Could not read mtab !" msgstr "Nemoguće je pročitati mtab !" #: lib/isodumper.py:600 lib/isodumper.py:629 msgid "Reading error." msgstr "" #: lib/isodumper.py:607 msgid "You have not the rights for writing on the device" msgstr "" #: lib/isodumper.py:613 lib/isodumper.py:614 lib/isodumper.py:726 #: lib/isodumper.py:727 msgid " to " msgstr " u " #: lib/isodumper.py:613 lib/isodumper.py:726 msgid "Writing " msgstr "Zapisivanje " #: lib/isodumper.py:614 lib/isodumper.py:727 msgid "Executing copy from " msgstr "" #: lib/isodumper.py:635 lib/isodumper.py:651 lib/isodumper.py:661 msgid "Writing error." msgstr "" #: lib/isodumper.py:641 msgid "Wrote: " msgstr "Zapisao: " #: lib/isodumper.py:656 lib/isodumper.py:766 msgid " successfully written to " msgstr " je uspješno zapisana " #: lib/isodumper.py:656 lib/isodumper.py:766 lib/isodumper.py:854 msgid "Image " msgstr "Slika " #: lib/isodumper.py:657 msgid "Bytes written: " msgstr "" #: lib/isodumper.py:670 msgid "Checking " msgstr "" #: lib/isodumper.py:697 msgid "SHA1 sum: " msgstr "" #: lib/isodumper.py:698 msgid "MD5 sum: " msgstr "" #: lib/isodumper.py:723 msgid "ISO image mounted in " msgstr "" #: lib/isodumper.py:731 #, python-format msgid "%s file(s) to copy." msgstr "" #: polkit/org.mageia.isodumper.policy.in.h:1 msgid "Run Isodumper" msgstr "" #: polkit/org.mageia.isodumper.policy.in.h:2 msgid "Authentication is required to run Isodumper" msgstr "" #: share/applications/isodumper.desktop.in.h:1 #: share/isodumper/isodumper.glade.h:1 msgid "IsoDumper" msgstr "" #: share/applications/isodumper.desktop.in.h:2 msgid "A GUI tool to write .img and .iso files to USB Keys" msgstr "" #: share/isodumper/isodumper.glade.h:2 msgid "" "Writing is in progress. Exiting during writing will occur that the device or " "the backup will be unusable.\n" "Are you sure you want to quit during writing?" msgstr "" #: share/isodumper/isodumper.glade.h:4 msgid "" "A tool for writing ISO images on a USB stick. It's a fork of usb-imagewriter." msgstr "" #: share/isodumper/isodumper.glade.h:5 msgid "Select" msgstr "" #: share/isodumper/isodumper.glade.h:6 msgid "" "Warning\n" " This will destroy all data on the target\n" " device, are you sure you want to proceed ?\n" "\n" " If you say ok here, please do not unplug\n" " the device during the following operation." msgstr "" "Upozorenje\n" " Ova radnja će uništiti sve podatke na uređaju\n" " zapisivanja, sigurno želite nastaviti zapisivanje?\n" "\n" " Ako nastavite zapisivanje, ne odspajajte\n" " uređaj tijekom sljedeće radnje." #: share/isodumper/isodumper.glade.h:12 msgid "Do you want to overwrite the file?" msgstr "" #: share/isodumper/isodumper.glade.h:13 msgid "" "Error\n" " Something went wrong, please see the details\n" " window for the exact error.\n" "\n" " The application will be closed with this window, and a logfile\n" " isodumper.log will be saved in your homedir/.isodumper " msgstr "" #: share/isodumper/isodumper.glade.h:19 msgid "Label for the device:" msgstr "" #: share/isodumper/isodumper.glade.h:20 msgid "FAT 32 (Windows)" msgstr "" #: share/isodumper/isodumper.glade.h:21 msgid "The standard. The size of files are limited to 4Gb" msgstr "" #: share/isodumper/isodumper.glade.h:22 msgid "NTFS (Windows)" msgstr "" #: share/isodumper/isodumper.glade.h:23 msgid "To handle files bigger than 4Gb" msgstr "" #: share/isodumper/isodumper.glade.h:24 msgid "ext4 (Linux)" msgstr "" #: share/isodumper/isodumper.glade.h:25 msgid "Only for Linux systems" msgstr "" #: share/isodumper/isodumper.glade.h:26 msgid "Isodumper - Help" msgstr "" #: share/isodumper/isodumper.glade.h:27 msgid "" "Mageia IsoDumper\n" "----------------\n" "This GUI program is primarily for safely writing a bootable ISO image to a " "USB flash drive, an operation devious & potentially hazardous when done by " "hand. As a bonus, it can also back up the entire previous contents of the " "flash drive onto the hard disc, and restore the flash drive to its previous " "state subsequently. It gives also a feature for formatting the USB device.\n" "\n" "IsoDumper can be launched either from the menus, or a user or root console " "with the command 'isodumper'. For normal users, the root password is " "solicited; this is necessary for the program's operation. The flash drive " "can be inserted beforehand or once the program is started. In the latter " "case, a dialogue will say that there is no flash drive inserted, and allow a " "'retry' to find it once it is. (You may have to close any automatically " "opened File Manager window).\n" "\n" "The fields of the main window are as follows:\n" "- Device to work on: the device of the USB flash drive, a drop-down list to " "choose from.\n" "- Write Image: to choose the source ISO image *.iso (or flash drive backup " "file *.img) to write out.\n" "- Write to device: This button launches the operation - with a prior warning " "dialogue. If a flash drive backup was requested, this is done first. Then " "(or only) the image file write. Each operation is shown in the progress bar " "beneath.\n" "- Backup in: define the name and placement of the backup image file. The " "current flash drive will be backed up to a disc file. Note that the entire " "flash drive is preserved, regardless of its actual contents; ensure that you " "have the necessary free disc space (the same size as the USB device). This " "backup file can be used later to restore the flash drive by selecting it as " "the source *.img file to write out.\n" "- Backup the device: launch the backup operation.\n" "- Format the device: create an unique partition on the entire volume in the " "specified format in FAT, NTFS or ext. You can specify a volume name and the " "format in a new dialog box.\n" "- Details: this button shows detailed log information.\n" "\n" msgstr "" #: share/isodumper/isodumper.glade.h:43 msgid "Device to work on:" msgstr "" #: share/isodumper/isodumper.glade.h:44 msgid "Select target device to write the image to" msgstr "Odaberite uređaj zapisivanja za zapis slike" #: share/isodumper/isodumper.glade.h:45 msgid "Write Image:" msgstr "Zapisivanje slike:" #: share/isodumper/isodumper.glade.h:46 msgid "Select an image file to be written to the device" msgstr "Odaberite datoteku slike za zaspis na uređaj" #: share/isodumper/isodumper.glade.h:47 msgid "Select Image" msgstr "Odaberi sliku" #: share/isodumper/isodumper.glade.h:48 msgid "For UEFI boot" msgstr "" #: share/isodumper/isodumper.glade.h:49 msgid "Use FAT32 format with MGALIVE as volume name." msgstr "" #: share/isodumper/isodumper.glade.h:50 msgid "Write to device" msgstr "Zapiši na uređaj" #: share/isodumper/isodumper.glade.h:51 msgid "Create a backup of the device as image to restore it later" msgstr "" #: share/isodumper/isodumper.glade.h:54 msgid "(None)" msgstr "" #: share/isodumper/isodumper.glade.h:55 msgid "Select a folder in which to write the backup image" msgstr "" #: share/isodumper/isodumper.glade.h:56 msgid "Backup the device" msgstr "" #: share/isodumper/isodumper.glade.h:57 msgid "Format the device in FAT, NTFS or ext:" msgstr "" #: share/isodumper/isodumper.glade.h:58 msgid "Choose the format. The device will be formatted in one partition" msgstr "" #: share/isodumper/isodumper.glade.h:59 msgid "Format the device" msgstr "" #: share/isodumper/isodumper.glade.h:60 msgid "Details" msgstr "Pojedinosti" #: share/isodumper/isodumper.glade.h:61 msgid "" "Warning\n" " No target devices were found. \n" "\n" " You need to plug in a USB Key\n" " to which the image can be written." msgstr "" #: share/isodumper/isodumper.glade.h:66 msgid "" "Success\n" " The operation was successfully performed.\n" " \n" " You are free to unplug it now, a log isodumper.log \n" " of the operation will be saved in your homedir/.isodumper/ when\n" " you close the application." msgstr "" #~ msgid "" #~ "Success\n" #~ " The image was successfully written to the\n" #~ " target device.\n" #~ " \n" #~ " You are free to unplug it now, a log isodumper.log \n" #~ " of the operation will be saved in your homedir/.isodumper/ when\n" #~ " you close the application." #~ msgstr "" #~ "Slika uspješno zapisana\n" #~ " Slika je uspješno zapisana\n" #~ " na uređaj zapisivanja.\n" #~ " \n" #~ " Sada možete odspojiti vaš USB, zapis radnji\n" #~ " biti će spremljen u Osobnoj mapi\n" #~ " ako zatvorite aplikaciju." #~ msgid "" #~ "Error\n" #~ " Something went wrong, please see the details\n" #~ " window for the exact error.\n" #~ " \n" #~ " A logfile isodumper.log with the content will be saved in your\n" #~ " homedir/.isodumper when the application is closed." #~ msgstr "" #~ "Greška\n" #~ " Nešto je krenulo po zlu, pogledajte\n" #~ " prozor pojedinosti za točnu grešku.\n" #~ " \n" #~ " Datoteka zapisa sa sadržajem biti će spremljena u\n" #~ " vašu Osobnu mapu ako se aplikacija zatvori." #~ msgid "to" #~ msgstr "u" #~ msgid "" #~ "Error\n" #~ " No target devices were found. \n" #~ "\n" #~ " You need to plug in a USB Key\n" #~ " to which the image can be written." #~ msgstr "" #~ "Greška\n" #~ " Nema pronađenih uređaja zapisivanja. \n" #~ "\n" #~ " Morate spojiti USB uređaj\n" #~ " na koji slika može biti zapisana." #~ msgid "The dd process ended with an error !" #~ msgstr "'dd' radnja je završila greškom!" #~ msgid "ImageWriter" #~ msgstr "Zapisnik slika" #~ msgid "gtk-cancel" #~ msgstr "Poništi zapisivanje" #~ msgid "gtk-close" #~ msgstr "Zatvori" #~ msgid "gtk-ok" #~ msgstr "U redu" #~ msgid " " #~ msgstr " " #~ msgid "Image: " #~ msgstr "Slika: " 187'>187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815
package partition_table; # $Id$

use diagnostics;
use strict;
use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @important_types @important_types2 @fields2save @bad_types);

@ISA = qw(Exporter);
%EXPORT_TAGS = (
    types => [ qw(type2name type2fs name2type fs2type isExtended isExt2 isThisFs isTrueFS isSwap isDos isWin isFat isFat_or_NTFS isSunOS isOtherAvailableFS isPrimary isRawLVM isRawRAID isRAID isLVM isMountableRW isNonMountable isPartOfLVM isPartOfRAID isPartOfLoopback isLoopback isMounted isBusy isSpecial maybeFormatted isApple isAppleBootstrap) ],
);
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;


use common;
use partition_table::raw;
use detect_devices;
use log;

@important_types = ('Linux native', 'Linux swap', 
		    if_(arch() =~ /i.86/, 'Journalised FS: ext3', 'Journalised FS: ReiserFS', 'Journalised FS: JFS', 'Journalised FS: XFS', 'DOS FAT16', 'FAT32'),
			if_(arch() =~ /ia64/, 'Journalised FS: ext3', 'Journalised FS: ReiserFS', 'Journalised FS: XFS', 'FAT32'),
		    if_(arch() =~ /ppc/, 'Journalised FS: ext3', 'Journalised FS: ReiserFS', 'Journalised FS: JFS', 'Journalised FS: XFS', 'Apple HFS Partition', 'Apple Bootstrap'));
@important_types2 = ('Linux RAID', 'Linux Logical Volume Manager partition');

@fields2save = qw(primary extended totalsectors isDirty needKernelReread);

@bad_types = ('Empty', 'DOS 3.3+ Extended Partition', 'Win95: Extended partition, LBA-mapped', 'Linux extended partition');

my %types = (
  0x0 => 'Empty',
if_(arch() =~ /^ppc/, 
  0x183 => 'Journalised FS: ReiserFS',
  0x283 => 'Journalised FS: XFS',
  0x383 => 'Journalised FS: JFS',
  0x483 => 'Journalised FS: ext3',
  0x401	=> 'Apple Partition',
  0x401	=> 'Apple Bootstrap',
  0x402	=> 'Apple HFS Partition',
), if_(arch() =~ /^i.86/,
  0x107 => 'NTFS',
  0x183 => 'Journalised FS: ReiserFS',
  0x283 => 'Journalised FS: XFS',
  0x383 => 'Journalised FS: JFS',
  0x483 => 'Journalised FS: ext3',
), if_(arch() =~ /^ia64/,
  0x100 => 'Various',
  0x183 => 'Journalised FS: ReiserFS',
  0x283 => 'Journalised FS: XFS',
  0x483 => 'Journalised FS: ext3',
), if_(arch() =~ /^sparc/,
  0x1 => 'SunOS boot',
  0x2 => 'SunOS root',
  0x3 => 'SunOS swap',
  0x4 => 'SunOS usr',
  0x5 => 'Whole disk',
  0x6 => 'SunOS stand',
  0x7 => 'SunOS var',
  0x8 => 'SunOS home',
), if_(arch() =~ /^i.86/,
  0x1 => 'DOS 12-bit FAT',
  0x2 => 'XENIX root',
  0x3 => 'XENIX /usr',
  0x4 => 'DOS 16-bit FAT (up to 32M)',
  0x5 => 'DOS 3.3+ Extended Partition',
  0x6 => 'DOS FAT16',
  0x7 => 'NTFS (or HPFS)',
  0x8 => 'OS/2 (v1.0-1.3 only) / AIX boot partition / SplitDrive / Commodore DOS / DELL partition spanning multiple drives / QNX 1.x and 2.x ("qny")',
),
  0x9 => 'AIX data partition / Coherent filesystem / QNX 1.x and 2.x ("qnz")',
  0xa => 'OS/2 Boot Manager / Coherent swap partition / OPUS',
  0xb => 'FAT32',
  0xc => 'Win98 FAT32, LBA-mapped',
  0xe => 'Win95: DOS 16-bit FAT, LBA-mapped',
  0xf => 'Win95: Extended partition, LBA-mapped',
  0x10 => 'OPUS (?)',
  0x11 => 'Hidden DOS 12-bit FAT',
  0x12 => 'Compaq/HP config partition',
  0x14 => 'Hidden DOS 16-bit FAT <32M',
  0x16 => 'Hidden DOS 16-bit FAT >=32M',
  0x17 => 'Hidden IFS (e.g., HPFS)',
  0x18 => 'AST Windows swapfile',
  0x1b => 'Hidden WIN95 OSR2 32-bit FAT',
  0x1c => 'Hidden WIN95 OSR2 32-bit FAT, LBA-mapped',
  0x1e => 'Hidden FAT95',
  0x22 => 'Used for Oxygen Extended Partition Table by ekstazya@sprint.ca.',
  0x24 => 'NEC DOS 3.x',
  0x35 => 'JFS (OS/2)',
  0x38 => 'THEOS ver 3.2 2gb partition',
  0x39 => 'THEOS ver 4 spanned partition',
  0x3a => 'THEOS ver 4 4gb partition',
  0x3b => 'THEOS ver 4 extended partition',
  0x3c => 'PartitionMagic recovery partition',
  0x40 => 'Venix 80286',
  0x41 => 'Linux/MINIX (sharing disk with DRDOS) / Personal RISC Boot / PPC PReP (Power PC Reference Platform) Boot',
  0x42 => 'Windows Dynamic Partition',
  0x43 => 'Linux native (sharing disk with DRDOS)',
  0x45 => 'EUMEL/Elan',
  0x46 => 'EUMEL/Elan 0x46',
  0x47 => 'EUMEL/Elan 0x47',
  0x48 => 'EUMEL/Elan 0x48',
  0x4d => 'QNX4.x',
  0x4e => 'QNX4.x 2nd part',
  0x4f => 'QNX4.x 3rd part / Oberon partition',
  0x50 => 'OnTrack Disk Manager (older versions) RO',
  0x51 => 'OnTrack Disk Manager RW (DM6 Aux1) / Novell',
  0x52 => 'CP/M / Microport SysV/AT',
  0x53 => 'Disk Manager 6.0 Aux3',
  0x54 => 'Disk Manager 6.0 Dynamic Drive Overlay',
  0x55 => 'EZ-Drive',
  0x56 => 'Golden Bow VFeature Partitioned Volume. / DM converted to EZ-BIOS',
  0x57 => 'DrivePro',
  0x5c => 'Priam EDisk',
  0x61 => 'SpeedStor',
  0x63 => 'Unix System V (SCO, ISC Unix, UnixWare, ...), Mach, GNU Hurd',
  0x64 => 'PC-ARMOUR protected partition / Novell Netware 2.xx',
  0x65 => 'Novell Netware 3.xx or 4.xx',
  0x67 => 'Novell',
  0x68 => 'Novell 0x68',
  0x69 => 'Novell 0x69',
  0x70 => 'DiskSecure Multi-Boot',
  0x75 => 'IBM PC/IX',
  0x80 => 'MINIX until 1.4a',
  0x81 => 'MINIX since 1.4b, early Linux / Mitac disk manager',
  0x82 => 'Linux swap',
  0x83 => 'Linux native',
  0x84 => 'OS/2 hidden C: drive / Hibernation partition',
  0x85 => 'Linux extended partition',
  0x86 => 'Old Linux RAID partition superblock / NTFS volume set',
  0x87 => 'NTFS volume set',
  0x8a => 'Linux Kernel Partition (used by AiR-BOOT)',
  0x8e => 'Linux Logical Volume Manager partition',
  0x93 => 'Amoeba',
  0x94 => 'Amoeba bad block table',
  0x99 => 'DCE376 logical drive',
  0xa0 => 'IBM Thinkpad hibernation partition / Phoenix NoteBIOS Power Management "Save-to-Disk" partition',
  0xa5 => 'BSD/386, 386BSD, NetBSD, FreeBSD',
  0xa6 => 'OpenBSD',
  0xa7 => 'NEXTSTEP',
  0xa9 => 'NetBSD',
  0xaa => 'Olivetti Fat 12 1.44Mb Service Partition',
  0xb7 => 'BSDI filesystem',
  0xb8 => 'BSDI swap partition',
  0xbe => 'Solaris boot partition',
  0xc0 => 'CTOS / REAL/32 secure small partition',
  0xc1 => 'DRDOS/secured (FAT-12)',
  0xc4 => 'DRDOS/secured (FAT-16, < 32M)',
  0xc6 => 'DRDOS/secured (FAT-16, >= 32M) / Windows NT corrupted FAT16 volume/stripe set',
  0xc7 => 'Windows NT corrupted NTFS volume/stripe set / Syrinx boot',
  0xcb => 'reserved for DRDOS/secured (FAT32)',
  0xcc => 'reserved for DRDOS/secured (FAT32, LBA)',
  0xcd => 'CTOS Memdump?',
  0xce => 'reserved for DRDOS/secured (FAT16, LBA)',
  0xd0 => 'REAL/32 secure big partition',
  0xd1 => 'Old Multiuser DOS secured FAT12',
  0xd4 => 'Old Multiuser DOS secured FAT16 <32M',
  0xd5 => 'Old Multiuser DOS secured extended partition',
  0xd6 => 'Old Multiuser DOS secured FAT16 >=32M',
  0xd8 => 'CP/M-86',
  0xdb => 'Digital Research CP/M, Concurrent CP/M, Concurrent DOS / CTOS (Convergent Technologies OS -Unisys) / KDG Telemetry SCPU boot',
  0xdd => 'Hidden CTOS Memdump?',
  0xe1 => 'DOS access or SpeedStor 12-bit FAT extended partition',
  0xe3 => 'DOS R/O or SpeedStor',
  0xe4 => 'SpeedStor 16-bit FAT extended partition < 1024 cyl.',
  0xeb => 'BeOS',
  0xee => 'EFI GPT',
  0xef => 'EFI (FAT-12/16/32)',
  0xf1 => 'SpeedStor 0xf1',
  0xf2 => 'DOS 3.3+ secondary partition',
  0xf4 => 'SpeedStor large partition / Prologue single-volume partition',
  0xf5 => 'Prologue multi-volume partition',
  0xfd => 'Linux RAID',
  0xfe => 'SpeedStor > 1024 cyl. or LANstep / IBM PS/2 IML (Initial Microcode Load) partition, located at the end of the disk. / Windows NT Disk Administrator hidden partition / Linux Logical Volume Manager partition (old)',
  0xff => 'Xenix Bad Block Table',
);

my %type2fs = (
arch() =~ /^ppc/ ? (
  0x07 => 'hpfs',
) : (
  0x07 => 'ntfs',
),
arch() !~ /sparc/ ? (
  0x01 => 'vfat',
  0x04 => 'vfat',
  0x05 => 'ignore',
  0x06 => 'vfat',
) : (
  0x01 => 'ufs',
  0x02 => 'ufs',
  0x04 => 'ufs',
  0x06 => 'ufs',
  0x07 => 'ufs',
  0x08 => 'ufs',
),
  0x0b => 'vfat',
  0x0c => 'vfat',
  0x0e => 'vfat',
  0x1b => 'vfat',
  0x1c => 'vfat',
  0x1e => 'vfat',
  0x82 => 'swap',
  0x83 => 'ext2',
  0x107 => 'ntfs',
  0x183 => 'reiserfs',
  0x283 => 'xfs',
  0x383 => 'jfs',
  0x483 => 'ext3',
  0x401 => 'apple',
  0x402 => 'hfs',
);

my %types_rev = reverse %types;
my %fs2type = reverse %type2fs;


1;

sub important_types() { 
    my @l = (@important_types, if_($::expert, @important_types2, sort values %types));
    difference2(\@l, \@bad_types);
}

sub type2fs { $type2fs{$_[0]{type}} || $_[0]{type} }
sub fs2type { $fs2type{$_[0]} || $_[0] }
sub type2name { $types{$_[0]} || $_[0] }
sub name2type { 
    local ($_) = @_;
    /0x(.*)/ ? hex $1 : $types_rev{$_} || $_;
}

sub isWholedisk { arch() =~ /^sparc/ && $_[0]{type} == 5 }
sub isExtended { arch() !~ /^sparc/ && ($_[0]{type} == 5 || $_[0]{type} == 0xf || $_[0]{type} == 0x85) }
sub isRawLVM { $_[0]{type} == 0x8e }
sub isRawRAID { $_[0]{type} == 0xfd }
sub isSwap { type2fs($_[0]) eq 'swap' }
sub isExt2 { type2fs($_[0]) eq 'ext2' }
sub isDos { arch() !~ /^sparc/ && ${{ 1 => 1, 4 => 1, 6 => 1 }}{$_[0]{type}} }
sub isWin { ${{ 0xb => 1, 0xc => 1, 0xe => 1, 0x1b => 1, 0x1c => 1, 0x1e => 1 }}{$_[0]{type}} }
sub isFat { isDos($_[0]) || isWin($_[0]) }
sub isFat_or_NTFS { isDos($_[0]) || isWin($_[0]) || $_[0]{type} == 0x107 }
sub isSunOS { arch() =~ /sparc/ && ${{ 0x1 => 1, 0x2 => 1, 0x4 => 1, 0x6 => 1, 0x7 => 1, 0x8 => 1 }}{$_[0]{type}} }
sub isApple { type2fs($_[0]) eq 'apple' && defined $_[0]{isDriver} }
sub isAppleBootstrap { type2fs($_[0]) eq 'apple' && defined $_[0]{isBoot} }
sub isHiddenMacPart { defined $_[0]{isMap} }

sub isThisFs { type2fs($_[1]) eq $_[0] }
sub isTrueFS { member(type2fs($_[0]), qw(ext2 reiserfs xfs jfs ext3)) }

sub isOtherAvailableFS { isFat_or_NTFS($_[0]) || isSunOS($_[0]) || isThisFs('hfs', $_[0]) } #- other OS that linux can access its filesystem
sub isMountableRW { (isTrueFS($_[0]) || isOtherAvailableFS($_[0])) && !isThisFs('ntfs', $_[0]) }
sub isNonMountable { 
    my ($part) = @_;
    isRawRAID($part) || isRawLVM($part) || isThisFs("ntfs", $part) && !$part->{isFormatted} && $part->{notFormatted};
}

sub isPartOfLVM { defined $_[0]{lvm} }
sub isPartOfRAID { defined $_[0]{raid} }
sub isPartOfLoopback { defined $_[0]{loopback} }
sub isRAID { $_[0]{device} =~ /^md/ }
sub isUBD { $_[0]{device} =~ /^ubd/ } #- should be always true during an $::uml_install
sub isLVM { $_[0]{VG_name} }
sub isLoopback { defined $_[0]{loopback_file} }
sub isMounted { $_[0]{isMounted} }
sub isBusy { isMounted($_[0]) || isPartOfRAID($_[0]) || isPartOfLVM($_[0]) || isPartOfLoopback($_[0]) }
sub isSpecial { isRAID($_[0]) || isLVM($_[0]) || isLoopback($_[0]) || isUBD($_[0]) }
sub maybeFormatted { $_[0]{isFormatted} || !$_[0]{notFormatted} }


#- works for both hard drives and partitions ;p
sub description {
    my ($hd) = @_;
    my $win = $hd->{device_windobe};

    sprintf "%s%s (%s%s%s%s)", 
      $hd->{device}, 
      $win && " [$win:]", 
      formatXiB($hd->{totalsectors} || $hd->{size}, 512),
      $hd->{info} && ", $hd->{info}",
      $hd->{mntpoint} && ", " . $hd->{mntpoint},
      $hd->{type} && ", " . type2name($hd->{type});
}

sub isPrimary {
    my ($part, $hd) = @_;
    foreach (@{$hd->{primary}{raw}}) { $part eq $_ and return 1 }
    0;
}

sub adjustStartAndEnd {
    my ($hd, $part) = @_;

    $hd->adjustStart($part);
    $hd->adjustEnd($part);
}

sub verifyNotOverlap {
    my ($a, $b) = @_;
    $a->{start} + $a->{size} <= $b->{start} || $b->{start} + $b->{size} <= $a->{start};
}
sub verifyInside {
    my ($a, $b) = @_;
    $b->{start} <= $a->{start} && $a->{start} + $a->{size} <= $b->{start} + $b->{size};
}

sub verifyParts_ {
    foreach my $i (@_) {
	foreach (@_) {
	    next if !$i || !$_ || $i == $_ || isWholedisk($i) || isExtended($i); #- avoid testing twice for simplicity :-)
	    if (isWholedisk($_)) {
		verifyInside($i, $_) or
		  cdie sprintf("partition sector #$i->{start} (%s) is not inside whole disk (%s)!",
			       formatXiB($i->{size}, 512), formatXiB($_->{size}, 512));
	    } elsif (isExtended($_)) {
		verifyNotOverlap($i, $_) or
		  log::l(sprintf("warning partition sector #$i->{start} (%s) is overlapping with extended partition!",
				 formatXiB($i->{size}, 512))); #- only warning for this one is acceptable
	    } else {
		verifyNotOverlap($i, $_) or
		  cdie sprintf("partitions sector #$i->{start} (%s) and sector #$_->{start} (%s) are overlapping!",
			       formatXiB($i->{size}, 512), formatXiB($_->{size}, 512));
	    }
	}
    }
}
sub verifyParts {
    my ($hd) = @_;
    verifyParts_(get_normal_parts($hd));
}
sub verifyPrimary {
    my ($pt) = @_;
    $_->{start} > 0 || arch() =~ /^sparc/ || die "partition must NOT start at sector 0" foreach @{$pt->{normal}};
    verifyParts_(@{$pt->{normal}}, $pt->{extended});
}

sub assign_device_numbers {
    my ($hd) = @_;

    my $i = 1;
    my $start = 1; 
    
    #- on PPC we need to assign device numbers to the holes too - big FUN!
    #- not if it's an IBM machine using a DOS partition table though
    if (arch() =~ /ppc/ && detect_devices::get_mac_model() !~ /^IBM/) {
	#- first sort the normal parts
	$hd->{primary}{normal} = [ sort { $a->{start} <=> $b->{start} } @{$hd->{primary}{normal}} ];
    
	#- now loop through them, assigning partition numbers - reserve one for the holes
	foreach (@{$hd->{primary}{normal}}) {
	    if ($_->{start} > $start) {
		log::l("PPC: found a hole on $hd->{prefix} before $_->{start}, skipping device..."); 
		$i++;
	    }
	    $_->{device} = $hd->{prefix} . $i;
	    $_->{devfs_device} = $hd->{devfs_prefix} . '/part' . $i;
	    $start = $_->{start} + $_->{size};
	    $i++;
	}
    } else {
	foreach (@{$hd->{primary}{raw}}) {
	    $_->{device} = $hd->{prefix} . $i;
	    $_->{devfs_device} = $hd->{devfs_prefix} . '/part' . $i;
	    $i++;
	}
	foreach (map { $_->{normal} } @{$hd->{extended} || []}) {
	    my $dev = $hd->{prefix} . $i;
	    push @{$hd->{partitionsRenumbered}}, [ $_->{device}, $dev ] if $_->{device} && $dev ne $_->{device};
	    $_->{device} = $dev;
	    $_->{devfs_device} = $hd->{devfs_prefix} . '/part' . $i;
	    $i++;
	}
    }

    #- try to figure what the windobe drive letter could be!
    #
    #- first verify there's at least one primary dos partition, otherwise it
    #- means it is a secondary disk and all will be false :(
    #-
    #- isFat_or_NTFS isn't true for 0x7 partitions, only for 0x107.
    #- alas 0x107 is not set correctly at this stage
    #- solution: don't bother with 0x7 vs 0x107 here
    my ($c, @others) = grep { isFat_or_NTFS($_) || $_->{type} == 0x7 } @{$hd->{primary}{normal}};

    $i = ord 'C';
    $c->{device_windobe} = chr($i++) if $c;
    $_->{device_windobe} = chr($i++) foreach grep { isFat_or_NTFS($_) || $_->{type} == 0x7 } map { $_->{normal} } @{$hd->{extended}};
    $_->{device_windobe} = chr($i++) foreach @others;
}

sub remove_empty_extended {
    my ($hd) = @_;
    my $last = $hd->{primary}{extended} or return;
    @{$hd->{extended}} = grep {
	if ($_->{normal}) {
	    $last = $_;
	} else {
	    %{$last->{extended}} = $_->{extended} ? %{$_->{extended}} : ();
	}
	$_->{normal};
    } @{$hd->{extended}};
    adjust_main_extended($hd);
}

sub adjust_main_extended {
    my ($hd) = @_;

    if (!is_empty_array_ref $hd->{extended}) {
	my ($l, @l) = @{$hd->{extended}};

	# the first is a special case, must recompute its real size
	my $start = round_down($l->{normal}{start} - 1, $hd->{geom}{sectors});
	my $end = $l->{normal}{start} + $l->{normal}{size};
	my $only_linux = 1; my $has_win_lba = 0;
	foreach (map { $_->{normal} } $l, @l) {
	    $start = min($start, $_->{start});
	    $end = max($end, $_->{start} + $_->{size});
	    $only_linux &&= isTrueFS($_) || isSwap($_);
	    $has_win_lba ||= $_->{type} == 0xc || $_->{type} == 0xe;
	}
	$l->{start} = $hd->{primary}{extended}{start} = $start;
	$l->{size} = $hd->{primary}{extended}{size} = $end - $start;
    }
    if (!@{$hd->{extended} || []} && $hd->{primary}{extended}) {
	%{$hd->{primary}{extended}} = (); #- modify the raw entry
	delete $hd->{primary}{extended};
    }
    verifyParts($hd); #- verify everything is all right
}

sub adjust_local_extended {
    my ($hd, $part) = @_;

    my $extended = find { $_->{normal} == $part } @{$hd->{extended} || []} or return;
    $extended->{size} = $part->{size} + $part->{start} - $extended->{start};

    #- must write it there too because values are not shared
    my $prev = find { $_->{extended}{start} == $extended->{start} } @{$hd->{extended} || []} or return;
    $prev->{extended}{size} = $part->{size} + $part->{start} - $prev->{extended}{start};
}

sub get_normal_parts {
    my ($hd) = @_;

    @{$hd->{primary}{normal} || []}, map { $_->{normal} } @{$hd->{extended} || []}
}

sub get_normal_parts_and_holes {
    my ($hd) = @_;
    my ($start, $last) = ($hd->first_usable_sector, $hd->last_usable_sector);

    ref($hd) or print("get_normal_parts_and_holes: bad hd" . backtrace(), "\n");

    my @l = map {
	my $current = $start;
	$start = $_->{start} + $_->{size};
	my $hole = { start => $current, size => $_->{start} - $current, type => 0, rootDevice => $hd->{device} };
	$hole, $_;
    } sort { $a->{start} <=> $b->{start} } grep { !isWholedisk($_) } get_normal_parts($hd);

    push @l, { start => $start, size => $last - $start, type => 0, rootDevice => $hd->{device} };