From bbfad01e5598bf52cdfdb49d2bd0539189fcdf4a Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Mon, 21 May 2018 11:06:00 +0300 Subject: [PATCH] e2k: make serial hook more fault-proof The early scheme consisted of boot.conf template with a separate hook filling it in; this was nice for serial console setup script which could just amend the kernel command line as needed _but_ this got changed towards the more generic scheme (breaking the hook in question, unfortunately). --- features.in/e2k/rootfs/image-scripts.d/50-e2k-serial | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/features.in/e2k/rootfs/image-scripts.d/50-e2k-serial b/features.in/e2k/rootfs/image-scripts.d/50-e2k-serial index ab00b209..b7a93f11 100755 --- a/features.in/e2k/rootfs/image-scripts.d/50-e2k-serial +++ b/features.in/e2k/rootfs/image-scripts.d/50-e2k-serial @@ -1,9 +1,14 @@ #!/bin/sh CFG="/boot/boot.conf" +[ -s "$CFG" ] || { + echo "50-e2k-serial: $CFG missing, exiting" >&2 + exit 0 +} -[ -f "$CFG" ] || exit 1 [ -n "$GLOBAL_TTY_DEV" -a -n "$GLOBAL_TTY_RATE" ] || exit 0 # tty0 first sed -i "s/console=tty0 /console=$GLOBAL_TTY_DEV,$GLOBAL_TTY_RATE &/" "$CFG" + +### NB: there's no boot.conf yet! could only be the sample one