Unload vendor specific modules during sysupgrade

pull/179/head
p0isk 2022-02-18 21:19:50 +03:00
parent 8d4191691e
commit c7a493cd05
1 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,7 @@
set -e
soc=$(fw_printenv -n soc) || (echo -e "\n\e[1;31mSOC not defined in U-Boot ENV...\e[0m\n"; exit 1)
vendor=$(ipcinfo --vendor)
kernel=$(awk -F ':' '/"kernel"/ {print $1}' /proc/mtd)
rootfs=$(awk -F ':' '/"rootfs"/ {print $1}' /proc/mtd)
overlay=$(awk -F ':' '/"rootfs_data"/ {print $1}' /proc/mtd)
@ -21,6 +22,11 @@ stop_services() {
killall crond klogd ntpd rngd syslogd || true
}
unload_modules() {
echo -e "\n\e[1;31mUnload vendor specific modules...\e[0m\n"
load_$vendor -r >/dev/null 2>&1
}
check_memory() {
echo -e "\n\e[1;31mCheck RAM size...\e[0m\n"
free
@ -250,4 +256,5 @@ if [ $remotely -eq 1 ]; then
fi
stop_services
unload_modules
download_firmware "${url}" && check_memory && writing_kernel "${kernel_file}" && writing_rootfs "${rootfs_file}" && sleep 1 && clearing_overlayfs && quick_reboot