From: Fabian Grünbichler Date: Fri, 12 Jul 2019 13:16:51 +0000 (+0200) Subject: efiboot: guard against grep returning non-zero X-Git-Url: https://git.proxmox.com/?p=pve-kernel-meta.git;a=commitdiff_plain;h=4f11dd63474b1269ea2e6bc60ead6effc9e11858 efiboot: guard against grep returning non-zero which would trigger 'set -e', instead of continuing with correct (empty) strings. Signed-off-by: Fabian Grünbichler --- diff --git a/bin/pve-efiboot-tool b/bin/pve-efiboot-tool index 3abeb8e..be56a81 100755 --- a/bin/pve-efiboot-tool +++ b/bin/pve-efiboot-tool @@ -240,8 +240,8 @@ list_kernels() { boot_kernels="$(boot_kernel_list)" if [ -e "$MANUAL_KERNEL_LIST" ]; then - manual_kernels="$(echo "$boot_kernels" | grep -Fx -f "$MANUAL_KERNEL_LIST")" - boot_kernels="$(echo "$boot_kernels" | grep -Fxv -f "$MANUAL_KERNEL_LIST")" + manual_kernels="$(echo "$boot_kernels" | grep -Fx -f "$MANUAL_KERNEL_LIST" || true)" + boot_kernels="$(echo "$boot_kernels" | grep -Fxv -f "$MANUAL_KERNEL_LIST" || true)" fi if [ -z "$manual_kernels" ]; then diff --git a/efiboot/functions b/efiboot/functions index 8c473a4..a179713 100755 --- a/efiboot/functions +++ b/efiboot/functions @@ -67,8 +67,7 @@ kernel_keep_versions() { boot_kernel_list() { list="$(kernel_keep_versions "$@")" - echo "$list" | grep -E '^[^ ]+-pve' - + echo "$list" | grep -E '^[^ ]+-pve' || true } warn() { diff --git a/efiboot/pve-auto-removal b/efiboot/pve-auto-removal index 8aba624..7b21ec4 100755 --- a/efiboot/pve-auto-removal +++ b/efiboot/pve-auto-removal @@ -26,7 +26,7 @@ generate_apt_config() { cat <<-EOF /* Debug information: # dpkg list: - $(dpkg -l | grep 'pve-kernel') + $(dpkg -l | grep -F 'pve-kernel' || true) # list of installed kernel packages: $kernels */