summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-08-17 23:05:39 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-08-17 23:05:39 +0000
commitf7b06afde3ca21ef4e15470b54f221041361db97 (patch)
treef6b56da55790e589c650c6787807fad1264d73b2 /perl-install
parentcd151e9fee1b636d58da94be6bae8749666e9bdc (diff)
downloaddrakx-backup-do-not-use-f7b06afde3ca21ef4e15470b54f221041361db97.tar
drakx-backup-do-not-use-f7b06afde3ca21ef4e15470b54f221041361db97.tar.gz
drakx-backup-do-not-use-f7b06afde3ca21ef4e15470b54f221041361db97.tar.bz2
drakx-backup-do-not-use-f7b06afde3ca21ef4e15470b54f221041361db97.tar.xz
drakx-backup-do-not-use-f7b06afde3ca21ef4e15470b54f221041361db97.zip
add mount options choice (with IA-like stripping of unused options)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/fs.pm46
1 files changed, 46 insertions, 0 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index ed23f77e4..8f7099044 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -65,6 +65,52 @@ sub check_mounted($) {
}
}
+sub auto_fs() {
+ grep { chop; $_ && !/nodev/ } cat_("/etc/filesystems");
+}
+
+sub mount_options {
+ my %non_defaults = (
+ sync => 'async', noatime => 'atime', noauto => 'auto', ro => 'rw',
+ user => 'nouser', nodev => 'dev', noexec => 'exec', nosuid => 'suid',
+ );
+ my %per_fs = (
+ iso9660 => [ qw(unhide) ],
+ vfat => [ qw(umask=0) ],
+ nfs => [ 'rsize=8192,wsize=8192' ],
+ );
+ my @user_implies = qw(noexec nodev nosuid);
+ my @options = keys %non_defaults;
+ my %help = map { $_ => '' } (@options, map { @$_ } values %per_fs);
+ my %short = map { /(.*?)=/ ? ("$1=" => $_) : () } keys %help;
+
+ foreach (split(':', $ENV{LANGUAGE}), '') {
+ my $manpage = "/usr/share/man/$_/man8/mount.8.bz2";
+ -e $manpage or next;
+
+ my ($tp, $option);
+ foreach (`bzip2 -dc $manpage`) {
+ my $prev_tp = $tp;
+ $tp = /^\.(TP|RE)/;
+ my ($s) = /^\.B (.*)/;
+ if ($prev_tp && $s eq '\-o' .. /X^/) {
+ if (my $v = $prev_tp && $s =~ /^[a-z]/i .. $tp) {
+ if ($v == 1) {
+ $s = $short{$s} || $s;
+ $option = exists $help{$s} && !$help{$s} ? $s : '';
+ } elsif ($v !~ 'E0') {
+ s/\\//g;
+ s/\s*"(.*?)"\s*/$1/g if s/^\.BR\s+//;
+ s/^\.B\s+//;
+ $help{$option} .= $_ if $option;
+ }
+ }
+ }
+ }
+ }
+ \%help, \%non_defaults, \%per_fs, \@user_implies;
+}
+
sub get_mntpoints_from_fstab {
my ($l, $prefix, $uniq) = @_;
log::l("reading fstab");