From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 24C221FF170 for ; Thu, 7 Aug 2025 16:21:18 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B051D30FDC; Thu, 7 Aug 2025 16:22:51 +0200 (CEST) From: Shannon Sterz To: pve-devel@lists.proxmox.com Date: Thu, 7 Aug 2025 16:22:46 +0200 Message-ID: <20250807142246.341381-1-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.2 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1754576544742 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.127 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager v2] 8 to 9: use check for unified cgroup v2 support via pve-container X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" ...instead of re-implementing a custom check here. This has the side-effect that the check implemented by pve-container is much more robust and is less likely to yield false positive. So users won't get warnings about containers that actually do have the required unified cgroup v2 support. This was reported for an OpenSUSE Slowroll container on the forum: https://forum.proxmox.com/threads/169302/ Signed-off-by: Shannon Sterz --- changes since v1, thanks @ Fiona Ebner: - move away from implementing the check here and just use the one from pve-container directly PVE/CLI/pve8to9.pm | 61 +++++++--------------------------------------- 1 file changed, 9 insertions(+), 52 deletions(-) diff --git a/PVE/CLI/pve8to9.pm b/PVE/CLI/pve8to9.pm index 994189f13..d2a7346c0 100644 --- a/PVE/CLI/pve8to9.pm +++ b/PVE/CLI/pve8to9.pm @@ -1267,50 +1267,6 @@ sub check_containers_cgroup_compat { my $supports_cgroupv2 = sub { my ($conf, $rootdir, $ctid) = @_; - my $get_systemd_version = sub { - my ($self) = @_; - - my @dirs = ( - '/lib/systemd', - '/usr/lib/systemd', - '/usr/lib/x86_64-linux-gnu/systemd', - '/usr/lib64/systemd', - ); - my $libsd; - for my $dir (@dirs) { - $libsd = PVE::Tools::dir_glob_regex($dir, "libsystemd-shared-.+\.so"); - last if defined($libsd); - } - if ( - defined($libsd) && $libsd =~ /libsystemd-shared-(\d+)(\.\d-\d)?(\.fc\d\d)?\.so/ - ) { - return $1; - } - - return undef; - }; - - my $unified_cgroupv2_support = sub { - my ($self) = @_; - - # https://www.freedesktop.org/software/systemd/man/systemd.html - # systemd is installed as symlink to /sbin/init - my $systemd = CORE::readlink('/sbin/init'); - - # assume non-systemd init will run with unified cgroupv2 - if (!defined($systemd) || $systemd !~ m@/systemd$@) { - return 1; - } - - # systemd version 232 (e.g. debian stretch) supports the unified hierarchy - my $sdver = $get_systemd_version->(); - if (!defined($sdver) || $sdver < 232) { - return 0; - } - - return 1; - }; - my $ostype = $conf->{ostype}; if (!defined($ostype)) { log_warn("Found CT ($ctid) without 'ostype' set!"); @@ -1319,7 +1275,7 @@ sub check_containers_cgroup_compat { } my $lxc_setup = PVE::LXC::Setup->new($conf, $rootdir); - return $lxc_setup->protected_call($unified_cgroupv2_support); + return $lxc_setup->unified_cgroupv2_support(); }; my $log_problem = sub { @@ -1604,7 +1560,9 @@ sub check_bootloader { if (!-d '/sys/firmware/efi') { if (-f "/usr/share/doc/systemd-boot/changelog.Debian.gz") { - log_info("systemd-boot package installed on legacy-boot system is not necessary, consider remoing it"); + log_info( + "systemd-boot package installed on legacy-boot system is not necessary, consider remoing it" + ); return; } log_skip("System booted in legacy-mode - no need for additional packages"); @@ -1618,8 +1576,8 @@ sub check_bootloader { } if (-f "/usr/share/doc/systemd-boot/changelog.Debian.gz") { log_warn("systemd-boot meta-package installed this will cause issues on upgrades of" - ." boot-related packages. Install 'systemd-boot-efi' and 'systemd-boot-tools' explicitly" - ." and remove 'systemd-boot'"); + . " boot-related packages. Install 'systemd-boot-efi' and 'systemd-boot-tools' explicitly" + . " and remove 'systemd-boot'"); return; } } else { @@ -1639,7 +1597,8 @@ sub check_bootloader { } if (!-f "/usr/share/doc/grub-efi-amd64/changelog.Debian.gz") { log_warn("System booted in uefi mode but grub-efi-amd64 meta-package not installed," - . " new grub versions will not be installed to /boot/efi! Install grub-efi-amd64."); + . " new grub versions will not be installed to /boot/efi! Install grub-efi-amd64." + ); return; } else { log_pass("bootloader packages installed correctly"); @@ -1831,9 +1790,7 @@ sub check_lvm_autoactivation { . "\t/usr/share/pve-manager/migrations/pve-lvm-disable-autoactivation" . "\n"); } else { - log_pass( - "No problematic volumes found." - ); + log_pass("No problematic volumes found."); } return undef; -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel