[PATCH dab] fix an error on creating a debian trixie image

Jing Luo jing at jing.rocks
Sat Dec 7 09:42:28 CET 2024


debian trixie no longer ships "/etc/sysctl.conf", so this fix is needed.

Signed-off-by: Jing Luo <jing at jing.rocks>
---
 PVE/DAB.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/DAB.pm b/PVE/DAB.pm
index f318be5..9e80d6e 100644
--- a/PVE/DAB.pm
+++ b/PVE/DAB.pm
@@ -1601,7 +1601,9 @@ EOD
     $cmd .= ' -e \'s/^\(fs\.inotify\.max_user_watches.*\)/#\1/\'';
     $cmd .= ' -e \'s/^\(vm\.mmap_min_addr.*\)/#\1/\'';
     $cmd .= " -i '$rootdir/etc/sysctl.conf'";
-    $self->run_command ($cmd);
+    if (-f "$rootdir/etc/sysctl.conf") {
+	$self->run_command ($cmd);
+    }
 
     my $bindv6only = "$rootdir/etc/sysctl.d/bindv6only.conf";
     if (-f $bindv6only) {
-- 
2.47.1





More information about the pve-devel mailing list