added reboot warning if active kernel version doesn't match updated kernel version

This commit is contained in:
AIWintermuteAI 2021-08-17 03:27:17 +01:00
parent 17e2875d4d
commit bd7623e9fb
2 changed files with 17 additions and 57 deletions

View file

@ -1,55 +0,0 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: [bug, triage]
assignees:
- AIWintermuteAI
- Pillar1989
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
placeholder: |
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
placeholder: ""
validations:
required: true
- type: textarea
id: platform
attributes:
label: Platform
description: What platform are you running the code on.
placeholder: |
- Device: [e.g. Raspberry Pi 4]
- OS: [e.g. Raspbian OS 32bit kernel version ...]
- Version/commit number [e.g. d1816f5]
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell

View file

@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
# Color
RED='\033[0;31m'
NC='\033[0m' # No Color
if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root (use sudo)" 1>&2 echo "This script must be run as root (use sudo)" 1>&2
exit 1 exit 1
@ -52,8 +56,6 @@ if [ $errorFound = 1 ] ; then
exit 1 exit 1
fi fi
#because https://github.com/raspberrypi/linux/commit/14075fb3b561869c760a096a92ca0fab1f573174, remove snd-soc-wm8960.ko first
find /lib/modules -name "snd-soc-wm8960.ko" -exec rm -rf {} \;
ver="0.3" ver="0.3"
uname_r=$(uname -r) uname_r=$(uname -r)
@ -128,6 +130,16 @@ base_ver=$(get_kernel_version)
base_ver=${base_ver%%[-+]*} base_ver=${base_ver%%[-+]*}
#kernels="${base_ver}+ ${base_ver}-v7+ ${base_ver}-v7l+" #kernels="${base_ver}+ ${base_ver}-v7+ ${base_ver}-v7l+"
kernels=$(uname -r) kernels=$(uname -r)
kernel_base_ver=${kernels%[-+]*}
if [[ "$base_ver" != "$kernel_base_ver" ]] ; then
echo "------------------------------------------------------"
echo -e " ${RED}WARNING${NC} Your loaded kernel version is $kernel_base_ver"
echo " Not matching the updated version $base_ver."
echo " Kernel was updated, but new kernel was not loaded yet"
echo -e " Please ${RED}reboot${NC} your machine AND THEN run this script ${RED}again"
exit 1;
fi
function install_module { function install_module {
local _i local _i
@ -157,6 +169,9 @@ function install_module {
mkdir -p /var/lib/dkms/$mod/$ver/$marker mkdir -p /var/lib/dkms/$mod/$ver/$marker
} }
#because https://github.com/raspberrypi/linux/commit/14075fb3b561869c760a096a92ca0fab1f573174, remove snd-soc-wm8960.ko first
#find /lib/modules -name "snd-soc-wm8960.ko" -exec rm -rf {} \;
install_module "./" "seeed-voicecard" install_module "./" "seeed-voicecard"