From d8815b1cd746f2875aff435dc9f6137e0fcf68fd Mon Sep 17 00:00:00 2001 From: "Guilherme G. Piccoli" Date: Mon, 28 Nov 2022 17:43:01 -0300 Subject: [PATCH] kdump-load/save-dumps: Use shell options to improve reliability Add hereby "set -uo pipefail", with the goal of improving reliability (suggested by Emil/@xexaxo). Notice that the suggestion included "-e", but we make use of this, by checking non-zero pipes, so instead of refactoring the code to just have this option, the choice was to not have it. Also, make use of bash as the shell to execute the tools - after some analysis, we make use of few bashisms that are a bummer to change, since a lot of scripts in SteamOS make use of bash and in general it is a very common shell, let's just go along with it. Signed-off-by: Guilherme G. Piccoli --- kdump-load.sh | 1 + module-setup.sh | 2 +- save-dumps.sh | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kdump-load.sh b/kdump-load.sh index 7382a9f..83a38aa 100644 --- a/kdump-load.sh +++ b/kdump-load.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -uo pipefail # # SPDX-License-Identifier: LGPL-2.1+ # diff --git a/module-setup.sh b/module-setup.sh index 1cc6992..a4c73aa 100644 --- a/module-setup.sh +++ b/module-setup.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # SPDX-License-Identifier: LGPL-2.1+ # diff --git a/save-dumps.sh b/save-dumps.sh index 7060c25..08fef74 100644 --- a/save-dumps.sh +++ b/save-dumps.sh @@ -1,4 +1,5 @@ -#!/bin/sh +#!/bin/bash +set -uo pipefail # # SPDX-License-Identifier: LGPL-2.1+ #