summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/finish-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/finish-install')
-rwxr-xr-xperl-install/standalone/finish-install36
1 files changed, 30 insertions, 6 deletions
diff --git a/perl-install/standalone/finish-install b/perl-install/standalone/finish-install
index 09f62ab1d..8bc9dad9d 100755
--- a/perl-install/standalone/finish-install
+++ b/perl-install/standalone/finish-install
@@ -12,6 +12,7 @@ use any;
use authentication;
use network::network;
use security::level;
+use messages;
my $conf_file = '/etc/sysconfig/finish-install';
my %conf = getVarsFromSh($conf_file);
@@ -23,7 +24,9 @@ my $timezone;
network::network::read_net_conf($net);
$::isWizard = 1;
-my $in = 'interactive'->vnew;
+my $in = 'interactive'->vnew('su');
+$in->{untranslated_license} = messages::main_license_raw();
+
any::set_wm_hints_if_needed($in);
sub get_conf {
@@ -55,7 +58,7 @@ sub ask_keyboard() {
choose:
$keyboard->{KEYBOARD} = $in->ask_from_listf(N("Keyboard"),
- N("Please, choose your keyboard layout."),
+ N("Please choose your keyboard layout."),
sub { translate(keyboard::KEYBOARD2text($_[0])) },
[ keyboard::KEYBOARDs() ],
$keyboard->{KEYBOARD}) or return;
@@ -72,7 +75,7 @@ sub ask_timezone() {
$timezone->{timezone} = timezone::bestTimezone($locale->{country}) if $locale->{country};
any::configure_timezone($in, $timezone, 'ask_gmt', lc(get_conf('TIMEZONE')) eq 'simplified');
- $in->do_pkgs->ensure_is_installed('ntp') if $timezone->{ntp};
+ $in->do_pkgs->ensure_is_installed('chrony') if $timezone->{ntp};
timezone::write($timezone);
#- reload sys clock from hc once we know the real timezone
@@ -99,6 +102,7 @@ sub ask_country() {
sub ask_network() {
require network::tools;
+ require services;
return if network::tools::has_network_connection();
#- test again connection after waiting for network-up service
@@ -114,8 +118,10 @@ sub ask_network() {
}
sub ask_urpmi() {
- #- configure urpmi media if no media are configured
- run_program::get_stdout('urpmq', '--list-media') and return;
+ #- configure urpmi media if no online media are configured
+ my @media_url = map { top(split(' ', $_)) } run_program::get_stdout('urpmq', '--list-url');
+ my @online_media = grep { !m,^(?:file://)?/, } @media_url;
+ @online_media and return;
any::urpmi_add_all_media($in);
}
@@ -170,7 +176,7 @@ sub ask_users() {
#- replace home path in user config files
my $old_home = "/home/$old_user";
my $new_home = "/home/$users->[0]{name}";
- run_program::run(qq(grep -rl $old_home $new_home/.??* | while read f; do perl -pi -e 's,$old_home,$new_home,g' "\$f"; done));
+ run_program::run(qq(grep -D skip -rl $old_home $new_home/.??* | while read f; do perl -pi -e 's,$old_home,$new_home,g' "\$f"; done));
#- give console rights for current session
my $console_dir = "/var/run/console";
cp_f($console_dir . "/" . $old_user, $console_dir . "/" . $users->[0]{name}) if -e $console_dir . "/" . $old_user;
@@ -214,6 +220,7 @@ sub encrypt_home {
s/^volume $user->{name}.*//;
$_ .= "volume $user->{name} crypt - $device $home - - -\n" if eof;
} $::prefix . '/etc/security/pam_mount.conf';
+
authentication::set_pam_authentication('mount');
run_program::raw({ root => $::prefix, sensitive_arguments => 1 },
@@ -245,6 +252,21 @@ sub encrypt_home {
run_program::rooted($::prefix, 'umount', $home);
run_program::rooted($::prefix, 'cryptsetup', 'luksClose', $user->{name});
+ undef $wait;
+}
+
+sub ask_gnome_reboot() {
+ my $lock_file = '/etc/draklive-install.d/gnome-reboot';
+ if (!is_mgalive()) {
+ if (-f $lock_file) {
+ run_program::run('/usr/bin/rm', '-f', $lock_file);
+ # FIXME: convert to perl/gtk* window popup for translation support
+ system('/usr/bin/zenity', qw(--timeout=20 --title), N("Finishing install"), qw(--no-wrap --info --text), N("This system will be rebooted\nfor the changes to take effect!"));
+ run_program::run('/usr/bin/chown', '-R', 'gdm:gdm', '/var/lib/gdm');
+ run_program::run('/usr/sbin/ldconfig', '-X');
+ run_program::run('/usr/bin/systemctl', 'reboot');
+ }
+ }
}
sub call {
@@ -280,4 +302,6 @@ call('encrypt_home');
call('glx');
setVarsInSh($conf_file, { FINISH_INSTALL => 'no' });
+call('gnome_reboot');
+
$in->exit(0);