[pve-devel] [PATCH installer] auto: do not allow btrfs as root-fs if not enabled in the setup
Christoph Heiss
c.heiss at proxmox.com
Tue Nov 26 14:27:44 CET 2024
Add a check such that this combination is not possible, if not enabled
for the specific iso.
Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
proxmox-auto-installer/src/utils.rs | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/proxmox-auto-installer/src/utils.rs b/proxmox-auto-installer/src/utils.rs
index 2be81ea..6482966 100644
--- a/proxmox-auto-installer/src/utils.rs
+++ b/proxmox-auto-installer/src/utils.rs
@@ -281,6 +281,16 @@ fn get_first_selected_disk(config: &InstallConfig) -> usize {
.expect("could not parse key to usize")
}
+fn verify_filesystem_settings(answer: &Answer, setup_info: &SetupInfo) -> Result<()> {
+ info!("Verifying filesystem settings");
+
+ if answer.disks.fs_type.is_btrfs() && !setup_info.config.enable_btrfs {
+ bail!("BTRFS not supported as root filesystem");
+ }
+
+ Ok(())
+}
+
fn verify_locale_settings(answer: &Answer, locales: &LocaleInfo) -> Result<()> {
info!("Verifying locale settings");
if !locales
@@ -345,6 +355,9 @@ pub fn parse_answer(
setup_info: &SetupInfo,
) -> Result<InstallConfig> {
info!("Parsing answer file");
+
+ verify_filesystem_settings(answer, setup_info)?;
+
info!("Setting File system");
let filesystem = answer.disks.fs_type;
info!("File system selected: {}", filesystem);
--
2.47.0
More information about the pve-devel
mailing list