summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-30 22:54:49 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-30 22:54:49 +0000
commit4f85b0d92b9246709a53a85b45b15f73c7d97086 (patch)
tree0f62ec68e69cd1619f59fe77a5b572cd3805e7ec
parentc9ae469b014987aab6c76225859028ecffb77659 (diff)
downloaddrakx-backup-do-not-use-4f85b0d92b9246709a53a85b45b15f73c7d97086.tar
drakx-backup-do-not-use-4f85b0d92b9246709a53a85b45b15f73c7d97086.tar.gz
drakx-backup-do-not-use-4f85b0d92b9246709a53a85b45b15f73c7d97086.tar.bz2
drakx-backup-do-not-use-4f85b0d92b9246709a53a85b45b15f73c7d97086.tar.xz
drakx-backup-do-not-use-4f85b0d92b9246709a53a85b45b15f73c7d97086.zip
add isFat_or_NTFS() and use it where possible instead of isFat() since Windows
is now using ntfs, not only Windows NT
-rw-r--r--perl-install/any.pm2
-rw-r--r--perl-install/bootloader.pm6
-rw-r--r--perl-install/diskdrake/hd_gtk.pm5
-rw-r--r--perl-install/fsedit.pm4
-rw-r--r--perl-install/install_any.pm12
-rw-r--r--perl-install/install_interactive.pm2
-rw-r--r--perl-install/install_steps_interactive.pm2
-rw-r--r--perl-install/partition_table.pm12
8 files changed, 18 insertions, 27 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index a2146b6bc..60bca91ec 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -255,7 +255,7 @@ sub setupBootloader__general {
arch() =~ /sparc/ ? (
{ label => N("Bootloader installation"), val => \$b->{use_partition}, list => [ 0, 1 ], format => sub { $silo_install_lang[$_[0]] } },
) : if_(arch() !~ /ia64/,
- { label => N("Boot device"), val => \$b->{boot}, list => [ map { "/dev/$_" } (map { $_->{device} } (@{$all_hds->{hds}}, grep { !isFat($_) } @$fstab)), detect_devices::floppies_dev() ], not_edit => !$::expert },
+ { label => N("Boot device"), val => \$b->{boot}, list => [ map { "/dev/$_" } (map { $_->{device} } (@{$all_hds->{hds}}, grep { !isFat_or_NTFS($_) } @$fstab)), detect_devices::floppies_dev() ], not_edit => !$::expert },
{ label => N("Compact"), val => \$b->{compact}, type => "bool", text => N("compact"), advanced => 1 },
{ label => N("Video mode"), val => \$b->{vga}, list => [ keys %bootloader::vga_modes ], not_edit => !$::expert, format => sub { $bootloader::vga_modes{$_[0]} }, advanced => 1 },
),
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index c286c1457..79e77c87f 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -521,10 +521,10 @@ wait %d seconds for default boot.
my %nbs;
foreach (@$hds) {
foreach (@{$_->{primary}{normal}}) {
- isNT($_) || isFat($_) or next;
+ isFat_or_NTFS($_) or next;
my $from_magic = { type => fsedit::typeOfPart($_->{device}) };
- isNT($from_magic) || isFat($from_magic) or next;
- my $label = isNT($_) ? 'NT' : isDos($_) ? 'dos' : 'windows';
+ isFat_or_NTFS($from_magic) or next;
+ my $label = isDos($_) ? 'dos' : 'windows';
add_entry($bootloader,
{
type => 'other',
diff --git a/perl-install/diskdrake/hd_gtk.pm b/perl-install/diskdrake/hd_gtk.pm
index 593a12831..156f32404 100644
--- a/perl-install/diskdrake/hd_gtk.pm
+++ b/perl-install/diskdrake/hd_gtk.pm
@@ -190,9 +190,8 @@ sub per_entry_action_box {
gtkadd($box, gtkadd(Gtk2::Frame->new(N("Choose action")),
create_scrolled_window(gtkpack__(Gtk2::VBox->new(0,0), @buttons)))) if @buttons;
} else {
- my $txt = !$::isStandalone && fsedit::is_one_big_fat($all_hds->{hds}) ?
-N("You have one big FAT partition
-(generally used by MicroSoft Dos/Windows).
+ my $txt = !$::isStandalone && fsedit::is_one_big_fat_or_NT($all_hds->{hds}) ?
+N("You have one big MicroSoft Windows partition.
I suggest you first resize that partition
(click on it, then click on \"Resize\")") : N("Please click on a partition");
gtkpack($box, gtktext_insert(Gtk2::TextView->new, $txt));
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index ae8ce61f1..62196cd34 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -386,12 +386,12 @@ sub free_space {
sum map { $_->{size} } get_holes(@_);
}
-sub is_one_big_fat {
+sub is_one_big_fat_or_NT {
my ($hds) = @_;
@$hds == 1 or return;
my @l = get_fstab(@$hds);
- @l == 1 && isFat($l[0]) && free_space(@$hds) < 10 << 11;
+ @l == 1 && isFat_or_NTFS($l[0]) && free_space(@$hds) < 10 << 11;
}
sub file2part {
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index b2d8ed0b7..96ee9411d 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -287,7 +287,7 @@ sub preConfigureTimezone {
$o->{timezone}{timezone} ||= timezone::bestTimezone(lang::lang2text($o->{lang}));
- my $utc = every { !isFat($_) && !isNT($_) } @{$o->{fstab}};
+ my $utc = every { !isFat_or_NTFS($_) } @{$o->{fstab}};
my $ntp = timezone::ntp_server($o->{prefix});
add2hash_($o->{timezone}, { UTC => $utc, ntp => $ntp });
}
@@ -1005,7 +1005,7 @@ sub getHds {
$o->{fstab} = [ fsedit::get_all_fstab($all_hds) ];
fs::merge_info_from_mtab($o->{fstab});
- my @win = grep { isFat($_) && isFat({ type => fsedit::typeOfPart($_->{device}) }) } @{$o->{fstab}};
+ my @win = grep { isFat_or_NTFS($_) && isFAT_or_NTFS({ type => fsedit::typeOfPart($_->{device}) }) } @{$o->{fstab}};
log::l("win parts: ", join ",", map { $_->{device} } @win) if @win;
if (@win == 1) {
#- Suggest /boot/efi on ia64.
@@ -1017,14 +1017,6 @@ sub getHds {
}
}
- {
- my @nt = grep { isNT($_) && isNT({ type => fsedit::typeOfPart($_->{device}) }) } @{$o->{fstab}};
- log::l("nt parts: ", join ",", map { $_->{device} } @nt) if @nt;
- my $i; foreach (@nt) {
- $_->{mntpoint} = $_->{unsafeMntpoint} = "/mnt/nt" . ($i++ ? $i : '');
- }
- }
-
my @sunos = grep { isSunOS($_) && type2name($_->{type}) =~ /root/i } @{$o->{fstab}}; #- take only into account root partitions.
if (@sunos) {
my $v = '';
diff --git a/perl-install/install_interactive.pm b/perl-install/install_interactive.pm
index 316f57031..6acece384 100644
--- a/perl-install/install_interactive.pm
+++ b/perl-install/install_interactive.pm
@@ -180,7 +180,7 @@ When sure, press Ok.")) or return;
if (@$fstab && @hds_rw) {
$solutions{wipe_drive} =
- [ 10, fsedit::is_one_big_fat($hds) ? N("Remove Windows(TM)") : N("Erase entire disk"),
+ [ 10, fsedit::is_one_big_fat_or_NT($hds) ? N("Remove Windows(TM)") : N("Erase entire disk"),
sub {
$o->set_help('takeOverHdChoose');
my $hd = $o->ask_from_listf('', N("You have more than one hard drive, which one do you install linux on?"),
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index b3f374446..5cffc7c15 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -294,7 +294,7 @@ sub choosePartitionsToFormat {
my @l = grep { !$_->{isMounted} && $_->{mntpoint} &&
(!isSwap($_) || $::expert) &&
- (!isFat($_) && !isNT($_) || $_->{notFormatted} || $::expert) &&
+ (!isFat_or_NTFS($_) || $_->{notFormatted} || $::expert) &&
(!isOtherAvailableFS($_) || $::expert || $_->{toFormat})
} @$fstab;
$_->{toFormat} = 1 foreach grep { isSwap($_) && !$::expert } @$fstab;
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 53e405da6..e40327a00 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -6,7 +6,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @important_types @important_types2 @fie
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- types => [ qw(type2name type2fs name2type fs2type isExtended isExt2 isThisFs isTrueFS isSwap isDos isWin isFat isSunOS isOtherAvailableFS isPrimary isRawLVM isRawRAID isRAID isLVM isNT isMountableRW isNonMountable isPartOfLVM isPartOfRAID isPartOfLoopback isLoopback isMounted isBusy isSpecial maybeFormatted isApple isAppleBootstrap) ],
+ 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;
@@ -62,7 +62,7 @@ if_(arch() =~ /^ppc/,
0x4 => 'DOS 16-bit FAT (up to 32M)',
0x5 => 'DOS 3.3+ Extended Partition',
0x6 => 'DOS FAT16',
- 0x7 => 'NTFS (or HPFS)',
+ 0x7 => 'NTFS',
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")',
@@ -235,8 +235,8 @@ 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} == 0x7 }
sub isSunOS { arch() =~ /sparc/ && ${{ 0x1 => 1, 0x2 => 1, 0x4 => 1, 0x6 => 1, 0x7 => 1, 0x8 => 1 }}{$_[0]{type}} }
-sub isNT { arch() !~ /^sparc/ && $_[0]{type} == 0x7 }
sub isApple { type2fs($_[0]) eq 'apple' && defined $_[0]{isDriver} }
sub isAppleBootstrap { type2fs($_[0]) eq 'apple' && defined $_[0]{isBoot} }
sub isHiddenMacPart { defined $_[0]{isMap} }
@@ -244,7 +244,7 @@ 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($_[0]) || isSunOS($_[0]) || isThisFs('hfs', $_[0]) || isThisFs('ntfs', $_[0]) } #- other OS that linux can access its filesystem
+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 { isRawRAID($_[0]) || isRawLVM($_[0]) }
@@ -369,11 +369,11 @@ sub assign_device_numbers {
#
#- first verify there's at least one primary dos partition, otherwise it
#- means it is a secondary disk and all will be false :(
- my ($c, @others) = grep { isFat($_) } @{$hd->{primary}{normal}};
+ my ($c, @others) = grep { isFat_or_NTFS($_) } @{$hd->{primary}{normal}};
$i = ord 'C';
$c->{device_windobe} = chr($i++) if $c;
- $_->{device_windobe} = chr($i++) foreach grep { isFat($_) } map { $_->{normal} } @{$hd->{extended}};
+ $_->{device_windobe} = chr($i++) foreach grep { isFat_or_NTFS($_) } map { $_->{normal} } @{$hd->{extended}};
$_->{device_windobe} = chr($i++) foreach @others;
}