summaryrefslogtreecommitdiffstats
path: root/lib/MGA/DrakISO/BuildLoop.pm
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2018-01-09 23:17:35 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2018-01-09 23:17:35 +0000
commit63555aa270059488b013e6c802cca64a8d6eebdc (patch)
tree75c481453e459dc2aea279a86eb89ceedfd0ecf1 /lib/MGA/DrakISO/BuildLoop.pm
parent71146812d733fdc46abe1d77b7d68f9859cdc124 (diff)
downloaddrakiso-63555aa270059488b013e6c802cca64a8d6eebdc.tar
drakiso-63555aa270059488b013e6c802cca64a8d6eebdc.tar.gz
drakiso-63555aa270059488b013e6c802cca64a8d6eebdc.tar.bz2
drakiso-63555aa270059488b013e6c802cca64a8d6eebdc.tar.xz
drakiso-63555aa270059488b013e6c802cca64a8d6eebdc.zip
draklive: allow installer GUI to be used and run as normal user.
Read all configuration from the main config file and automatically generate the auto_inst.cfg.pl file. Run the installer GUI in a nested X server if any items are not specified in the config file. Use sudo to run any steps that need root privileges, to avoid running the X server as root.
Diffstat (limited to 'lib/MGA/DrakISO/BuildLoop.pm')
-rw-r--r--lib/MGA/DrakISO/BuildLoop.pm14
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;
}