]> git.proxmox.com Git - pve-installer.git/commitdiff
tui: don't abort install if min ram requirement is not met
authorNoel Ullreich <n.ullreich@proxmox.com>
Mon, 10 Jul 2023 09:22:27 +0000 (11:22 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 13 Jul 2023 14:02:50 +0000 (16:02 +0200)
If the minimum requirements are not met, the TUI installer will create a
popup notifying you that the install might not work and then exits the
installer.
While the GUI also creates such a popup, it will not exit the installer.
This patch adapts the behavior of the GUI: the TUI creates a popup
warning you that min spec is not met but doesn't abort the install.

Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
 [T: fix conflict in context and drop intermediate variable ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxmox-tui-installer/src/main.rs
proxmox-tui-installer/src/system.rs

index 109def35d63c2ca27e1dad8334ab4600d494cfd1..42f278b6bb850b8829c8243d5929ac3a1cc9470c 100644 (file)
@@ -241,8 +241,6 @@ fn installer_setup(in_test_mode: bool) -> Result<(LocaleInfo, RuntimeInfo), Stri
             .map_err(|err| format!("Failed to retrieve runtime environment info: {err}"))?
     };
 
-    system::has_min_requirements(&runtime_info)?;
-
     runtime_info.disks.sort();
     if runtime_info.disks.is_empty() {
         Err("The installer could not find any supported hard disks.".to_owned())
@@ -264,6 +262,16 @@ fn installer_setup_late(siv: &mut Cursive) {
         }
     }
 
+    if state.runtime_info.total_memory < 1024 {
+        display_setup_warning(
+            siv,
+            concat!(
+                "Less than 1 GiB of usable memory detected, installation will probably fail.\n\n",
+                "See 'System Requirements' in the documentation."
+            ),
+        );
+    }
+
     if state.setup_info.config.product == ProxmoxProduct::PVE && !state.runtime_info.hvm_supported {
         display_setup_warning(
             siv,
index baceab91fe8cb2ff5d8e6aef382bd0e74909c199..bbf13b81a69f0693a13ebe0005620cfb3a60d542 100644 (file)
@@ -1,18 +1,6 @@
 use std::{fs::OpenOptions, io::Write, process::Command};
 
-use crate::setup::{KeyboardMapping, RuntimeInfo};
-
-pub fn has_min_requirements(info: &RuntimeInfo) -> Result<(), String> {
-    if info.total_memory < 1024 {
-        return Err(concat!(
-            "Less than 1 GiB of usable memory detected, installation will probably fail.\n\n",
-            "See 'System Requirements' in the documentation."
-        )
-        .to_owned());
-    }
-
-    Ok(())
-}
+use crate::setup::KeyboardMapping;
 
 pub fn set_keyboard_layout(kmap: &KeyboardMapping) -> Result<(), String> {
     Command::new("setxkbmap")