diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-06-28 09:12:16 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-06-28 09:12:16 +0000 |
commit | f1323d79cc7dd3aa5f4ebde2e2744d7a7ad56180 (patch) | |
tree | c6a37cc1eadd4c1af23c7cda7924d1b42f500344 /perl-install/fs/loopback.pm | |
parent | 48dc83bc2acf770ec4be3e4be5f74a9d49120f65 (diff) | |
download | drakx-f1323d79cc7dd3aa5f4ebde2e2744d7a7ad56180.tar drakx-f1323d79cc7dd3aa5f4ebde2e2744d7a7ad56180.tar.gz drakx-f1323d79cc7dd3aa5f4ebde2e2744d7a7ad56180.tar.bz2 drakx-f1323d79cc7dd3aa5f4ebde2e2744d7a7ad56180.tar.xz drakx-f1323d79cc7dd3aa5f4ebde2e2744d7a7ad56180.zip |
try to cleanup fs.pm
(to have simpler dependencies between modules, esp. have some modules only required by diskdrake):
- move some functions from fs to fs::mount
(most keep their name, except mount_part and mount_usbfs)
- move formatMount_part and formatMount_all from fs to fs::format
- move some functions from fs to fs::wild_device
(part2wild_device_name -> fs::wild_device::from_part)
(subpart_from_wild_device_name -> fs::wild_device::to_subpart)
(analyze_wild_device_name -> fs::wild_device::analyse)
- formatMount_part(), formatMount_all(), fs::mount::part() don't take a prefix anymore
the current situation was quite muddy
we now rely on fs::get::mntpoint_prefixed() which will maybe depend on a field in $part
for now, we mount every part in chroot, it seems to be what's wanted
- fs::format::part() now expect $all_hds instead of $raids
- fs::type::carryRootLoopback is now fs::get::carry_root_loopback()
- in fs::loopback, most functions don't want a prefix anymore
Diffstat (limited to 'perl-install/fs/loopback.pm')
-rw-r--r-- | perl-install/fs/loopback.pm | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/perl-install/fs/loopback.pm b/perl-install/fs/loopback.pm index a7c6c913d..572c79f67 100644 --- a/perl-install/fs/loopback.pm +++ b/perl-install/fs/loopback.pm @@ -12,12 +12,6 @@ use fs; use log; -sub carryRootLoopback { - my ($part) = @_; - $_->{mntpoint} eq '/' and return 1 foreach @{$part->{loopback} || []}; - 0; -} - sub check_circular_mounts { my ($part, $all_hds) = @_; @@ -30,7 +24,7 @@ sub check_circular_mounts { @seen > 1 && $part->{mntpoint} eq $base_mntpoint and die N("Circular mounts %s\n", join(", ", @seen)); if (my $part = fs::get::up_mount_point($part->{mntpoint}, $fstab)) { #- '/' carrier is a special case, it will be mounted first - $check->($part, @seen) if !carryRootLoopback($part); + $check->($part, @seen) if !fs::type::carry_root_loopback($part); } if (isLoopback($part)) { $check->($part->{loopback_device}, @seen); @@ -40,34 +34,34 @@ sub check_circular_mounts { } sub carryRootCreateSymlink { - my ($part, $prefix) = @_; + my ($part) = @_; - carryRootLoopback($part) or return; + fs::type::carry_root_loopback($part) or return; - my $mntpoint = "$prefix$part->{mntpoint}"; + my $mntpoint = fs::get::mntpoint_prefixed($part); unless (-e $mntpoint) { eval { mkdir_p(dirname($mntpoint)) }; #- do non-relative link for install, should be changed to relative link before rebooting symlink "/initrd/loopfs", $mntpoint; mkdir_p("/initrd/loopfs/lnx4win/boot"); - symlink "/initrd/loopfs/lnx4win/boot", "$prefix/boot"; + symlink "/initrd/loopfs/lnx4win/boot", "$::prefix/boot"; } #- indicate kernel to keep initrd - mkdir_p("$prefix/initrd"); + mkdir_p("$::prefix/initrd"); } sub format_part { - my ($part, $prefix) = @_; - fs::mount_part($part->{loopback_device}, $prefix); - create($part, $prefix); + my ($part) = @_; + fs::mount::part($part->{loopback_device}); + create($part); fs::format::part_raw($part, undef); } sub create { - my ($part, $prefix) = @_; - my $f = $part->{device} = "$prefix$part->{loopback_device}{mntpoint}$part->{loopback_file}"; + my ($part) = @_; + my $f = $part->{device} = fs::get::mntpoint_prefixed($part->{loopback_device}) . $part->{loopback_file}; return if -e $f; eval { mkdir_p(dirname($f)) }; |