diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-04-06 00:48:19 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-04-06 00:48:19 +0000 |
commit | 9751804098b01f6413629e9850ee3286c81e521b (patch) | |
tree | 8271d913f24dd1e51ee04774ab5ff3a658bcad96 /perl-install/fs.pm | |
parent | 69b6d6056c98dc6c647ff69fd7b773ef21ca3519 (diff) | |
download | drakx-backup-do-not-use-9751804098b01f6413629e9850ee3286c81e521b.tar drakx-backup-do-not-use-9751804098b01f6413629e9850ee3286c81e521b.tar.gz drakx-backup-do-not-use-9751804098b01f6413629e9850ee3286c81e521b.tar.bz2 drakx-backup-do-not-use-9751804098b01f6413629e9850ee3286c81e521b.tar.xz drakx-backup-do-not-use-9751804098b01f6413629e9850ee3286c81e521b.zip |
create install_any::write_fstab and use it
Diffstat (limited to 'perl-install/fs.pm')
-rw-r--r-- | perl-install/fs.pm | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 465f522ef..25252d64a 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -335,10 +335,13 @@ sub df { } #- do some stuff before calling write_fstab -sub write($$$$) { - my ($prefix, $fstab, $manualFstab, $useSupermount) = @_; +sub write { + my ($prefix, $fstab, $manualFstab, $useSupermount, $options) = @_; $fstab = [ @{$fstab||[]}, @{$manualFstab||[]} ]; + use Data::Dumper; + print Dumper $options; + unless ($::live) { log::l("resetting /etc/mtab"); local *F; @@ -370,20 +373,25 @@ sub write($$$$) { [ "/mnt/zip$i", "/mnt/zip$i", "supermount", "fs=vfat,dev=/dev/zip$i", 0, 0 ] : [ "/dev/zip$i", "/mnt/zip$i", "auto", "user,noauto,nosuid,exec,nodev", 0, 0 ]; } detect_devices::zips())); - write_fstab($fstab, $prefix, @to_add); + write_fstab($fstab, $prefix, $options, @to_add); } sub write_fstab($;$$) { - my ($fstab, $prefix, @to_add) = @_; + my ($fstab, $prefix, $options, @to_add) = @_; $prefix ||= ''; + my $format_options = sub { + my ($default, @l) = @_; + join(',', $default, map { "$_=$options->{$_}" } grep { $options->{$_} } @l); + }; + unshift @to_add, map { my ($dir, $options, $freq, $passno) = qw(/dev/ defaults 0 0); $options = $_->{options} || $options; isTrueFS($_) and ($freq, $passno) = (1, ($_->{mntpoint} eq '/') ? 1 : 2); - isNfs($_) and $dir = '', $options = $_->{options} || 'ro,nosuid,rsize=8192,wsize=8192'; - isFat($_) and $options = $_->{options} || "user,exec,umask=0"; + isNfs($_) and $dir = '', $options = $_->{options} || $format_options->('ro,nosuid,rsize=8192,wsize=8192', 'iocharset'); + isFat($_) and $options = $_->{options} || $format_options->("user,exec,umask=0", 'codepage', 'iocharset'); isReiserfs($_) && $_ == fsedit::get_root($fstab, 'boot') and add_options($options, "notail"); |