From 1d8347ff685c50364932f1b2e720a4a97c7d550c Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 23 Jul 2004 04:01:00 +0000 Subject: - simplify partition table entry names (based on fdisk's names) - rename some internal variables --- perl-install/partition_table.pm | 213 +++++++++++++++++++--------------------- 1 file changed, 100 insertions(+), 113 deletions(-) (limited to 'perl-install/partition_table.pm') diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index f3a598ffd..3f6243ebe 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -22,13 +22,13 @@ use log; if_(arch() =~ /ia64/, 'Journalised FS: XFS', 'FAT32'), if_(arch() =~ /x86_64/, 'FAT32'), ); -@important_types2 = ('Linux RAID', 'Linux Logical Volume Manager partition'); +@important_types2 = ('Linux RAID', 'Linux Logical Volume Manager'); @fields2save = qw(primary extended totalsectors isDirty will_tell_kernel); -@bad_types = ('Empty', 'DOS 3.3+ Extended Partition', 'Win95: Extended partition, LBA-mapped', 'Linux extended partition'); +@bad_types = ('Empty', 'Extended', 'W95 Extended (LBA)', 'Linux extended'); -my %pt_types = ( +my %pt_type2name = ( 0x0 => 'Empty', if_(arch() =~ /^ppc/, 0x183 => 'Journalised FS: ReiserFS', @@ -53,129 +53,112 @@ if_(arch() =~ /^ppc/, 0x183 => 'Journalised FS: ReiserFS', 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', + 0x01 => 'SunOS boot', + 0x02 => 'SunOS root', + 0x03 => 'SunOS swap', + 0x04 => 'SunOS usr', + 0x05 => 'Whole disk', + 0x06 => 'SunOS stand', + 0x07 => 'SunOS var', + 0x08 => '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")', + 0x01 => 'FAT12', + 0x02 => 'XENIX root', + 0x03 => 'XENIX usr', + 0x04 => 'FAT16 <32M', + 0x05 => 'Extended', + 0x06 => 'FAT16', + 0x07 => 'NTFS (or HPFS)', + 0x08 => 'AIX', ), - 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', + 0x09 => 'AIX bootable', + 0x0a => 'OS/2 Boot Manager', + 0x0b => 'FAT32', + 0x0c => 'W95 FAT32 (LBA)', + 0x0e => 'W95 FAT16 (LBA)', + 0x0f => 'W95 Extended (LBA)', + 0x10 => 'OPUS', + 0x11 => 'Hidden FAT12', + 0x12 => 'Compaq diagnostics', + 0x14 => 'Hidden FAT16 <32M', + 0x16 => 'Hidden FAT16', + 0x17 => 'Hidden HPFS/NTFS', + 0x18 => 'AST SmartSleep', + 0x1b => 'Hidden W95 FAT32', + + 0x1c => 'Hidden W95 FAT32 (LBA)', + 0x1e => 'Hidden W95 FAT16 (LBA)', + 0x24 => 'NEC DOS', + 0x39 => 'Plan 9', + 0x3c => 'PartitionMagic recovery', 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', + 0x41 => 'PPC PReP Boot', + 0x42 => 'SFS', 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', + 0x4f => 'QNX4.x 3rd part', + + 0x50 => 'OnTrack DM', + 0x51 => 'OnTrack DM6 Aux1', + 0x52 => 'CP/M', + 0x53 => 'OnTrack DM6 Aux3', + 0x54 => 'OnTrackDM6', 0x55 => 'EZ-Drive', - 0x56 => 'Golden Bow VFeature Partitioned Volume. / DM converted to EZ-BIOS', - 0x57 => 'DrivePro', - 0x5c => 'Priam EDisk', + 0x56 => 'Golden Bow', + 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', + 0x63 => 'GNU HURD or SysV', + 0x64 => 'Novell Netware 286', + 0x65 => 'Novell Netware 386', 0x70 => 'DiskSecure Multi-Boot', - 0x75 => 'IBM PC/IX', - 0x80 => 'MINIX until 1.4a', - 0x81 => 'MINIX since 1.4b, early Linux / Mitac disk manager', + 0x75 => 'PC/IX', + 0x80 => 'Old Minix', + 0x81 => 'Minix / old Linux', + + 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', + + 0x84 => 'OS/2 hidden C: drive', + 0x85 => 'Linux extended', + 0x86 => 'NTFS volume set', 0x87 => 'NTFS volume set', - 0x8a => 'Linux Kernel Partition (used by AiR-BOOT)', - 0x8e => 'Linux Logical Volume Manager partition', + 0x8e => 'Linux Logical Volume Manager', 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', + 0x94 => 'Amoeba BBT', + 0x9f => 'BSD/OS', + 0xa0 => 'IBM Thinkpad hibernation', + 0xa5 => 'FreeBSD', 0xa6 => 'OpenBSD', - 0xa7 => 'NEXTSTEP', + 0xa7 => 'NeXTSTEP', + 0xa8 => 'Darwin UFS', 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', + 0xab => 'Darwin boot', + 0xb7 => 'BSDI fs', + 0xb8 => 'BSDI swap', + 0xbb => 'Boot Wizard hidden', + 0xbe => 'Solaris boot', + 0xc1 => 'DRDOS/sec (FAT-12)', + 0xc4 => 'DRDOS/sec (FAT-16 < 32M)', + 0xc6 => 'DRDOS/sec (FAT-16)', + 0xc7 => 'Syrinx', + 0xda => 'Non-FS data', + 0xdb => 'CP/M / CTOS / ...', + 0xde => 'Dell Utility', + 0xdf => 'BootIt', + 0xe1 => 'DOS access', + 0xe3 => 'DOS R/O', + 0xe4 => 'SpeedStor', + 0xeb => 'BeOS fs', 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', + 0xf0 => 'Linux/PA-RISC boot', + 0xf1 => 'SpeedStor', + 0xf4 => 'SpeedStor', + 0xf2 => 'DOS secondary', 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', + 0xfe => 'LANstep', + 0xff => 'BBT', ); my %pt_type2fs = ( @@ -216,14 +199,18 @@ arch() !~ /sparc/ ? ( 0x402 => 'hfs', ); -my %pt_types_rev = reverse %pt_types; +my %name2pt_type = reverse %pt_type2name; my %fs2pt_type = reverse %pt_type2fs; + foreach (@important_types, @important_types2, @bad_types) { + exists $name2pt_type{$_} or die "unknown $_\n"; + } + 1; sub important_types() { - my @l = (@important_types, if_($::expert, @important_types2, sort values %pt_types)); + my @l = (@important_types, if_($::expert, @important_types2, sort values %pt_type2name)); difference2(\@l, \@bad_types); } @@ -233,10 +220,10 @@ sub type2fs { $pt_type2fs{$pt_type} || $pt_type =~ /^(\d+)$/ && $o_default || $pt_type; } sub fs2pt_type { $fs2pt_type{$_[0]} || $_[0] } -sub pt_type2name { $pt_types{$_[0]} || $_[0] } +sub pt_type2name { $pt_type2name{$_[0]} || $_[0] } sub name2pt_type { local ($_) = @_; - /0x(.*)/ ? hex $1 : $pt_types_rev{$_} || $_; + /0x(.*)/ ? hex $1 : $name2pt_type{$_} || $_; } #sub name2type { { pt_type => name2pt_type($_[0]) } } -- cgit v1.2.1