]> git.proxmox.com Git - pve-installer.git/commitdiff
switch "maxroot" over to central config
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 20 Jun 2023 06:33:21 +0000 (08:33 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 20 Jun 2023 06:33:21 +0000 (08:33 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Proxmox/Install/Config.pm
proxinstall

index 96e99191bb6f3cb00300de9a7abbbed21666d7eb..90948d31807e6b5fa60bdf25f004e837521d5bd3 100644 (file)
@@ -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;
index 5e3ed4b9ce8899af96403183d7f7a433f12ac801..dc65262055d6b8309bfbbfc98807125128f38a9d 100755 (executable)
@@ -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))) {