diff options
Diffstat (limited to 'lib/MGA/DrakISO/BuildLoop.pm')
-rw-r--r-- | lib/MGA/DrakISO/BuildLoop.pm | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/MGA/DrakISO/BuildLoop.pm b/lib/MGA/DrakISO/BuildLoop.pm index 01aefca..9f0475b 100644 --- a/lib/MGA/DrakISO/BuildLoop.pm +++ b/lib/MGA/DrakISO/BuildLoop.pm @@ -44,8 +44,11 @@ our @EXPORT = qw(build_live_loopback_files list_loopback_modules); # sub build_live_loopback_files { my ($build) = @_; + + my $root = $build->get_live_root; + # make sure no external filesystems are mounted before creating the loopback - umount_all_in_root($build->get_system_root); + umount_all_in_root($root); my @excluded_files = expand_file_list($build, @{$build->{loopbacks}{exclude}{files} || []}); my @modules_files = expand_file_list($build, @{$build->{loopbacks}{modules} || []}); @@ -56,21 +59,21 @@ sub build_live_loopback_files { } foreach my $module (list_loopback_modules($build)) { - my $copy_tree = $build->get_system_root . "/tmp/draklive/loop/$module->{name}"; + my $copy_tree = $root . "/tmp/draklive/loop/$module->{name}"; run_as_root('rm', '-rf', $copy_tree); - hardlink_filtered($build->get_system_root, $copy_tree, $module->{files}); + hardlink_filtered($root, $copy_tree, $module->{files}); my $loop = $loop_types{$module->{type}}; $loop->{build}->($build, { path => "/modules/$module->{name}", root => $copy_tree, exclude => \@excluded_files }); run_as_root('rm', '-rf', $copy_tree); } if (@excluded_files) { - my $excluded_tree = $build->get_system_root . "/tmp/draklive/excluded/all"; + my $excluded_tree = $root . "/tmp/draklive/excluded/all"; eval { rm_rf($excluded_tree) }; - hardlink_filtered($build->get_system_root, $excluded_tree, \@excluded_files); + hardlink_filtered($root, $excluded_tree, \@excluded_files); foreach my $module (list_loopback_modules($build)) { - my $copy_tree = $build->get_system_root . "/tmp/draklive/excluded/$module->{name}"; + my $copy_tree = $root . "/tmp/draklive/excluded/$module->{name}"; run_as_root('rm', '-rf', $copy_tree); hardlink_filtered($excluded_tree, $copy_tree, $module->{files}); my $loop = $loop_types{$module->{type}}; @@ -90,7 +93,7 @@ sub expand_file_list { map { $_->{path} ? $_->{path} : - chomp_(cat_(glob(($_->{rooted} && $build->get_system_root) . $_->{source}))); + chomp_(cat_(glob(($_->{rooted} && $build->get_live_root) . $_->{source}))); } @files; } @@ -114,7 +117,7 @@ sub list_loopback_modules { my $name = basename($list); $name =~ s/\.[^.]+$//; { type => $l->{type}, name => $name, files => [ expand_file_list($build, { source => $list }) ] }; - } glob(($_->{rooted} && $build->get_system_root) . $_->{source}); + } glob(($_->{rooted} && $build->get_live_root) . $_->{source}); } @{$build->{loopbacks}{modules}}; } |