summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-03 14:11:58 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-03 14:11:58 +0000
commita0c99bbcd7be82b0733f314e404147cbd5cc69e1 (patch)
treeaa7702f9ceb3ed721d88ee945a4b934964e777bd /perl-install
parenta59816e075d30443a5124dd1787577cc25e5ac22 (diff)
downloaddrakx-a0c99bbcd7be82b0733f314e404147cbd5cc69e1.tar
drakx-a0c99bbcd7be82b0733f314e404147cbd5cc69e1.tar.gz
drakx-a0c99bbcd7be82b0733f314e404147cbd5cc69e1.tar.bz2
drakx-a0c99bbcd7be82b0733f314e404147cbd5cc69e1.tar.xz
drakx-a0c99bbcd7be82b0733f314e404147cbd5cc69e1.zip
- auto allocate: do not create /home if drive is smaller than 7GB
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/diskdrake/interactive.pm1
-rw-r--r--perl-install/fsedit.pm16
-rw-r--r--perl-install/install/NEWS2
3 files changed, 12 insertions, 7 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index 0b5d79a34..07a21c610 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -73,6 +73,7 @@ struct part {
struct part_allocate inherits part {
int maxsize # in sectors (alike "size")
+ int min_hd_size # in sectors (do not allocate if the drive is smaller than the given size)
int ratio #
string hd # 'hda', 'hdc'
string parts # for creating raid partitions. eg: 'foo bar' where 'foo' and 'bar' are mntpoint
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index 6260c9271..5c82a2429 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -22,19 +22,19 @@ use fs;
%suggestions = (
N_("simple") => [
{ mntpoint => "/", size => MB(300), fs_type => 'ext3', ratio => 20, maxsize => MB(8000) },
- { mntpoint => "swap", size => MB(64), fs_type => 'swap', ratio => 1, maxsize => MB(4000) },
- { mntpoint => "/home", size => MB(300), fs_type => 'ext3', ratio => 3 },
+ { mntpoint => "swap", size => MB(128), fs_type => 'swap', ratio => 1, maxsize => MB(4000) },
+ { mntpoint => "/home", size => MB(300), fs_type => 'ext3', ratio => 3, min_hd_size => MB(7000) },
], N_("with /usr") => [
- { mntpoint => "/", size => MB(250), fs_type => 'ext3', ratio => 1, maxsize => MB(4000) },
+ { mntpoint => "/", size => MB(250), fs_type => 'ext3', ratio => 1, maxsize => MB(8000) },
{ mntpoint => "swap", size => MB(64), fs_type => 'swap', ratio => 1, maxsize => MB(4000) },
{ mntpoint => "/usr", size => MB(300), fs_type => 'ext3', ratio => 4, maxsize => MB(8000) },
- { mntpoint => "/home", size => MB(100), fs_type => 'ext3', ratio => 3 },
+ { mntpoint => "/home", size => MB(100), fs_type => 'ext3', ratio => 3, min_hd_size => MB(7000) },
], N_("server") => [
- { mntpoint => "/", size => MB(150), fs_type => 'ext3', ratio => 1, maxsize => MB(4000) },
+ { mntpoint => "/", size => MB(150), fs_type => 'ext3', ratio => 1, maxsize => MB(8000) },
{ mntpoint => "swap", size => MB(64), fs_type => 'swap', ratio => 2, maxsize => MB(4000) },
{ mntpoint => "/usr", size => MB(300), fs_type => 'ext3', ratio => 4, maxsize => MB(8000) },
{ mntpoint => "/var", size => MB(200), fs_type => 'ext3', ratio => 3 },
- { mntpoint => "/home", size => MB(150), fs_type => 'ext3', ratio => 3 },
+ { mntpoint => "/home", size => MB(150), fs_type => 'ext3', ratio => 3, min_hd_size => MB(7000) },
{ mntpoint => "/tmp", size => MB(150), fs_type => 'ext3', ratio => 2, maxsize => MB(4000) },
],
);
@@ -346,10 +346,12 @@ sub suggest_part {
fs::type::set_pt_type($_, $_->{pt_type}) if !exists $_->{fs_type};
}
+ my $hd_size = fs::get::part2hd($part, $all_hds)->{totalsectors};
my $has_swap = any { isSwap($_) } fs::get::fstab($all_hds);
my @local_suggestions =
grep { !$_->{mntpoint} && !$_->{VG_name} || !fs::get::has_mntpoint($_->{mntpoint}, $all_hds) || isSwap($_) && !$has_swap }
+ grep { !$_->{min_hd_size} || $_->{min_hd_size} <= $hd_size }
grep { !$_->{hd} || $_->{hd} eq $part->{rootDevice} }
@$suggestions;
@@ -357,7 +359,7 @@ sub suggest_part {
#- one should rather use {ratio} instead
foreach (@local_suggestions) {
if ($_->{percent_size} && $_->{percent_size} =~ /(.+?)%?$/) {
- $_->{size} = $1 / 100 * fs::get::part2hd($part, $all_hds)->{totalsectors};
+ $_->{size} = $1 / 100 * $hd_size;
log::l("in suggestion, setting size=$_->{size} for percent_size=$_->{percent_size}");
}
}
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 4608a371c..152a07d07 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,5 @@
+- auto allocate: do not create /home if drive is smaller than 7GB
+
Version 10.6.25 - 28 February 2008
- API changes for draklive-install