summaryrefslogtreecommitdiffstats
path: root/perl-install/fs.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>1999-10-11 17:04:31 +0000
committerFrancois Pons <fpons@mandriva.com>1999-10-11 17:04:31 +0000
commit9ad846cd08f909f760f80bf703b8d4dbe1809c7b (patch)
tree0afede65ca0b4024e3738639c3661ddf2145f09e /perl-install/fs.pm
parentf3555a3ac7978f63ef42b4373da92ff1ce791031 (diff)
downloaddrakx-backup-do-not-use-9ad846cd08f909f760f80bf703b8d4dbe1809c7b.tar
drakx-backup-do-not-use-9ad846cd08f909f760f80bf703b8d4dbe1809c7b.tar.gz
drakx-backup-do-not-use-9ad846cd08f909f760f80bf703b8d4dbe1809c7b.tar.bz2
drakx-backup-do-not-use-9ad846cd08f909f760f80bf703b8d4dbe1809c7b.tar.xz
drakx-backup-do-not-use-9ad846cd08f909f760f80bf703b8d4dbe1809c7b.zip
*** empty log message ***
Diffstat (limited to 'perl-install/fs.pm')
-rw-r--r--perl-install/fs.pm24
1 files changed, 18 insertions, 6 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index eac303647..36a480ee3 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -201,7 +201,13 @@ sub write($$) {
mkdir "$prefix/mnt/cdrom$i", 0755 or log::l("failed to mkdir $prefix/mnt/cdrom$i: $!");
symlinkf $_->{device}, "$prefix/dev/cdrom$i" or log::l("failed to symlink $prefix/dev/cdrom$i: $!");
[ "/dev/cdrom$i", "/mnt/cdrom$i", "auto", "user,noauto,nosuid,exec,nodev,ro", 0, 0 ];
- } detect_devices::cdroms());
+ } detect_devices::cdroms(),
+ map_index { #- for zip drives, the right partition is the 4th.
+ my $i = $::i ? $::i + 1 : '';
+ mkdir "$prefix/mnt/zip$i", 0755 or log::l("failed to mkdir $prefix/mnt/zip$i: $!");
+ symlinkf "$_->{device}4", "$prefix/dev/zip$i" or log::l("failed to symlink $prefix/dev/zip$i: $!");
+ [ "/dev/zip$i", "/mnt/zip$i", "auto", "user,noauto,nosuid,exec,nodev", 0, 0 ];
+ } detect_devices::zips());
write_fstab($fstab, $prefix, @to_add);
}
@@ -209,6 +215,12 @@ sub write_fstab($;$$) {
my ($fstab, $prefix, @to_add) = @_;
$prefix ||= '';
+ #- get the list of devices and mntpoint to remove existing entries
+ #- and @to_add take precedence over $fstab to handle removable device
+ #- if they are mounted OR NOT during install.
+ my @new = grep { $_ ne 'none' } map { @$_[0,1] } @to_add;
+ my %new; @new{@new} = undef;
+
unshift @to_add,
map {
my ($dir, $options, $freq, $passno) = qw(/dev/ defaults 0 0);
@@ -217,15 +229,15 @@ sub write_fstab($;$$) {
isExt2($_) and ($freq, $passno) = (1, ($_->{mntpoint} eq '/') ? 1 : 2);
isNfs($_) and ($dir, $options) = ('', 'ro');
+ #- keep in mind the new line for fstab.
+ @new{($_->{mntpoint}, $_->{"$dir$_->{device}"})} = undef;
+
devices::make("$prefix/$dir$_->{device}") if $_->{device} && $dir;
[ "$dir$_->{device}", $_->{mntpoint}, type2fs($_->{type}), $options, $freq, $passno ];
- } grep { $_->{mntpoint} && type2fs($_->{type}) } @$fstab;
-
- #- get the list of devices and mntpoint
- my @new = grep { $_ ne 'none' } map { @$_[0,1] } @to_add;
- my %new; @new{@new} = undef;
+ } grep { $_->{mntpoint} && type2fs($_->{type}) &&
+ ! exists $new{$_->{mntpoint}} && ! exists $new{"/dev/$_->{device}"} } @$fstab;
my @current = cat_("$prefix/etc/fstab");