]> git.proxmox.com Git - pve-installer.git/blobdiff - proxmox-low-level-installer
tui: install_progress: split out low-level installer spawing into own function
[pve-installer.git] / proxmox-low-level-installer
index dd1502f79f1847f4a63c67a0cae58b353109aac8..0f2bf4f68f8cc1e11d85624521bf246694726c35 100755 (executable)
@@ -11,14 +11,14 @@ use JSON;
 use Time::HiRes qw(usleep);
 
 {
-    my $test_mode;
+    my $test_image;
     GetOptions(
-       'test-mode|t' => \$test_mode
+       'test-image|t=s' => \$test_image
     ) or die "usage error\n";
 
-    # FIXME: use cleaner approach for setting tet mode?
-    Proxmox::Install::ISOEnv::set_test_image('/dev/null') if $test_mode;
+    Proxmox::Install::ISOEnv::set_test_image($test_image) if $test_image;
 }
+
 use Proxmox::Install::ISOEnv;
 use Proxmox::Install::RunEnv;
 
@@ -60,7 +60,7 @@ if (!$cmd || $cmd eq 'help' || !exists($commands->{$cmd})) {
 
 Proxmox::Log::init("/tmp/install-low-level-${cmd}.log");
 
-my $env = Proxmox::Install::ISOEnv::setup();
+my $env = Proxmox::Install::ISOEnv::get();
 if ($cmd eq 'dump-env') {
 
     my $out_dir = $env->{locations}->{run};
@@ -74,14 +74,17 @@ if ($cmd eq 'dump-env') {
        'iso-info' => $env->{iso},
        'product' => $env->{product},
        'product-cfg' => $env->{cfg},
+       'run-env-cache-file' => $env->{'run-env-cache-file'},
        'locations' => $env->{locations},
     };
     my $iso_serialized = to_json($iso_info, {canonical => 1, utf8 => 1}) ."\n";
     file_write_all("$out_dir/iso-info.json", $iso_serialized);
 
+    my $run_env_file = Proxmox::Install::ISOEnv::get('run-env-cache-file');
+
     my $run_env = Proxmox::Install::RunEnv::query_installation_environment();
     my $run_env_serialized = to_json($run_env, {canonical => 1, utf8 => 1}) ."\n";
-    file_write_all("$out_dir/run-env-info.json", $run_env_serialized);
+    file_write_all($run_env_file, $run_env_serialized);
 } elsif ($cmd eq 'start-session') {
     Proxmox::UI::init_stdio({}, $env);
 
@@ -143,7 +146,11 @@ if ($cmd eq 'dump-env') {
        }
     }
 
-    # Proxmox::Install::extract_data(); # TODO
+    if (Proxmox::Install::Config::get_autoreboot()) {
+       Proxmox::UI::finished(1, "Installation finished - auto-rebooting in ~ 5 seconds");
+    } else {
+       Proxmox::UI::finished(1, "Installation complete - reboot now?");
+    }
 }
 
 exit(0);