summaryrefslogtreecommitdiffstats
path: root/draklive
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 /draklive
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 'draklive')
-rwxr-xr-xdraklive16
1 files changed, 8 insertions, 8 deletions
diff --git a/draklive b/draklive
index 13cfa51..6d2b675 100755
--- a/draklive
+++ b/draklive
@@ -51,12 +51,14 @@ $::verbose = 1;
sub clean {
my ($build) = @_;
- if (-e ($build->get_system_root)) {
- # Make sure there's nothing left mounted in the chroot.
- umount_all_in_chroot($build);
- system('sudo rm -rf ' . $build->get_system_root);
+ if (-e $build->get_builddir) {
+ umount_all_in_root($build->get_builddir);
+ system('sudo rm -rf ' . $build->get_builddir);
+ }
+ if (-e $build->get_chroot_dir) {
+ umount_all_in_root($build->get_chroot_dir);
+ system('sudo rm -rf ' . $build->get_chroot_dir);
}
- system('rm -rf ' . $build->get_builddir) if -e ($build->get_builddir);
}
sub prepare_root {
@@ -79,7 +81,7 @@ my @actions = (
{ name => 'dump-config', do => \&MGA::DrakISO::Config::dump_config },
{ name => 'clean', do => \&clean },
{ name => 'root', do => \&prepare_root },
- { name => 'root-create', do => \&MGA::DrakISO::BuildRoot::install_live_system },
+ { name => 'root-install', do => \&MGA::DrakISO::BuildRoot::install_live_system },
{ name => 'root-customise', do => \&MGA::DrakISO::BuildRoot::customise_live_system },
{ name => 'boot', do => \&prepare_boot },
{ name => 'boot-system', do => \&MGA::DrakISO::BuildBoot::prepare_live_system_boot },
@@ -89,8 +91,6 @@ my @actions = (
);
my @all = qw(root boot loop master);
-die "you must be root to run this program\n" if $>;
-
my $build_object = 'MGA::DrakISO::LiveBuild'->new;
my $config_root = '/etc/draklive';
my $config_path = 'config/build.cfg';