summaryrefslogtreecommitdiffstats
path: root/perl-install/fs.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/fs.pm')
-rw-r--r--perl-install/fs.pm41
1 files changed, 13 insertions, 28 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index 61947c0a8..76cce10e7 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -1,4 +1,4 @@
-package fs; # $Id$
+package fs;
use diagnostics;
use strict;
@@ -49,27 +49,6 @@ sub read_fstab {
$options = 'defaults' if $options eq 'rw'; # clean-up for mtab read
- if ($fs_type eq 'supermount') {
- log::l("dropping supermount");
- $options = join(",", grep {
- if (/fs=(.*)/) {
- $fs_type = $1;
-
- #- with supermount, the type could be something like ext2:vfat
- #- but this can not be done without supermount, so switching to "auto"
- $fs_type = 'auto' if $fs_type =~ /:/;
-
- 0;
- } elsif (/dev=(.*)/) {
- $dev = $1;
- 0;
- } elsif ($_ eq '--') {
- 0;
- } else {
- 1;
- }
- } split(',', $options));
- }
s/\\040/ /g foreach $mntpoint, $dev, $options;
if ($fs_type eq 'ext4') {
@@ -165,7 +144,7 @@ sub get_major_minor {
eval {
my (undef, $major, $minor) = devices::entry($_->{device});
($_->{major}, $_->{minor}) = ($major, $minor);
- } if !$_->{major};
+ };
}
}
@@ -198,7 +177,7 @@ sub merge_info_from_fstab {
my @l = grep {
if ($uniq) {
my $part = fs::get::mntpoint2part($_->{mntpoint}, $fstab);
- !$part || fs::get::is_same_hd($part, $_); #- keep it only if it is the mountpoint AND the same device
+ !$part || fs::get::is_same_hd($part, $_); #- keep it only if it is the mount point AND the same device
} else {
1;
}
@@ -230,13 +209,16 @@ sub prepare_write_fstab {
$comment ||= "# Entry for /dev/$_->{device} :\n" if $device =~ /^(UUID|LABEL)=/;
my $real_mntpoint = $_->{mntpoint} || ${{ '/tmp/hdimage' => '/mnt/hd' }}{$_->{real_mntpoint}};
- mkdir_p("$o_prefix$real_mntpoint") if $real_mntpoint =~ m|^/|;
+ if (!member('bind', split(',', $_->{options}))) {
+ mkdir_p("$o_prefix$real_mntpoint") if $real_mntpoint =~ m|^/|;
+ }
my $mntpoint = fs::type::carry_root_loopback($_) ? '/initrd/loopfs' : $real_mntpoint;
+ my $needed_to_boot = member($_->{mntpoint}, fs::type::directories_needed_to_boot());
my ($freq, $passno) =
exists $_->{freq} ?
($_->{freq}, $_->{passno}) :
- isTrueLocalFS($_) && !$_->{dmcrypt_name} && $_->{options} !~ /encryption=/ && (!$_->{is_removable} || member($_->{mntpoint}, fs::type::directories_needed_to_boot())) ?
+ isTrueLocalFS($_) && !$_->{dmcrypt_name} && $_->{options} !~ /encryption=/ && (!$_->{is_removable} || $needed_to_boot) ?
(1, $_->{mntpoint} eq '/' ? 1 : fs::type::carry_root_loopback($_) ? 0 : 2) :
(0, 0);
@@ -246,6 +228,9 @@ sub prepare_write_fstab {
$new{$mntpoint} = 1;
my $options = $_->{options} || 'defaults';
+ if (($_->{is_removable} || member($_->{fs_type}, qw(ntfs ntfs-3g))) && !$needed_to_boot && $_->{options} !~ /nofail/) {
+ $options .= ',nofail';
+ }
if ($_->{fs_type} eq 'cifs' && $options =~ /password=/ && !$b_keep_credentials) {
require fs::remote::smb;
@@ -253,7 +238,7 @@ sub prepare_write_fstab {
$options = $opts;
push @smb_credentials, $smb_credentials;
}
- } elsif ($_->{fs_type} eq 'davfs2' && $options =~ /password=/ && !$b_keep_credentials) {
+ } elsif ($_->{fs_type} eq 'davfs2' && !$b_keep_credentials) {
require fs::remote::davfs;
if (my ($opts, $davfs_credentials) = fs::remote::davfs::fstab_entry_to_credentials($_)) {
$options = $opts || 'defaults';
@@ -319,7 +304,7 @@ sub set_removable_mntpoints {
my %names;
foreach (@{$all_hds->{raw_hds}}) {
my $name = detect_devices::suggest_mount_point($_) or next;
- $name eq 'zip' || $name eq 'cdrom' and next;
+ member($name, qw(zip cdrom)) and next;
my $s = ++$names{$name};
$_->{mntpoint} ||= "/media/$name" . ($s == 1 ? '' : $s);