summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-06-29 13:27:37 +0000
committerOlivier Blin <oblin@mandriva.com>2009-06-29 13:27:37 +0000
commit929940d535f8eda0e29d2b014d2292499643dea3 (patch)
tree2ceb59d3dd262228438467058faeefe82a941098
parent3b920c74dfe27d8c204fcb6cb219313ab126b75a (diff)
downloaddraklive-929940d535f8eda0e29d2b014d2292499643dea3.tar
draklive-929940d535f8eda0e29d2b014d2292499643dea3.tar.gz
draklive-929940d535f8eda0e29d2b014d2292499643dea3.tar.bz2
draklive-929940d535f8eda0e29d2b014d2292499643dea3.tar.xz
draklive-929940d535f8eda0e29d2b014d2292499643dea3.zip
extract record_rescue_files
-rwxr-xr-xdraklive37
1 files changed, 21 insertions, 16 deletions
diff --git a/draklive b/draklive
index 20e1fdf..d01bfad 100755
--- a/draklive
+++ b/draklive
@@ -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});