summaryrefslogtreecommitdiffstats
path: root/perl-install/fsedit.pm
diff options
context:
space:
mode:
authorMystery Man 553 <uid553@mandriva.org>2001-02-12 22:53:38 +0000
committerMystery Man 553 <uid553@mandriva.org>2001-02-12 22:53:38 +0000
commit63a6ace592e76e35c9144a71fa8eb4a21304509f (patch)
treec82f1d44b1df901a46a6547b0e6457bcb289b8c4 /perl-install/fsedit.pm
parentde59da7a96da791314f78c5fa06274bfd480aa13 (diff)
downloaddrakx-backup-do-not-use-63a6ace592e76e35c9144a71fa8eb4a21304509f.tar
drakx-backup-do-not-use-63a6ace592e76e35c9144a71fa8eb4a21304509f.tar.gz
drakx-backup-do-not-use-63a6ace592e76e35c9144a71fa8eb4a21304509f.tar.bz2
drakx-backup-do-not-use-63a6ace592e76e35c9144a71fa8eb4a21304509f.tar.xz
drakx-backup-do-not-use-63a6ace592e76e35c9144a71fa8eb4a21304509f.zip
auto_allocate partitions choice modified. diskdrake in expert asks what kind
of auto_allocation is wanted, others choose 'simple' in %fsedit::suggestions
Diffstat (limited to 'perl-install/fsedit.pm')
-rw-r--r--perl-install/fsedit.pm43
1 files changed, 26 insertions, 17 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index fde649d57..6d321121b 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -2,6 +2,7 @@ package fsedit; # $Id$
use diagnostics;
use strict;
+use vars qw(%suggestions);
#-######################################################################################
#- misc imports
@@ -17,19 +18,28 @@ use loopback;
use log;
use fs;
-#-#####################################################################################
-#- Globals
-#-#####################################################################################
-my @suggestions = (
- { mntpoint => "/boot", size => 16 << 11, type => 0x83, ratio => 1, maxsize => 30 << 11 },
- { mntpoint => "/", size => 50 << 11, type => 0x83, ratio => 1, maxsize => 300 << 11 },
- { mntpoint => "swap", size => 30 << 11, type => 0x82, ratio => 1, maxsize => 250 << 11 },
- { mntpoint => "/usr", size => 200 << 11, type => 0x83, ratio => 6, maxsize =>3000 << 11 },
- { mntpoint => "/home", size => 50 << 11, type => 0x83, ratio => 3 },
- { mntpoint => "/var", size => 200 << 11, type => 0x83, ratio => 1, maxsize =>1000 << 11 },
- { mntpoint => "/tmp", size => 50 << 11, type => 0x83, ratio => 3, maxsize => 500 << 11 },
+%suggestions = (
+ __("simple") => [
+ { mntpoint => "/", size => 300 << 11, type => 0x83, ratio => 5, maxsize =>3500 << 11 },
+ { mntpoint => "swap", size => 64 << 11, type => 0x82, ratio => 1, maxsize => 250 << 11 },
+ { mntpoint => "/home", size => 300 << 11, type => 0x83, ratio => 3 },
+ ], 'with usr' => [
+ { mntpoint => "/", size => 150 << 11, type => 0x83, ratio => 1, maxsize => 500 << 11 },
+ { mntpoint => "swap", size => 64 << 11, type => 0x82, ratio => 1, maxsize => 250 << 11 },
+ { mntpoint => "/usr", size => 300 << 11, type => 0x83, ratio => 4, maxsize =>3000 << 11 },
+ { mntpoint => "/home", size => 100 << 11, type => 0x83, ratio => 5 },
+ ], __("server") => [
+ { mntpoint => "/", size => 150 << 11, type => 0x83, ratio => 1, maxsize => 250 << 11 },
+ { mntpoint => "swap", size => 64 << 11, type => 0x82, ratio => 2, maxsize => 400 << 11 },
+ { mntpoint => "/usr", size => 300 << 11, type => 0x83, ratio => 3, maxsize =>3000 << 11 },
+ { mntpoint => "/var", size => 100 << 11, type => 0x83, ratio => 4 },
+ { mntpoint => "/home", size => 100 << 11, type => 0x83, ratio => 5 },
+ ],
+);
+my @suggestions_mntpoints = (
+ "/root", "/var/ftp", "/var/www",
+ arch() =~ /sparc/ ? "/mnt/sunos" : "/mnt/windows",
);
-my @suggestions_mntpoints = ( "/root", "/var/ftp", "/var/www", arch() =~ /sparc/ ? "/mnt/sunos" : "/mnt/windows" );
my @partitions_signatures = (
[ 0x83, 0x438, "\x53\xEF" ],
@@ -155,8 +165,7 @@ sub computeSize {
sub suggest_part {
my ($part, $hds, $suggestions) = @_;
- $suggestions ||= \@suggestions;
-
+ $suggestions ||= $suggestions{server};
my $has_swap = grep { isSwap($_) } get_fstab(@$hds);
@@ -185,7 +194,7 @@ sub suggest_part {
sub suggestions_mntpoint {
my ($hds) = @_;
sort grep { !/swap/ && !has_mntpoint($_, $hds) }
- (@suggestions_mntpoints, map { $_->{mntpoint} } @suggestions);
+ (@suggestions_mntpoints, map { $_->{mntpoint} } $suggestions{expert});
}
#-sub partitionDrives {
@@ -291,9 +300,9 @@ sub allocatePartitions($$) {
}
}
-sub auto_allocate($;$) {
+sub auto_allocate {
my ($hds, $suggestions) = @_;
- allocatePartitions($hds, $suggestions || \@suggestions);
+ allocatePartitions($hds, $suggestions || $suggestions{simple});
map { partition_table::assign_device_numbers($_) } @$hds;
}