aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWynn Wolf Arbor2020-05-16 11:33:17 +0200
committerWynn Wolf Arbor2020-05-16 11:33:17 +0200
commitb5fe3282d2d44d858990639cb7d13aae53e07170 (patch)
tree822e7325fbf086a9c98b7306ea2f7f66ac044383
parente25e7ad50bb82b416e2c703356867a8be7cb9d09 (diff)
downloadkern-b5fe3282d2d44d858990639cb7d13aae53e07170.tar.gz
Don't exit if newest kernel is selected
It was really never a good idea to make this a fatal error, especially considering consecutive calls of kern(1) without any arguments will fail after the kernel has been set successfully once.
-rwxr-xr-xkern9
1 files changed, 7 insertions, 2 deletions
diff --git a/kern b/kern
index f4a8be3..c6b2a57 100755
--- a/kern
+++ b/kern
@@ -5,8 +5,12 @@ set -e
SRCDIR=/usr/src
KERNFRAG=${KERNFRAG:-/etc/kernfrag}
-errx() {
+err() {
printf "kern: %s\n" "$@" >&2
+}
+
+errx() {
+ err "$@"
exit 1
}
@@ -36,7 +40,8 @@ set_kernel() {
fi
if test "$kern" = "$current"; then
- errx "Latest kernel already selected: $kern"
+ err "Warning: Latest kernel already selected: $kern"
+ return
fi
printf "Selecting kernel: %s\n" "$kern"