summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakupdate_fstab
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/drakupdate_fstab')
-rwxr-xr-xperl-install/standalone/drakupdate_fstab22
1 files changed, 10 insertions, 12 deletions
diff --git a/perl-install/standalone/drakupdate_fstab b/perl-install/standalone/drakupdate_fstab
index 5c615f726..edb3a5663 100755
--- a/perl-install/standalone/drakupdate_fstab
+++ b/perl-install/standalone/drakupdate_fstab
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# drakupdate_fstab
-# Copyright (C) 2002-2006 Mandriva (pixel@mandrakesoft.com)
+# Copyright (C) 2002-2008 Mandriva (pixel)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -31,12 +31,13 @@ $::isStandalone = 1; #- not using standalone.pm which generates too many logs fo
log::l("drakupdate_fstab called with @ARGV\n");
-my ($debug, $removed);
+my ($debug, $verbose, $removed);
my %args = (
'--auto' => \$::auto,
'--debug' => \$debug,
'--test' => \$::testing,
+ '--verbose' => \$verbose,
);
each_index {
@@ -50,7 +51,7 @@ each_index {
my ($raw_action, $device_name) = @ARGV;
my ($action) = $raw_action =~ /^--(add|del)/;
-@ARGV == 2 && $action or die "usage: drakupdate_fstab [--test] [--auto] [--add | --del] <device>\n";
+@ARGV == 2 && $action or die "usage: drakupdate_fstab [--test] [--verbose] [--auto] [--add | --del] <device>\n";
main($action, $device_name);
@@ -79,11 +80,7 @@ sub device_name_to_entry {
sub set_options {
my ($part) = @_;
-
- $part->{is_removable} = 1; #- force removable flag
- fs::mount_options::set_default($part,
- security => security::level::get(),
- lang::fs_options(lang::read()));
+ $part->{is_removable} = 1;
}
sub set_mount_point {
@@ -107,7 +104,7 @@ sub main {
my $all_hds = fsedit::get_hds();
my $hd = find { fs::get::is_same_hd($_, $device) } fs::get::hds($all_hds);
$hd or die "unable to find hd for $device->{device}";
- my @parts = grep { !fsedit::isSwap($_) } partition_table::get_normal_parts($hd);
+ my @parts = grep { !fsedit::isSwap($_) && fs::type::maybeFormatted($_) } partition_table::get_normal_parts($hd);
configure_part($action, $_, 'hd') foreach @parts;
} else {
configure_part($action, $device, undef);
@@ -118,7 +115,7 @@ sub configure_part {
my ($action, $part, $is_hd) = @_;
my $fstab_file = '/etc/fstab';
if (!$part) {
- print STDERR "Can not find device $device_name\n" if $::testing;
+ print STDERR "Cannot find device $device_name\n" if $::testing;
return;
} elsif ($::testing) {
cp_af('/etc/fstab', $fstab_file = '/tmp/fstab');
@@ -138,6 +135,7 @@ sub configure_part {
return;
}
set_mount_point($part, $fstab, $is_hd) or return;
+ set_options($part);
my ($line) = fs::prepare_write_fstab([$part]);
if ($line) {
@@ -145,7 +143,7 @@ sub configure_part {
system("mount $part->{mntpoint}") if !$::testing && ($device_name =~ /^fd\d+/ || $is_hd);
}
- if ($::auto) {
+ if ($verbose) {
print $part->{mntpoint}, " user\n";
}
} else {
@@ -157,7 +155,7 @@ sub configure_part {
my ($s) = fs::prepare_write_fstab($fstab_, '', 'keep_smb_credentials');
output($fstab_file, $s);
- if ($::auto) {
+ if ($verbose) {
print "$_->{mntpoint}\n" foreach @$existing_fstab_entries;
}
}