Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cpictl: Suppress messages for unwritable sysfs files
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: #120

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
  • Loading branch information
Viktor Mihajlovski authored and hoeppnerj committed Jan 20, 2022
1 parent 11b401b commit b79d17d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/cpictl
Expand Up @@ -109,7 +109,7 @@ fail_with()

cpi_commit()
{
echo 1 > "$CPI_SET"
echo 1 > "$CPI_SET" 2> /dev/null
}

do_length_check()
Expand Down

0 comments on commit b79d17d

Please sign in to comment.