From baec330439b6b8c8d47aa368623c68098d935da0 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 7 Oct 2019 11:48:17 +0200 Subject: [PATCH] pdist: Do not delete running kernel Add excludes on the client for the Linux version specific files and directories of the running kernel. This prevents the running kernel from being deleted on the client in case it is not installed on the distmaster. This can be usefull for kernel testing. Also it prevents errors, when we by mistake purge a kernel from the distmaster which is still in use. Notes: - The excludes just prevent files from being deleted, not from being replaced. - If we want to disable a loadable module (e.g. because we learned about a security problem with it and don't need it), we can't just delete the .ko file and trust pdist to delete it on the clients as well. We can replace it by an empty file instead. - The script doesn't keep the bee index, bee cache or the grub menu from being updated. --- pdist/pdist | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pdist/pdist b/pdist/pdist index d988b14..429bb6a 100755 --- a/pdist/pdist +++ b/pdist/pdist @@ -651,6 +651,20 @@ sub prog_update local($, , $\)=(' ',"\n"); + if ($function == F_UPDATE) { + chomp (my $linux_version=`uname -r`); # '5.4.0-rc2.mx64.295' + if ($linux_version) { + my ($build) = $linux_version =~ /\.(\d+)$/; + push @EXCEPTS, + "/boot/mariux.$build", + "/boot/bzImage-$linux_version", + "/lib/modules/$linux_version", + "/boot/config-$linux_version", + "/boot/System.map-$linux_version", + "/usr/share/nvidia/kernel/$linux_version", + } + } + if ($tarfile && $tarfile ne '-') { -d $TMPDIR or mkdir $TMPDIR or die $TMPDIR.": $!\n"; if (-d $TMPUPDDIR) {