diff options
-rw-r--r-- | perl-install/devices.pm | 11 | ||||
-rw-r--r-- | perl-install/install2.pm | 2 | ||||
-rw-r--r-- | perl-install/install_any.pm | 15 |
3 files changed, 28 insertions, 0 deletions
diff --git a/perl-install/devices.pm b/perl-install/devices.pm index 5771468c8..50dd3bef6 100644 --- a/perl-install/devices.pm +++ b/perl-install/devices.pm @@ -64,6 +64,17 @@ sub set_loop { $dev; } +sub find_clp_loop { + my ($name) = @_; + foreach (0..255) { + my $dev = make("loop$_"); + my ($file) = `losetup $dev 2>/dev/null` =~ m!\((.*?)\)! or return; + $file =~ s!^/sysroot/!/!; + basename($file) eq $name and return $dev, $file; + } + undef; +} + sub init_device_mapper() { eval { modules::load('dm-mod') }; make('urandom'); diff --git a/perl-install/install2.pm b/perl-install/install2.pm index abfd03e92..b8f5ffe2d 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -190,6 +190,7 @@ sub formatPartitions { eval { fs::mount('none', "$o->{prefix}/sys", 'sysfs') }; common::screenshot_dir__and_move(); + install_any::move_clp_to_disk(); any::rotate_logs($o->{prefix}); @@ -631,6 +632,7 @@ sub main { last if $o->{step} eq 'exitInstall'; } + unlink install_any::clp_on_disk(); install_any::clean_postinstall_rpms(); install_any::log_sizes($o); install_any::remove_advertising($o); diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index f01f69b6b..7b9a251b5 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -1556,6 +1556,21 @@ sub write_fstab { fs::write_fstab($o->{all_hds}, $o->{prefix}) if !$o->{isUpgrade} || $o->{migrate_device_names}; } +my $clp_name = 'mdkinst.clp'; +sub clp_on_disk() { "$::prefix/tmp/$clp_name" } + +sub move_clp_to_disk() { + return if -e clp_on_disk(); + + my ($loop, $current_clp) = devices::find_clp_loop($clp_name); + log::l("move_clp_to_disk: copying $current_clp to ", clp_on_disk()); + cp_af($current_clp, clp_on_disk()); + run_program::run('losetup', $loop, clp_on_disk()); + + #- in $current_clp eq "/tmp/$clp_name" + unlink "/tmp/$clp_name"; +} + #-############################################################################### #- pcmcia various #-############################################################################### |