1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00

Merge pull request #498 from holta/master

experimental ./iiab-install blocks all older kernels, using version_gt()
This commit is contained in:
A Holt 2017-11-08 03:36:14 -05:00 committed by GitHub
commit 574da50fc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,8 @@ CWD=`pwd`
OS=`grep ^ID= /etc/*release|cut -d= -f2`
OS=${OS//\"/}
function version_gt() { [ "$(printf '%s\n' "$@" | sort -V | head -1)" != "$1" ]; }
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
if [ ! -f $PLAYBOOK ]; then
@ -21,14 +23,14 @@ fi
if [ $OS == "raspbian" ]; then
echo "Found Raspbian"
ABORT=`uname -a | grep $OLD_RPI_KERN | wc -l`
if [ "$ABORT" == 1 ]; then
echo "Kernel "$OLD_RPI_KERN" is obsolete. Before running './iiab-install' you first need"
CURRENT_KERN=`uname -r`
if version_gt $CURRENT_KERN $OLD_RPI_KERN ; then
echo "Kernel looks ok - continuing"
else
echo "Kernel "$CURRENT_KERN" is too old. Before running './iiab-install' you first need"
echo "to update your system with 'apt update' then 'apt dist-upgrade' then reboot."
echo "INSTALL INSTRUCTIONS: https://github.com/iiab/iiab/wiki/IIAB-Installation"
exit 1
else
echo "Kernel looks ok - continuing"
fi
fi
@ -58,8 +60,8 @@ else
elif [ $STAGE == 9 ]; then
# place keeper add read response
# "offer 'Y' or stage number dialog box option to override"
echo "'iiab-install' has already been completed"
echo "use --debug to override "
echo "'iiab-install' has already been completed."
echo "Use --debug to override."
#echo "In demo mode not preventing second run"
echo "Exiting."
exit 1