diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-06-29 13:27:37 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-06-29 13:27:37 +0000 |
commit | 929940d535f8eda0e29d2b014d2292499643dea3 (patch) | |
tree | 2ceb59d3dd262228438467058faeefe82a941098 | |
parent | 3b920c74dfe27d8c204fcb6cb219313ab126b75a (diff) | |
download | draklive-929940d535f8eda0e29d2b014d2292499643dea3.tar draklive-929940d535f8eda0e29d2b014d2292499643dea3.tar.gz draklive-929940d535f8eda0e29d2b014d2292499643dea3.tar.bz2 draklive-929940d535f8eda0e29d2b014d2292499643dea3.tar.xz draklive-929940d535f8eda0e29d2b014d2292499643dea3.zip |
extract record_rescue_files
-rwxr-xr-x | draklive | 37 |
1 files changed, 21 insertions, 16 deletions
@@ -1055,6 +1055,26 @@ sub get_rescue_files { ); } +sub record_rescue_files { + my ($mnt, $device, $rescue_files) = @_; + my $failed; + foreach (group_by2(@$rescue_files)) { + my ($src, $dest) = @$_; + $dest = $mnt . $dest; + mkdir_p($dest =~ m!/$! ? $dest : dirname($dest)); + if (!run_('rsync', '-vdP', '--inplace', $src, $dest)) { + $failed = 1; + last; + } + } + + if ($failed) { + run_('umount', $mnt); + maybe_umount_device($device); + die "unable to copy rescue files\n"; + } +} + sub get_disk_replicator_path { my ($live) = @_; $live->get_builddir . $live->{prefix}{build}{dist} . '/' . $live->get_name . '.rest.img'; @@ -1089,22 +1109,7 @@ sub record_usb_replicator { rm_rf($live->{mnt} . $media_boot) if -e $live->{mnt} . $media_boot; install_usb_bootloader($live, $media, $opts); - my $failed; - foreach (group_by2(get_disk_replicator_files($live))) { - my ($src, $dest) = @$_; - $dest = $live->{mnt} . $dest; - mkdir_p($dest =~ m!/$! ? $dest : dirname($dest)); - if (!run_('rsync', '-vdP', '--inplace', $src, $dest)) { - $failed = 1; - last; - } - } - if ($failed) { - run_('umount', $live->{mnt}); - maybe_umount_device($device); - die "unable to copy replicator files\n"; - } - + record_rescue_files($live->{mnt}, $device, [ get_disk_replicator_files($live) ]); output_p($live->{mnt} . "/images/list", "EN,English," . basename(get_disk_image_path($live)) . ",on\n"); run_('umount', $live->{mnt}); |