mirror of
https://git.proxmox.com/git/pve-kernel-meta
synced 2025-07-05 14:00:45 +00:00

which would trigger 'set -e', instead of continuing with correct (empty) strings. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
40 lines
889 B
Bash
Executable File
40 lines
889 B
Bash
Executable File
#! /bin/sh
|
|
set -e
|
|
|
|
. /usr/share/pve-kernel-helper/scripts/functions
|
|
|
|
eval "$(apt-config shell APT_CONF_D Dir::Etc::parts/d)"
|
|
test -n "${APT_CONF_D}" || APT_CONF_D="/etc/apt/apt.conf.d"
|
|
|
|
config_file="${APT_CONF_D}/76pveconf"
|
|
|
|
generate_apt_config() {
|
|
|
|
kernels="$(kernel_keep_versions "$@")"
|
|
|
|
cat <<- EOF
|
|
// DO NOT EDIT! File autogenerated by $0
|
|
APT::NeverAutoRemove
|
|
{
|
|
EOF
|
|
for kernel in $kernels; do
|
|
escaped_kver="$(echo "$kernel" | sed -e 's#\([\.\+]\)#\\\1#g')"
|
|
echo " \"^pve-kernel-${escaped_kver}$\";"
|
|
done
|
|
echo '};'
|
|
if [ "${APT_AUTO_REMOVAL_KERNELS_DEBUG:-false}" = 'true' ]; then
|
|
cat <<-EOF
|
|
/* Debug information:
|
|
# dpkg list:
|
|
$(dpkg -l | grep -F 'pve-kernel' || true)
|
|
# list of installed kernel packages:
|
|
$kernels
|
|
*/
|
|
EOF
|
|
fi
|
|
}
|
|
|
|
generate_apt_config "$@" > "${config_file}.dpkg-new"
|
|
mv -f "${config_file}.dpkg-new" "$config_file"
|
|
chmod 444 "$config_file"
|