From b79d17d2334fdf7907e013d455cecf796a548d7d Mon Sep 17 00:00:00 2001 From: Viktor Mihajlovski Date: Mon, 3 Jan 2022 16:59:43 +0100 Subject: [PATCH] cpictl: Suppress messages for unwritable sysfs files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Under certain conditions, e.g. in a KVM guest, a write operation to /sys/firmware/cpi/set can result in an error message to stderr while the script returns with a zero exit code, indicating success. This can cause confusion if cpictl is called by systemd due to the existence of a writable /sys/firmware/cpi/. Let's silence cpictl when writing to the /sys/firmware/cpi/set. This is OK, as nothing can be inferred from failure or success from the perspective of the invoking Linux instance. Fixes: https://github.com/ibm-s390-linux/s390-tools/issues/120 Signed-off-by: Viktor Mihajlovski Reviewed-by: Jan Höppner Signed-off-by: Jan Höppner --- scripts/cpictl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cpictl b/scripts/cpictl index a0894de3..00541449 100755 --- a/scripts/cpictl +++ b/scripts/cpictl @@ -109,7 +109,7 @@ fail_with() cpi_commit() { - echo 1 > "$CPI_SET" + echo 1 > "$CPI_SET" 2> /dev/null } do_length_check()