From 34863fe90a786da6b5a50da749668b11aeaf8e17 Mon Sep 17 00:00:00 2001 From: Erick Reyes Date: Tue, 3 Apr 2018 17:01:06 -0700 Subject: [PATCH] build-kheaders: Fix redirection of error messages When the kernel source was not built in-tree, the script was failing silently. This patch exposes the error to the user. --- bcc/build-kheaders-targz.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bcc/build-kheaders-targz.sh b/bcc/build-kheaders-targz.sh index 105fb6d..06eed93 100755 --- a/bcc/build-kheaders-targz.sh +++ b/bcc/build-kheaders-targz.sh @@ -25,11 +25,13 @@ find include >> /tmp/kernel-headers.h grep "include/generated/autoconf.h" /tmp/kernel-headers.h > /dev/null 2>&1 retgrep=$? if [ $retgrep -ne 0 ]; then - echo "" - echo "The kernel sources at ${KERNEL_PATH} you pointed to aren't configured and built." - echo "Please atleast run in your kernel sources:" - echo $'make defconfig\nmake' - echo $'\nNote: You dont need to do the full build since headers are generated early on.\n' + >&2 echo "" + >&2 echo "The kernel sources at ${KERNEL_PATH} you pointed to aren't configured and built." + >&2 echo "Please atleast run in your kernel sources:" + >&2 echo $'make defconfig\nmake' + >&2 echo $'\nNote: You dont need to do the full build since headers are generated early on.\n' + >&2 echo "Note: Please build your kernel in tree (build and source should be in same directory)" + >&2 echo "" exit $retgrep fi