diff options
Diffstat (limited to 'lib/MGA/DrakISO/BuildLoop.pm')
-rw-r--r-- | lib/MGA/DrakISO/BuildLoop.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/MGA/DrakISO/BuildLoop.pm b/lib/MGA/DrakISO/BuildLoop.pm index a16ecd8..01aefca 100644 --- a/lib/MGA/DrakISO/BuildLoop.pm +++ b/lib/MGA/DrakISO/BuildLoop.pm @@ -45,7 +45,7 @@ our @EXPORT = qw(build_live_loopback_files list_loopback_modules); sub build_live_loopback_files { my ($build) = @_; # make sure no external filesystems are mounted before creating the loopback - umount_all_in_chroot($build); + umount_all_in_root($build->get_system_root); my @excluded_files = expand_file_list($build, @{$build->{loopbacks}{exclude}{files} || []}); my @modules_files = expand_file_list($build, @{$build->{loopbacks}{modules} || []}); @@ -57,11 +57,11 @@ sub build_live_loopback_files { foreach my $module (list_loopback_modules($build)) { my $copy_tree = $build->get_system_root . "/tmp/draklive/loop/$module->{name}"; - eval { rm_rf($copy_tree) }; + run_as_root('rm', '-rf', $copy_tree); hardlink_filtered($build->get_system_root, $copy_tree, $module->{files}); my $loop = $loop_types{$module->{type}}; $loop->{build}->($build, { path => "/modules/$module->{name}", root => $copy_tree, exclude => \@excluded_files }); - eval { rm_rf($copy_tree) }; + run_as_root('rm', '-rf', $copy_tree); } if (@excluded_files) { @@ -71,17 +71,17 @@ sub build_live_loopback_files { foreach my $module (list_loopback_modules($build)) { my $copy_tree = $build->get_system_root . "/tmp/draklive/excluded/$module->{name}"; - eval { rm_rf($copy_tree) }; + run_as_root('rm', '-rf', $copy_tree); hardlink_filtered($excluded_tree, $copy_tree, $module->{files}); my $loop = $loop_types{$module->{type}}; $loop->{build}->($build, { path => "/modules/excluded-$module->{name}", root => $copy_tree }); - eval { rm_rf($copy_tree) }; + run_as_root('rm', '-rf', $copy_tree); } my $loop = $loop_types{$build->{loopbacks}{exclude}{type}}; $loop->{build}->($build, { path => "/excluded", root => $excluded_tree, exclude => \@modules_files }); - eval { rm_rf($excluded_tree) }; + run_as_root('rm', '-rf', $excluded_tree); } } @@ -101,7 +101,7 @@ sub hardlink_filtered { my $list_file = tmpnam(); output_p($list_file, map { "$_\n" } grep { -e $src . $_ } @$files); #- cpio -pldm won't copy recursively, use rsync -r instead - system('rsync', '-ar', '--files-from=' . $list_file, '--link-dest=' . $src, $src, $dest); + run_as_root('rsync', '-ar', '--files-from=' . $list_file, '--link-dest=' . $src, $src, $dest); unlink $list_file; } |