Re: [pve-devel] [PATCH installer 3/6] fix #5250: proxinstall: expose new btrfs `compress` option

2024-05-14 Thread Christoph Heiss
On Mon, May 13, 2024 at 02:13:52PM +0200, Christoph Heiss wrote:
> Signed-off-by: Christoph Heiss 
> ---
>  Proxmox/Install.pm |  7 +--
>  proxinstall| 15 +++
>  2 files changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm
> index f3bc5aa..60f38e5 100644
> --- a/Proxmox/Install.pm
> +++ b/Proxmox/Install.pm
> @@ -1014,8 +1014,11 @@ sub extract_data {
>   my $btrfs_opts = Proxmox::Install::Config::get_btrfs_opt();
>
>   my $mountopts = 'defaults';
> - $mountopts .= ",compress=$btrfs_opts->{compress}"
> - if $btrfs_opts->{compress} ne 'off';
> + if ($btrfs_opts->{compress} eq 'on') {
> + $mountopts .= ',compress';
> + } elsif ($btrfs_opts->{compress} ne 'off') {
> + $mountopts .= ",compress=$btrfs_opts->{compress}";
> + }

That was supposed to be squashed into the previous patch, whoops!
I'll send a v2 soon if nothing else comes up, sorry for the noise.


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] [PATCH installer 3/6] fix #5250: proxinstall: expose new btrfs `compress` option

2024-05-13 Thread Christoph Heiss
Signed-off-by: Christoph Heiss 
---
 Proxmox/Install.pm |  7 +--
 proxinstall| 15 +++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm
index f3bc5aa..60f38e5 100644
--- a/Proxmox/Install.pm
+++ b/Proxmox/Install.pm
@@ -1014,8 +1014,11 @@ sub extract_data {
my $btrfs_opts = Proxmox::Install::Config::get_btrfs_opt();
 
my $mountopts = 'defaults';
-   $mountopts .= ",compress=$btrfs_opts->{compress}"
-   if $btrfs_opts->{compress} ne 'off';
+   if ($btrfs_opts->{compress} eq 'on') {
+   $mountopts .= ',compress';
+   } elsif ($btrfs_opts->{compress} ne 'off') {
+   $mountopts .= ",compress=$btrfs_opts->{compress}";
+   }
 
$fstab .= "UUID=$fsuuid / btrfs $mountopts 0 1\n";
} else {
diff --git a/proxinstall b/proxinstall
index a6a4cfb..7180fe6 100755
--- a/proxinstall
+++ b/proxinstall
@@ -1160,6 +1160,21 @@ my $create_raid_advanced_grid = sub {
 my $create_btrfs_raid_advanced_grid = sub {
 my ($hdsize_btn) = @_;
 my $labeled_widgets = [];
+
+my $combo_compress = Gtk3::ComboBoxText->new();
+$combo_compress->set_tooltip_text("btrfs compression algorithm for boot 
volume");
+my $comp_opts = ["on", "off", "zlib", "lzo", "zstd"];
+foreach my $opt (@$comp_opts) {
+   $combo_compress->append($opt, $opt);
+}
+my $compress = Proxmox::Install::Config::get_btrfs_opt('compress') // 
'off';
+$combo_compress->set_active_id($compress);
+$combo_compress->signal_connect (changed => sub {
+   my $w = shift;
+   Proxmox::Install::Config::set_btrfs_opt('compress', 
$w->get_active_text());
+});
+push @$labeled_widgets, ['compress', $combo_compress];
+
 push @$labeled_widgets, ['hdsize', $hdsize_btn, 'GB'];
 return $create_label_widget_grid->($labeled_widgets);;
 };
-- 
2.44.0



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel