]> git.proxmox.com Git - pve-kernel-meta.git/commitdiff
efiboot: guard against grep returning non-zero
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 12 Jul 2019 13:16:51 +0000 (15:16 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 15 Jul 2019 12:28:21 +0000 (14:28 +0200)
which would trigger 'set -e', instead of continuing with correct (empty)
strings.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
bin/pve-efiboot-tool
efiboot/functions
efiboot/pve-auto-removal

index 3abeb8edc3d8fe80078ad4fa2291ba33368c407b..be56a811a852de597cd3776f3bb2b20892619017 100755 (executable)
@@ -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
index 8c473a4f8194ea0ff7f68f3af2e0f9a620cfe930..a1797132fb74abaf2d6e9e24bee543fe12695ef5 100755 (executable)
@@ -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() {
index 8aba6242cc9b5e6452ac1c5a0652255c4a05904d..7b21ec4fdbf79c078e92cedc8e418917b72b1303 100755 (executable)
@@ -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
                */