Detect if 'readelf' is present

This commit is contained in:
Alkorin 2018-01-08 16:26:00 +01:00
parent debd10b517
commit 8c8a8d35fd
1 changed files with 23 additions and 19 deletions

View File

@ -114,6 +114,9 @@ img=''
[ -e /boot/kernel-genkernel-$(uname -m)-$(uname -r) ] && img=/boot/kernel-genkernel-$(uname -m)-$(uname -r)
if [ -z "$img" ]; then
pstatus yellow UNKNOWN "couldn't find your kernel image in /boot, if you used netboot, this is normal"
else
if ! which readelf >/dev/null 2>&1; then
pstatus yellow UNKNOWN "missing 'readelf' tool, please install it, usually it's in the 'binutils' package"
else
extract_vmlinux $img
if [ "$vmlinux_err" != "" ]; then
@ -139,6 +142,7 @@ else
fi
fi
fi
fi
/bin/echo -ne "> \033[46m\033[30mSTATUS:\033[0m "
[ "$status" = 0 ] && pstatus yellow UNKNOWN