summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-06-10 04:40:18 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-06-10 04:40:18 +0000
commit6e230863720c63b6a39a53f3c0a15de771a373d2 (patch)
treed61f413104635c5a259455c4acbdc6e628650a59 /perl-install
parentc130de3109b46c9c0783f9d600c38cea9b5bb46e (diff)
downloaddrakx-6e230863720c63b6a39a53f3c0a15de771a373d2.tar
drakx-6e230863720c63b6a39a53f3c0a15de771a373d2.tar.gz
drakx-6e230863720c63b6a39a53f3c0a15de771a373d2.tar.bz2
drakx-6e230863720c63b6a39a53f3c0a15de771a373d2.tar.xz
drakx-6e230863720c63b6a39a53f3c0a15de771a373d2.zip
move loopback.pm to fs/loopback.pm
(since it's tightly tight to many fs* things)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/bootloader.pm6
-rw-r--r--perl-install/diskdrake/hd_gtk.pm1
-rw-r--r--perl-install/diskdrake/interactive.pm6
-rw-r--r--perl-install/fs.pm16
-rw-r--r--perl-install/fs/format.pm3
-rw-r--r--perl-install/fs/get.pm3
-rw-r--r--perl-install/fs/loopback.pm (renamed from perl-install/loopback.pm)3
-rw-r--r--perl-install/fsedit.pm4
-rw-r--r--perl-install/install_steps.pm1
-rw-r--r--perl-install/install_steps_interactive.pm1
-rw-r--r--perl-install/pkgs.pm8
11 files changed, 25 insertions, 27 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 1e93cd6ac..0d886f4cb 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -13,7 +13,7 @@ use fs::get;
use log;
use any;
use devices;
-use loopback;
+use fs::loopback;
use detect_devices;
use partition_table::raw;
use run_program;
@@ -108,7 +108,7 @@ sub mkinitrd {
my $initrd = $entry->{initrd};
$::testing || -e "$::prefix/$initrd" and return 1;
- my $loop_boot = loopback::prepare_boot();
+ my $loop_boot = fs::loopback::prepare_boot();
modules::load('loop');
my @options = (
@@ -121,7 +121,7 @@ sub mkinitrd {
}
add_boot_splash($entry->{initrd}, $entry->{vga});
- loopback::save_boot($loop_boot);
+ fs::loopback::save_boot($loop_boot);
-e "$::prefix/$initrd";
}
diff --git a/perl-install/diskdrake/hd_gtk.pm b/perl-install/diskdrake/hd_gtk.pm
index 036bfff85..95860d7e5 100644
--- a/perl-install/diskdrake/hd_gtk.pm
+++ b/perl-install/diskdrake/hd_gtk.pm
@@ -10,7 +10,6 @@ use fs::type;
use detect_devices;
use diskdrake::interactive;
use run_program;
-use loopback;
use devices;
use raid;
use any;
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index bb414f451..f7bcc9348 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -9,7 +9,7 @@ use partition_table;
use partition_table::raw;
use detect_devices;
use run_program;
-use loopback;
+use fs::loopback;
use devices;
use fsedit;
use raid;
@@ -902,7 +902,7 @@ sub Loopback {
my $handle = any::inspect($real_part) or $in->ask_warn('', N("This partition can not be used for loopback")), return;
- my ($min, $max) = (1, loopback::getFree($handle->{dir}, $real_part));
+ my ($min, $max) = (1, fs::loopback::getFree($handle->{dir}, $real_part));
$max = min($max, 1 << (31 - 9)) if $real_part->{fs_type} eq 'vfat'; #- FAT does not handle file size bigger than 2GB
my $part = { maxsize => $max, size => 0, loopback_device => $real_part, notFormatted => 1 };
if (!fsedit::suggest_part($part, $all_hds)) {
@@ -921,7 +921,7 @@ sub Loopback {
complete => sub {
$part->{loopback_file} or $in->ask_warn('', N("Give a file name")), return 1, 0;
$part->{loopback_file} =~ s|^([^/])|/$1|;
- if (my $size = loopback::verifFile($handle->{dir}, $part->{loopback_file}, $real_part)) {
+ if (my $size = fs::loopback::verifFile($handle->{dir}, $part->{loopback_file}, $real_part)) {
$size == -1 and $in->ask_warn('', N("File is already used by another loopback, choose another one")), return 1, 0;
$in->ask_yesorno('', N("File already exists. Use it?")) or return 1, 0;
delete $part->{notFormatted};
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index ad62b3e5c..5ba4d68ad 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -12,11 +12,11 @@ use fs::type;
use fs::get;
use fs::format;
use fs::mount_options;
+use fs::loopback;
use run_program;
use detect_devices;
use modules;
use fsedit;
-use loopback;
sub read_fstab {
@@ -305,13 +305,13 @@ sub prepare_write_fstab {
my $real_mntpoint = $_->{mntpoint} || ${{ '/tmp/hdimage' => '/mnt/hd' }}{$_->{real_mntpoint}};
mkdir_p("$o_prefix$real_mntpoint") if $real_mntpoint =~ m|^/|;
- my $mntpoint = loopback::carryRootLoopback($_) ? '/initrd/loopfs' : $real_mntpoint;
+ my $mntpoint = fs::loopback::carryRootLoopback($_) ? '/initrd/loopfs' : $real_mntpoint;
my ($freq, $passno) =
exists $_->{freq} ?
($_->{freq}, $_->{passno}) :
isTrueLocalFS($_) && $_->{options} !~ /encryption=/ && (!$_->{is_removable} || member($_->{mntpoint}, fs::type::directories_needed_to_boot())) ?
- (1, $_->{mntpoint} eq '/' ? 1 : loopback::carryRootLoopback($_) ? 0 : 2) :
+ (1, $_->{mntpoint} eq '/' ? 1 : fs::loopback::carryRootLoopback($_) ? 0 : 2) :
(0, 0);
if (($device eq 'none' || !$new{$device}) && ($mntpoint eq 'swap' || !$new{$mntpoint})) {
@@ -451,7 +451,7 @@ sub formatMount_part {
formatMount_part($part->{loopback_device}, $raids, $fstab, $prefix, $wait_message);
}
if (my $p = fs::get::up_mount_point($part->{mntpoint}, $fstab)) {
- formatMount_part($p, $raids, $fstab, $prefix, $wait_message) unless loopback::carryRootLoopback($part);
+ formatMount_part($p, $raids, $fstab, $prefix, $wait_message) if !fs::loopback::carryRootLoopback($part);
}
if ($part->{toFormat}) {
fs::format::part($raids, $part, $prefix, $wait_message);
@@ -465,7 +465,7 @@ sub formatMount_all {
foreach sort { isLoopback($a) ? 1 : isSwap($a) ? -1 : 0 } grep { $_->{mntpoint} } @$fstab;
#- ensure the link is there
- loopback::carryRootCreateSymlink($_, $prefix) foreach @$fstab;
+ fs::loopback::carryRootCreateSymlink($_, $prefix) foreach @$fstab;
#- for fun :)
#- that way, when install exits via ctrl-c, it gives hand to partition
@@ -568,7 +568,7 @@ sub mount_part {
my ($part, $o_prefix, $b_rdonly, $o_wait_message) = @_;
#- root carrier's link can not be mounted
- loopback::carryRootCreateSymlink($part, $o_prefix);
+ fs::loopback::carryRootCreateSymlink($part, $o_prefix);
log::l("mount_part: " . join(' ', map { "$_=$part->{$_}" } 'device', 'mntpoint', 'isMounted', 'real_mntpoint'));
if ($part->{isMounted} && $part->{real_mntpoint} && $part->{mntpoint}) {
@@ -601,7 +601,7 @@ sub mount_part {
} elsif ($part->{options} =~ /encrypted/) {
log::l("skip mounting $part->{device} since we do not have the encrypt_key");
return;
- } elsif (loopback::carryRootLoopback($part)) {
+ } elsif (fs::loopback::carryRootLoopback($part)) {
$mntpoint = "/initrd/loopfs";
}
my $dev = $part->{real_device} || part2wild_device_name('', $part);
@@ -620,7 +620,7 @@ sub umount_part {
unless ($::testing) {
if (isSwap($part)) {
swapoff($part->{device});
- } elsif (loopback::carryRootLoopback($part)) {
+ } elsif (fs::loopback::carryRootLoopback($part)) {
umount("/initrd/loopfs");
} else {
umount(($o_prefix || '') . $part->{mntpoint} || devices::make($part->{device}));
diff --git a/perl-install/fs/format.pm b/perl-install/fs/format.pm
index ad4e77508..4f0aff353 100644
--- a/perl-install/fs/format.pm
+++ b/perl-install/fs/format.pm
@@ -6,6 +6,7 @@ use strict;
use run_program;
use common;
use fs::type;
+use fs::loopback;
use log;
my %cmds = (
@@ -46,7 +47,7 @@ sub part {
raid::format_part($raids, $part);
} elsif (isLoopback($part)) {
$wait_message->(N("Creating and formatting file %s", $part->{loopback_file})) if $wait_message;
- loopback::format_part($part, $prefix);
+ fs::loopback::format_part($part, $prefix);
} else {
$wait_message->(N("Formatting partition %s", $part->{device})) if $wait_message;
part_raw($part, $wait_message);
diff --git a/perl-install/fs/get.pm b/perl-install/fs/get.pm
index 6b982c1e9..dca0a5aa9 100644
--- a/perl-install/fs/get.pm
+++ b/perl-install/fs/get.pm
@@ -5,6 +5,7 @@ use strict;
use partition_table;
use fs::type;
+use fs::loopback;
use fs;
use common;
use log;
@@ -87,7 +88,7 @@ sub file2part {
$file = $b_keep_simple_symlinks ? common::expand_symlinks_but_simple("$::prefix$file") : expand_symlinks("$::prefix$file");
unless ($file =~ s/^$::prefix//) {
- my $part = find { loopback::carryRootLoopback($_) } @$fstab or die;
+ my $part = find { fs::loopback::carryRootLoopback($_) } @$fstab or die;
log::l("found $part->{mntpoint}");
$file =~ s|/initrd/loopfs|$part->{mntpoint}|;
}
diff --git a/perl-install/loopback.pm b/perl-install/fs/loopback.pm
index 96e542ab8..a7c6c913d 100644
--- a/perl-install/loopback.pm
+++ b/perl-install/fs/loopback.pm
@@ -1,4 +1,4 @@
-package loopback; # $Id$
+package fs::loopback; # $Id$
use diagnostics;
use strict;
@@ -6,7 +6,6 @@ use strict;
#-######################################################################################
#- misc imports
#-######################################################################################
-use MDK::Common::System;
use common;
use fs::type;
use fs;
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index 2fc6dd999..a92b670e8 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -11,9 +11,9 @@ use common;
use partition_table;
use partition_table::raw;
use fs::type;
+use fs::loopback;
use detect_devices;
use devices;
-use loopback;
use log;
use fs;
@@ -424,7 +424,7 @@ Please be sure to add a /boot partition") if $mntpoint eq "/" && isLVM($part) &&
if $part->{options} =~ /encrypted/ && member($mntpoint, qw(/ /usr /var /boot));
local $part->{mntpoint} = $mntpoint;
- loopback::check_circular_mounts($part, $all_hds);
+ fs::loopback::check_circular_mounts($part, $all_hds);
}
sub add {
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 1a519868d..29ad182da 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -17,7 +17,6 @@ use run_program;
use lang;
use keyboard;
use fsedit;
-use loopback;
use do_pkgs;
use pkgs;
use any;
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 5bbe28763..765b69f43 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -21,7 +21,6 @@ use detect_devices;
use run_program;
use devices;
use fsedit;
-use loopback;
use mouse;
use modules;
use modules::interactive;
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index d9ad942e2..2f8dd48dd 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -12,7 +12,7 @@ use run_program;
use detect_devices;
use log;
use fs;
-use loopback;
+use fs::loopback;
use c;
our %preferred = map { $_ => undef } qw(lilo perl-base gstreamer-oss openjade ctags glibc curl sane-backends postfix mdkkdm gcc gcc-cpp gcc-c++ proftpd ghostscript-X vim-minimal kernel db1 db2 libxpm4 zlib1 libncurses5 harddrake cups apache);
@@ -1050,7 +1050,7 @@ sub install {
return if !@$toInstall;
#- for root loopback'ed /boot
- my $loop_boot = loopback::prepare_boot();
+ my $loop_boot = fs::loopback::prepare_boot();
#- first stage to extract some important information
#- about the selected packages. This is used to select
@@ -1081,7 +1081,7 @@ sub install {
if ($nb == 0 && scalar(@transToInstall) == 0) {
cleanHeaders();
- loopback::save_boot($loop_boot);
+ fs::loopback::save_boot($loop_boot);
return;
}
@@ -1265,7 +1265,7 @@ sub install {
cleanHeaders();
- loopback::save_boot($loop_boot);
+ fs::loopback::save_boot($loop_boot);
}
sub remove {