diff options
Diffstat (limited to 'perl-install/fs.pm')
-rw-r--r-- | perl-install/fs.pm | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm index d4f742da6..76cce10e7 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -1,4 +1,4 @@ -package fs; # $Id: fs.pm 259325 2009-08-17 12:51:59Z alefebvre $ +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 cannot 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}; + }; } } @@ -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; @@ -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); |