summaryrefslogtreecommitdiffstats
path: root/perl-install/fsedit.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-07-30 20:34:38 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-07-30 20:34:38 +0000
commit91419eac51774d733b905ac2d54b3bde60a208df (patch)
tree80b2b4ebd499f750df5a12a0237bf6ab736619d4 /perl-install/fsedit.pm
parent5ed323fc9a6c7e36a81242fa4a104ba3ea514339 (diff)
downloaddrakx-backup-do-not-use-91419eac51774d733b905ac2d54b3bde60a208df.tar
drakx-backup-do-not-use-91419eac51774d733b905ac2d54b3bde60a208df.tar.gz
drakx-backup-do-not-use-91419eac51774d733b905ac2d54b3bde60a208df.tar.bz2
drakx-backup-do-not-use-91419eac51774d733b905ac2d54b3bde60a208df.tar.xz
drakx-backup-do-not-use-91419eac51774d733b905ac2d54b3bde60a208df.zip
no_comment
Diffstat (limited to 'perl-install/fsedit.pm')
-rw-r--r--perl-install/fsedit.pm21
1 files changed, 12 insertions, 9 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index ad73e45c8..df2ae8e7d 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -109,8 +109,10 @@ sub has_mntpoint($$) {
scalar grep { $mntpoint eq $_->{mntpoint} } get_fstab(@$hds);
}
-sub check_mntpoint($$) {
- my ($mntpoint, $hds) = @_;
+# do this before modifying $part->{mntpoint}
+# $part->{mntpoint} should not be used here, use $mntpoint instead
+sub check_mntpoint {
+ my ($mntpoint, $hd, $part, $hds) = @_;
$mntpoint eq '' and return;
@@ -119,18 +121,19 @@ sub check_mntpoint($$) {
# m|(.)/$| and die "The mount point $_ is illegal.\nMount points may not end with a /";
has_mntpoint($mntpoint, $hds) and die _("There is already a partition with mount point %s", $mntpoint);
+
+ if ($part->{start} + $part->{size} > 124 * partition_table::cylinder_size($hd)) {
+ die "/boot ending on cylinder > 1024" if $mntpoint eq "/boot";
+ die "/ ending on cylinder > 1024" if $mntpoint eq "/" && !has_mntpoint("/boot", $hds);
+ }
}
-sub add($$$) {
- my ($hd, $part, $hds) = @_;
+sub add($$$;$) {
+ my ($hd, $part, $hds, $force) = @_;
isSwap($part) ?
($part->{mntpoint} = 'swap') :
- check_mntpoint($part->{mntpoint}, $hds);
-
- $part->{mntpoint} eq '/boot' &&
- $part->{start} + $part->{size} >= 1024 * partition_table::cylinder_size($hd) and
- die "/boot on cylinder > 1024";
+ $force || check_mntpoint($part->{mntpoint}, $hd, $part, $hds);
partition_table::add($hd, $part);
}