diff options
author | Mystery Man <unknown@mandriva.org> | 2005-09-02 22:32:32 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2005-09-02 22:32:32 +0000 |
commit | bd9ae60ea7df3a2dc09798ea1cba6f55f2c3f0e4 (patch) | |
tree | 7a03e33fba584c7014f990f1448a337627d50484 /rescue/guessmounts | |
parent | 4da1048be0a7528a1a9f55e6f87cb2766508473b (diff) | |
download | drakx-backup-do-not-use-10_3_0_53mdk.tar drakx-backup-do-not-use-10_3_0_53mdk.tar.gz drakx-backup-do-not-use-10_3_0_53mdk.tar.bz2 drakx-backup-do-not-use-10_3_0_53mdk.tar.xz drakx-backup-do-not-use-10_3_0_53mdk.zip |
This commit was manufactured by cvs2svn to create tagV10_3_0_53mdk
'V10_3_0_53mdk'.
Diffstat (limited to 'rescue/guessmounts')
-rwxr-xr-x | rescue/guessmounts | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/rescue/guessmounts b/rescue/guessmounts deleted file mode 100755 index 3f3a4e208..000000000 --- a/rescue/guessmounts +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/perl -# -# Guillaume Cottenceau -# -# Copyright 2001-2005 Mandriva -# -# This software may be freely redistributed under the terms of the GNU -# public license. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# - -use lib qw(../perl-install /usr/lib/libDrakX); -use common; -use fs; -use fs::proc_partitions; - - -my @proc_mounts = fs::read_fstab('', '/proc/mounts'); - -my $target = '/mnt'; - -if (fs::get::mntpoint2part($target, \@proc_mounts)) { - print STDERR "$target is already mounted (according to /proc/mounts)\n"; - exit 0; -} - -system('drvinst', 'STORAGE'); - -print STDERR "\nPlease wait, trying to find your root device...\n"; - -mkdir_p($target); - -my @fstab; -my $root; - -foreach (fs::proc_partitions::read_raw()) { - my $dev = devices::make($_->{dev}); - - my $fs = find { - system("mount -t $_ $dev $target 2>/dev/null") == 0; - } fs::type::true_local_fs_types() or next; - - if (my $release_file = common::release_file($target)) { - print STDERR "=> found a Mandriva Linux root partition on $dev\n=> type $fs, version `", - chomp_(cat_("$target$release_file")), "'\n"; - @fstab = fs::read_fstab($target, '/etc/fstab'); - $root = $dev; - last; - } else { - system('umount', $target) == 0 or die "error unmounting $target\n"; - } -} - -if ($root) { - print STDERR "\nMounting other partitions from fstab on $target...\n"; - foreach (@fstab) { - my ($valued_options, $options) = fs::mount_options::unpack($_); - - next if - !$_->{fs_type} || $_->{device} eq 'none' - || $valued_options->{noauto} || $valued_options->{supermount} - || $_->{mntpoint} eq '/' - || member($_->{fs_type}, 'swap', 'nfs', 'ntfs'); - - delete $valued_options->{'iocharset='}; - delete $valued_options->{'codepage='}; - fs::mount_options::pack($_, $valued_options, $options); #- vfat opts, we don't have the modules in rescue - - my $where = "$target$_->{mntpoint}"; - mkdir_p($where); - print STDERR "\t$_->{device} on $where type $_->{fs_type} options $_->{options}\n"; - system("mount -t $_->{fs_type} /dev/$_->{device} $where -o $_->{options}"); - system("cp -f /etc/mtab $target/etc/mtab"); #- to allow a nice chrooted "mount" or "df" - } - print STDERR "\nYour system is ready on $target.\n\n"; -} else { - die "Could not find your root device :-(.\n"; -} - |