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