From: Thomas Lamprecht Date: Tue, 20 Jun 2023 06:33:21 +0000 (+0200) Subject: switch "maxroot" over to central config X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=b4ab3f1926f0291be27d5fcb462c9482102ab104;p=pve-installer.git switch "maxroot" over to central config Signed-off-by: Thomas Lamprecht --- diff --git a/Proxmox/Install/Config.pm b/Proxmox/Install/Config.pm index 96e9919..90948d3 100644 --- a/Proxmox/Install/Config.pm +++ b/Proxmox/Install/Config.pm @@ -98,4 +98,7 @@ sub get_hdsize { return get('hdsize'); } sub set_swapsize { set_key('swapsize', $_[0]); } sub get_swapsize { return get('swapsize'); } +sub set_maxroot { set_key('maxroot', $_[0]); } +sub get_maxroot { return get('maxroot'); } + 1; diff --git a/proxinstall b/proxinstall index 5e3ed4b..dc65262 100755 --- a/proxinstall +++ b/proxinstall @@ -401,8 +401,8 @@ sub create_lvm_volumes { if ($iso_env->{product} eq 'pve') { my $maxroot_mb; - if ($config_options->{maxroot}) { - $maxroot_mb = $config_options->{maxroot} * 1024; + if (my $maxroot = Proxmox::Install::Config::get_maxroot()) { + $maxroot_mb = $maxroot * 1024; } else { $maxroot_mb = 96 * 1024; } @@ -2404,7 +2404,9 @@ sub create_hdoption_view { if ($iso_env->{product} eq 'pve') { $entry_maxroot->set_tooltip_text("maximum size (GB) for LVM root volume"); $entry_maxroot->signal_connect (key_press_event => \&check_float); - $entry_maxroot->set_text($config_options->{maxroot}) if $config_options->{maxroot}; + if (my $maxroot = Proxmox::Install::Config::get_maxroot()) { + $entry_maxroot->set_text($maxroot); + } push @$hdsize_labeled_widgets, "maxroot", $entry_maxroot; } @@ -2529,9 +2531,9 @@ sub create_hdoption_view { } if (defined($tmp = &$get_float($entry_maxroot))) { - $config_options->{maxroot} = $tmp; + Proxmox::Install::Config::set_maxroot($tmp); } else { - delete $config_options->{maxroot}; + Proxmox::Install::Config::set_maxroot(undef); } if (defined($tmp = &$get_float($entry_minfree))) {