diff options
Diffstat (limited to 'perl-install/fs/mount_point.pm')
-rw-r--r-- | perl-install/fs/mount_point.pm | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/perl-install/fs/mount_point.pm b/perl-install/fs/mount_point.pm index 8dc4521ae..9263d692f 100644 --- a/perl-install/fs/mount_point.pm +++ b/perl-install/fs/mount_point.pm @@ -1,4 +1,4 @@ -package fs::mount_point; # $Id: mount_point.pm 269270 2010-05-24 09:55:20Z pterjan $ +package fs::mount_point; use diagnostics; use strict; @@ -24,7 +24,10 @@ sub guess_mount_point { my $d = $handle->{dir}; my $mnt = find { -e "$d/$l{$_}" } keys %l; $mnt ||= (stat("$d/.bashrc"))[4] ? '/root' : '/home/user' . ++$$user if -e "$d/.bashrc"; - $mnt ||= (any { -d $_ && (stat($_))[4] >= 500 && -e "$_/.bashrc" } glob_($d)) ? '/home' : ''; + $mnt ||= (any { -d $_ && (stat($_))[4] >= 1000 && -e "$_/.bashrc" } glob_($d)) ? '/home' : ''; + # Keep uid 500 here for guesswork, but base it on .bash_history to increase + # changes it's a real user. + $mnt ||= (any { -d $_ && (stat($_))[4] >= 500 && -e "$_/.bash_history" } glob_($d)) ? '/home' : ''; ($mnt, $handle); } @@ -43,30 +46,32 @@ sub suggest_mount_points { #- try to find other mount points via fstab fs::merge_info_from_fstab($fstab, $handle->{dir}, $uniq, 'loose') if $mnt eq '/'; } + # reuse existing ESP under UEFI: + my @ESP = if_(is_uefi(), grep { isESP($_) } @$fstab); + if (@ESP) { + $ESP[0]{mntpoint} = '/boot/EFI'; + delete $ESP[0]{unsafeMntpoint}; + } $_->{mntpoint} and log::l("suggest_mount_points: $_->{device} -> $_->{mntpoint}") foreach @$fstab; } sub suggest_mount_points_always { my ($fstab) = @_; - my @win = grep { isFat_or_NTFS($_) && !$_->{isMounted} && maybeFormatted($_) && !$_->{is_removable} && $_->{pt_type} != 0x12 && !isRecovery($_)} @$fstab; + my @ESP = grep { isESP($_) && maybeFormatted($_) && !$_->{is_removable} } @$fstab; + if (@ESP) { + $ESP[0]{mntpoint} = "/boot/EFI"; + } + my @win = grep { isnormal_Fat_or_NTFS($_) && !$_->{isMounted} && maybeFormatted($_) && !$_->{is_removable} } @$fstab; log::l("win parts: ", join ",", map { $_->{device} } @win) if @win; if (@win == 1) { - #- Suggest /boot/efi on ia64. - $win[0]{mntpoint} = arch() =~ /ia64/ ? "/boot/efi" : "/media/windows"; + $win[0]{mntpoint} = "/media/windows"; } else { my %w; foreach (@win) { my $v = $w{$_->{device_windobe}}++; $_->{mntpoint} = $_->{unsafeMntpoint} = "/media/win_" . lc($_->{device_windobe}) . ($v ? $v+1 : ''); #- lc cuz of StartOffice(!) cf dadou } } - - my @sunos = grep { $_->{pt_type} == 2 } @$fstab; #- take only into account root partitions. - if (@sunos) { - my $v = ''; - map { $_->{mntpoint} = $_->{unsafeMntpoint} = "/mnt/sunos" . ($v && ++$v) } @sunos; - } - #- a good job is to mount SunOS root partition, and to use mount point described here in /etc/vfstab. } sub validate_mount_points { |