From 52d0bad764f59acd738e64add91b498cc2b381d6 Mon Sep 17 00:00:00 2001 From: CvH <1355173+CvH@users.noreply.github.com> Date: Sat, 6 Jul 2024 11:09:42 +0200 Subject: [PATCH] cleanup scripts: projects/ --- projects/Allwinner/filesystem/usr/bin/cputemp | 2 +- projects/Allwinner/filesystem/usr/bin/gputemp | 6 +- projects/Amlogic/bootloader/canupdate.sh | 2 +- projects/Amlogic/bootloader/update.sh | 82 +++++----- projects/Amlogic/filesystem/usr/bin/cputemp | 4 +- .../Amlogic/packages/systemd/scripts/cpufreq | 8 +- .../x11/filesystem/usr/bin/intel-fullrange.sh | 7 +- projects/Generic/filesystem/usr/bin/cputemp | 10 +- .../iMX6/filesystem/usr/bin/rdu-network | 153 +++++++++--------- .../devices/iMX8/filesystem/usr/bin/cputemp | 2 +- .../devices/iMX8/filesystem/usr/bin/gputemp | 2 +- .../devices/Dragonboard/bootloader/update.sh | 20 +-- projects/RPi/filesystem/usr/bin/cputemp | 2 +- projects/RPi/packages/systemd/scripts/cpufreq | 10 +- .../devices/RK3288/filesystem/usr/bin/cputemp | 2 +- .../devices/RK3288/filesystem/usr/bin/gputemp | 2 +- projects/Rockchip/filesystem/usr/bin/cputemp | 2 +- .../Rockchip/packages/systemd/scripts/cpufreq | 8 +- projects/Samsung/bootloader/update.sh | 40 ++--- projects/Samsung/filesystem/usr/bin/cputemp | 2 +- 20 files changed, 183 insertions(+), 183 deletions(-) diff --git a/projects/Allwinner/filesystem/usr/bin/cputemp b/projects/Allwinner/filesystem/usr/bin/cputemp index 11535271c5..33e4d3d5ff 100755 --- a/projects/Allwinner/filesystem/usr/bin/cputemp +++ b/projects/Allwinner/filesystem/usr/bin/cputemp @@ -5,4 +5,4 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" -echo "$(( $TEMP / 1000 )) C" +echo "$(($TEMP / 1000)) C" diff --git a/projects/Allwinner/filesystem/usr/bin/gputemp b/projects/Allwinner/filesystem/usr/bin/gputemp index 761b5d1f30..cf7bcfe4a2 100755 --- a/projects/Allwinner/filesystem/usr/bin/gputemp +++ b/projects/Allwinner/filesystem/usr/bin/gputemp @@ -5,8 +5,8 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) if [ -f /sys/class/thermal/thermal_zone1/temp ]; then - TEMP="$(cat /sys/class/thermal/thermal_zone1/temp)" + TEMP="$(cat /sys/class/thermal/thermal_zone1/temp)" else - TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" + TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" fi -echo "$(( $TEMP / 1000 )) C" +echo "$(($TEMP / 1000)) C" diff --git a/projects/Amlogic/bootloader/canupdate.sh b/projects/Amlogic/bootloader/canupdate.sh index 4f61c09bfa..9542cc57c6 100644 --- a/projects/Amlogic/bootloader/canupdate.sh +++ b/projects/Amlogic/bootloader/canupdate.sh @@ -5,7 +5,7 @@ # detect legacy kernel installs and abort to prevent upgrades case $(uname -r) in - 3.14*|4.9*) + 3.14* | 4.9*) echo "Updates from Amlogic vendor kernels are not supported!" sleep 10 exit 1 diff --git a/projects/Amlogic/bootloader/update.sh b/projects/Amlogic/bootloader/update.sh index fc91b8bd72..d692ddd3e3 100644 --- a/projects/Amlogic/bootloader/update.sh +++ b/projects/Amlogic/bootloader/update.sh @@ -8,56 +8,56 @@ [ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '}) # identify the boot device - if [ -z "$BOOT_DISK" ]; then - case $BOOT_PART in - /dev/sd[a-z][0-9]*) - BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g") - ;; - /dev/mmcblk*) - BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g") - ;; - esac - fi +if [ -z "$BOOT_DISK" ]; then + case $BOOT_PART in + /dev/sd[a-z][0-9]*) + BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g") + ;; + /dev/mmcblk*) + BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g") + ;; + esac +fi # mount $BOOT_ROOT rw - mount -o remount,rw $BOOT_ROOT +mount -o remount,rw $BOOT_ROOT # update /amlogic device trees - if [ -d $BOOT_ROOT/amlogic ]; then - for dtbfile in $BOOT_ROOT/amlogic/*.dtb ; do - dtb=$(basename $dtbfile) - echo "Updating $dtb" - cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/amlogic/ 2>/dev/null || true - done - fi +if [ -d $BOOT_ROOT/amlogic ]; then + for dtbfile in $BOOT_ROOT/amlogic/*.dtb; do + dtb=$(basename $dtbfile) + echo "Updating $dtb" + cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/amlogic/ 2>/dev/null || true + done +fi # update /extlinux device trees - if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then - for dtbfile in $BOOT_ROOT/*.dtb ; do - dtb=$(basename $dtbfile) - echo "Updating $dtb" - cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/ 2>/dev/null || true - done - fi +if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then + for dtbfile in $BOOT_ROOT/*.dtb; do + dtb=$(basename $dtbfile) + echo "Updating $dtb" + cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/ 2>/dev/null || true + done +fi # update /dtb device trees - if [ -d $BOOT_ROOT/dtb ]; then - for dtbfile in $BOOT_ROOT/dtb/*.dtb ; do - dtb=$(basename $dtbfile) - echo "Updating $dtb" - cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/dtb/ 2>/dev/null || true - done - fi +if [ -d $BOOT_ROOT/dtb ]; then + for dtbfile in $BOOT_ROOT/dtb/*.dtb; do + dtb=$(basename $dtbfile) + echo "Updating $dtb" + cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/dtb/ 2>/dev/null || true + done +fi # update u-boot scripts - if [ -f $BOOT_ROOT/uEnv.ini ]; then - for scriptfile in $SYSTEM_ROOT/usr/share/bootloader/*_autoscript* $SYSTEM_ROOT/usr/share/bootloader/*.scr ; do - script=$(basename $scriptfile) - echo "Updating $script" - cp -p $SYSTEM_ROOT/usr/share/bootloader/$script $BOOT_ROOT/ 2>/dev/null || true - done - fi +if [ -f $BOOT_ROOT/uEnv.ini ]; then + for scriptfile in $SYSTEM_ROOT/usr/share/bootloader/*_autoscript* $SYSTEM_ROOT/usr/share/bootloader/*.scr; do + script=$(basename $scriptfile) + echo "Updating $script" + cp -p $SYSTEM_ROOT/usr/share/bootloader/$script $BOOT_ROOT/ 2>/dev/null || true + done +fi # mount $BOOT_ROOT ro - sync - mount -o remount,ro $BOOT_ROOT +sync +mount -o remount,ro $BOOT_ROOT diff --git a/projects/Amlogic/filesystem/usr/bin/cputemp b/projects/Amlogic/filesystem/usr/bin/cputemp index 312f817d74..64397436ca 100755 --- a/projects/Amlogic/filesystem/usr/bin/cputemp +++ b/projects/Amlogic/filesystem/usr/bin/cputemp @@ -4,7 +4,7 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) case $(dtsoc) in - amlogic,g12*|amlogic,sm1) + amlogic,g12* | amlogic,sm1) TEMP=$(cat /sys/devices/virtual/thermal/thermal_zone1/temp) ;; *) @@ -12,5 +12,5 @@ case $(dtsoc) in ;; esac -TEMP="$(( $TEMP / 1000 ))" +TEMP="$(($TEMP / 1000))" echo "${TEMP} C" diff --git a/projects/Amlogic/packages/systemd/scripts/cpufreq b/projects/Amlogic/packages/systemd/scripts/cpufreq index 940e090a58..9afa1b1b06 100755 --- a/projects/Amlogic/packages/systemd/scripts/cpufreq +++ b/projects/Amlogic/packages/systemd/scripts/cpufreq @@ -8,16 +8,16 @@ SYS_CPUFREQ_GOV=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) if [ "${SYS_CPUFREQ_GOV}" = "ondemand" ]; then for io_is_busy in $(find /sys/devices/system/cpu -name io_is_busy); do - echo 1 > "${io_is_busy}" + echo 1 >"${io_is_busy}" done for up_threshold in $(find /sys/devices/system/cpu -name up_threshold); do - echo 50 > "${up_threshold}" + echo 50 >"${up_threshold}" done for sampling_rate in $(find /sys/devices/system/cpu -name sampling_rate); do - echo 100000 > "${sampling_rate}" + echo 100000 >"${sampling_rate}" done for sampling_down_factor in $(find /sys/devices/system/cpu -name sampling_down_factor); do - echo 50 > "${sampling_down_factor}" + echo 50 >"${sampling_down_factor}" done else echo "cpufreq: settings not found for current cpu governor." | systemd-cat -p info diff --git a/projects/Generic/devices/x11/filesystem/usr/bin/intel-fullrange.sh b/projects/Generic/devices/x11/filesystem/usr/bin/intel-fullrange.sh index f114b9f8b3..8bd01d287a 100755 --- a/projects/Generic/devices/x11/filesystem/usr/bin/intel-fullrange.sh +++ b/projects/Generic/devices/x11/filesystem/usr/bin/intel-fullrange.sh @@ -2,14 +2,15 @@ FB_TYPE="$(grep '^0 ' /proc/fb | sed 's/[^[:space:]] //')" if [ "$FB_TYPE" == "inteldrmfb" ] || echo "$FB_TYPE" | grep -q "^i9[0-9]*drmfb$"; then - OUTPUT=`/usr/bin/xrandr -display :0 -q | sed '/ connected/!d;s/ .*//;q'` - for out in $OUTPUT ; do + OUTPUT=$(/usr/bin/xrandr -display :0 -q | sed '/ connected/!d;s/ .*//;q') + for out in $OUTPUT; do # Hack - something is not yet fully right /usr/bin/xrandr -display :0 --output $out --set "Broadcast RGB" "Full" # Seems there is a little race somewhere on some outputs # Turn the display shortly off and on again if [ -e "/storage/.config/forcedisplay" ]; then - /usr/bin/xrandr -display :0 --output $out --off ; /usr/bin/xrandr -display :0 --output $out --auto + /usr/bin/xrandr -display :0 --output $out --off + /usr/bin/xrandr -display :0 --output $out --auto fi done fi diff --git a/projects/Generic/filesystem/usr/bin/cputemp b/projects/Generic/filesystem/usr/bin/cputemp index 747bdb0e35..e64e0535f3 100755 --- a/projects/Generic/filesystem/usr/bin/cputemp +++ b/projects/Generic/filesystem/usr/bin/cputemp @@ -16,16 +16,16 @@ if [ $(basename "$0") = "gputemp" -o "$1" = "gpu" ]; then for hwmon in /sys/class/hwmon/*; do if [ -f "${hwmon}/name" ]; then case $(cat ${hwmon}/name) in - nouveau|radeon|amdgpu) + nouveau | radeon | amdgpu) [[ -f "${hwmon}/temp1_input" ]] && TEMP="$(cat ${hwmon}/temp1_input)" && break [[ -f "${hwmon}/temp2_input" ]] && TEMP="$(cat ${hwmon}/temp2_input)" && break ;; - # intel gpu is supported by cpu coretemp below + # intel gpu is supported by cpu coretemp below esac fi done - TEMP="$(( $TEMP / 1000 ))" + TEMP="$(($TEMP / 1000))" fi fi @@ -34,7 +34,7 @@ if [ "$1" = "cpu" -o "$TEMP" = "0" ]; then for hwmon in /sys/class/hwmon/*; do if [ -f "${hwmon}/name" ]; then case $(cat ${hwmon}/name) in - coretemp|k10temp|scpi_sensors) + coretemp | k10temp | scpi_sensors) [[ -f "${hwmon}/temp1_input" ]] && TEMP="$(cat ${hwmon}/temp1_input)" && break [[ -f "${hwmon}/temp2_input" ]] && TEMP="$(cat ${hwmon}/temp2_input)" && break ;; @@ -46,7 +46,7 @@ if [ "$1" = "cpu" -o "$TEMP" = "0" ]; then TEMP="$(cat /sys/class/hwmon/hwmon0/device/temp1_input)" fi - TEMP="$(( $TEMP / 1000 ))" + TEMP="$(($TEMP / 1000))" fi echo "${TEMP} C" diff --git a/projects/NXP/devices/iMX6/filesystem/usr/bin/rdu-network b/projects/NXP/devices/iMX6/filesystem/usr/bin/rdu-network index 2dc484b01a..9f9ff24d7a 100755 --- a/projects/NXP/devices/iMX6/filesystem/usr/bin/rdu-network +++ b/projects/NXP/devices/iMX6/filesystem/usr/bin/rdu-network @@ -13,105 +13,104 @@ USED_IFACES="" function log { - logger -t "${LOGGER_TAG}" "$@" + logger -t "${LOGGER_TAG}" "$@" } function logerr { - logger -t "${LOGGER_TAG}" -p "err" "$@" + logger -t "${LOGGER_TAG}" -p "err" "$@" } # Select setup based on model case "${MODEL}" in - "ZII RDU2+ Board" | "ZII RDU2 Board") - log "Loading RDU2 networking setup..." - IP_IFACE="eth1" - BR_NAME="br0" - BR_IFACES="netaux netleft netright gigabit_proc" - ALL_IFACES="eth0 ${IP_IFACE} ${BR_IFACES} ${BR_NAME}" - ;; - "ZII RDU1 Board") - log "Loading RDU1 networking setup..." - IP_IFACE="br0" - BR_NAME="br0" - BR_IFACES="netaux netleft netright" - ALL_IFACES="eth0 ${BR_NAME} ${BR_IFACES}" - ;; - *) - logerr "invalid hardware model detected: ${MODEL}" - exit 1 - ;; + "ZII RDU2+ Board" | "ZII RDU2 Board") + log "Loading RDU2 networking setup..." + IP_IFACE="eth1" + BR_NAME="br0" + BR_IFACES="netaux netleft netright gigabit_proc" + ALL_IFACES="eth0 ${IP_IFACE} ${BR_IFACES} ${BR_NAME}" + ;; + "ZII RDU1 Board") + log "Loading RDU1 networking setup..." + IP_IFACE="br0" + BR_NAME="br0" + BR_IFACES="netaux netleft netright" + ALL_IFACES="eth0 ${BR_NAME} ${BR_IFACES}" + ;; + *) + logerr "invalid hardware model detected: ${MODEL}" + exit 1 + ;; esac case "${ACTION}" in - "start") + "start") - # Assume RDU network is already started if the bridge is available - if [ -d /sys/class/net/${BR_NAME} ]; then - log "Networking setup is already started" - exit 0 - fi + # Assume RDU network is already started if the bridge is available + if [ -d /sys/class/net/${BR_NAME} ]; then + log "Networking setup is already started" + exit 0 + fi - # Cleanup all addresses from all interfaces and bring them down - log "Resetting interfaces..." - for IFACE in ${ALL_IFACES}; do - log " Resetting ${IFACE}..." - ip addr flush dev ${IFACE} >/dev/null 2>&1 - ip link set dev ${IFACE} down >/dev/null 2>&1 - done + # Cleanup all addresses from all interfaces and bring them down + log "Resetting interfaces..." + for IFACE in ${ALL_IFACES}; do + log " Resetting ${IFACE}..." + ip addr flush dev ${IFACE} >/dev/null 2>&1 + ip link set dev ${IFACE} down >/dev/null 2>&1 + done - # Create bridge with all interfaces - log "Creating bridge interface..." - brctl addbr ${BR_NAME} >/dev/null 2>&1 - for IFACE in ${BR_IFACES}; do - log " Adding ${IFACE} to bridge..." - brctl addif ${BR_NAME} ${IFACE} >/dev/null 2>&1 - done + # Create bridge with all interfaces + log "Creating bridge interface..." + brctl addbr ${BR_NAME} >/dev/null 2>&1 + for IFACE in ${BR_IFACES}; do + log " Adding ${IFACE} to bridge..." + brctl addif ${BR_NAME} ${IFACE} >/dev/null 2>&1 + done - # Bring all bridge interfaces and the bridge itself up - log "Bringing up all interfaces..." - for IFACE in ${ALL_IFACES}; do - log " Bringing up ${IFACE}..." - ip link set dev ${IFACE} up >/dev/null 2>&1 - done + # Bring all bridge interfaces and the bridge itself up + log "Bringing up all interfaces..." + for IFACE in ${ALL_IFACES}; do + log " Bringing up ${IFACE}..." + ip link set dev ${IFACE} up >/dev/null 2>&1 + done - # All done - log "RDU networking started" - exit 0 - ;; + # All done + log "RDU networking started" + exit 0 + ;; - "stop") + "stop") - # Assume RDU network is already stopped if the bridge is available - if [ ! -d /sys/class/net/${BR_NAME} ]; then - log "Networking setup is already stopped" - exit 0 - fi + # Assume RDU network is already stopped if the bridge is available + if [ ! -d /sys/class/net/${BR_NAME} ]; then + log "Networking setup is already stopped" + exit 0 + fi - # Cleanup all addresses from all interfaces and bring them down - log "Resetting interfaces..." - for IFACE in ${ALL_IFACES}; do - ip addr flush dev ${IFACE} >/dev/null 2>&1 - ip link set dev ${IFACE} down >/dev/null 2>&1 - done + # Cleanup all addresses from all interfaces and bring them down + log "Resetting interfaces..." + for IFACE in ${ALL_IFACES}; do + ip addr flush dev ${IFACE} >/dev/null 2>&1 + ip link set dev ${IFACE} down >/dev/null 2>&1 + done - # Remove bridge interfaces and bridge itself - log "Removing bridge interface..." - for IFACE in ${BR_IFACES}; do - brctl delif ${BR_NAME} ${IFACE} >/dev/null 2>&1 - done - brctl delbr ${BR_NAME} >/dev/null 2>&1 + # Remove bridge interfaces and bridge itself + log "Removing bridge interface..." + for IFACE in ${BR_IFACES}; do + brctl delif ${BR_NAME} ${IFACE} >/dev/null 2>&1 + done + brctl delbr ${BR_NAME} >/dev/null 2>&1 - # All done - log "RDU networking stopped" - exit 0 - ;; + # All done + log "RDU networking stopped" + exit 0 + ;; - *) - logerr "invalid action requested: ${ACTION}" - exit 2 - ;; + *) + logerr "invalid action requested: ${ACTION}" + exit 2 + ;; esac - diff --git a/projects/NXP/devices/iMX8/filesystem/usr/bin/cputemp b/projects/NXP/devices/iMX8/filesystem/usr/bin/cputemp index ba32390a43..8eec69c21e 100755 --- a/projects/NXP/devices/iMX8/filesystem/usr/bin/cputemp +++ b/projects/NXP/devices/iMX8/filesystem/usr/bin/cputemp @@ -4,4 +4,4 @@ # Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv) TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" -echo "$(( $TEMP / 1000 )) C" +echo "$(($TEMP / 1000)) C" diff --git a/projects/NXP/devices/iMX8/filesystem/usr/bin/gputemp b/projects/NXP/devices/iMX8/filesystem/usr/bin/gputemp index a3d2f4f34e..c2f56a0e76 100755 --- a/projects/NXP/devices/iMX8/filesystem/usr/bin/gputemp +++ b/projects/NXP/devices/iMX8/filesystem/usr/bin/gputemp @@ -4,4 +4,4 @@ # Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv) TEMP="$(cat /sys/class/thermal/thermal_zone1/temp)" -echo "$(( $TEMP / 1000 )) C" +echo "$(($TEMP / 1000)) C" diff --git a/projects/Qualcomm/devices/Dragonboard/bootloader/update.sh b/projects/Qualcomm/devices/Dragonboard/bootloader/update.sh index 5fc9961e23..eba28ea271 100644 --- a/projects/Qualcomm/devices/Dragonboard/bootloader/update.sh +++ b/projects/Qualcomm/devices/Dragonboard/bootloader/update.sh @@ -16,17 +16,17 @@ if [ -z "$BOOT_DISK" ]; then fi # mount $BOOT_ROOT r/w - mount -o remount,rw $BOOT_ROOT +mount -o remount,rw $BOOT_ROOT # update Device Tree Blobs - for all_dtb in /flash/*.dtb; do - dtb=$(basename $all_dtb) - if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then - echo "*** updating Device Tree Blob: $dtb ..." - cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT - fi - done +for all_dtb in /flash/*.dtb; do + dtb=$(basename $all_dtb) + if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then + echo "*** updating Device Tree Blob: $dtb ..." + cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT + fi +done # mount $BOOT_ROOT r/o - sync - mount -o remount,ro $BOOT_ROOT +sync +mount -o remount,ro $BOOT_ROOT diff --git a/projects/RPi/filesystem/usr/bin/cputemp b/projects/RPi/filesystem/usr/bin/cputemp index 11535271c5..33e4d3d5ff 100755 --- a/projects/RPi/filesystem/usr/bin/cputemp +++ b/projects/RPi/filesystem/usr/bin/cputemp @@ -5,4 +5,4 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" -echo "$(( $TEMP / 1000 )) C" +echo "$(($TEMP / 1000)) C" diff --git a/projects/RPi/packages/systemd/scripts/cpufreq b/projects/RPi/packages/systemd/scripts/cpufreq index 8fb2b3976a..0c402a9b17 100755 --- a/projects/RPi/packages/systemd/scripts/cpufreq +++ b/projects/RPi/packages/systemd/scripts/cpufreq @@ -4,15 +4,15 @@ # Copyright (C) 2009-2015 Stephan Raue (stephan@openelec.tv) # Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv) -SYS_CPUFREQ_GOV=$( cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ) +SYS_CPUFREQ_GOV=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) SYS_ONDEMAND_DIR="/sys/devices/system/cpu/cpufreq/ondemand/" # Configure frequency scaling properties if [ "${SYS_CPUFREQ_GOV}" = "ondemand" ]; then - echo 1 > "${SYS_ONDEMAND_DIR}/io_is_busy" - echo 50 > "${SYS_ONDEMAND_DIR}/up_threshold" - echo 100000 > "${SYS_ONDEMAND_DIR}/sampling_rate" - echo 50 > "${SYS_ONDEMAND_DIR}/sampling_down_factor" + echo 1 >"${SYS_ONDEMAND_DIR}/io_is_busy" + echo 50 >"${SYS_ONDEMAND_DIR}/up_threshold" + echo 100000 >"${SYS_ONDEMAND_DIR}/sampling_rate" + echo 50 >"${SYS_ONDEMAND_DIR}/sampling_down_factor" else echo "cpufreq: settings not found for current cpu governor." | systemd-cat -p info fi diff --git a/projects/Rockchip/devices/RK3288/filesystem/usr/bin/cputemp b/projects/Rockchip/devices/RK3288/filesystem/usr/bin/cputemp index 11535271c5..33e4d3d5ff 100755 --- a/projects/Rockchip/devices/RK3288/filesystem/usr/bin/cputemp +++ b/projects/Rockchip/devices/RK3288/filesystem/usr/bin/cputemp @@ -5,4 +5,4 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" -echo "$(( $TEMP / 1000 )) C" +echo "$(($TEMP / 1000)) C" diff --git a/projects/Rockchip/devices/RK3288/filesystem/usr/bin/gputemp b/projects/Rockchip/devices/RK3288/filesystem/usr/bin/gputemp index 73d0115961..99794b412a 100755 --- a/projects/Rockchip/devices/RK3288/filesystem/usr/bin/gputemp +++ b/projects/Rockchip/devices/RK3288/filesystem/usr/bin/gputemp @@ -5,4 +5,4 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) TEMP="$(cat /sys/class/thermal/thermal_zone1/temp)" -echo "$(( $TEMP / 1000 )) C" +echo "$(($TEMP / 1000)) C" diff --git a/projects/Rockchip/filesystem/usr/bin/cputemp b/projects/Rockchip/filesystem/usr/bin/cputemp index 11535271c5..33e4d3d5ff 100755 --- a/projects/Rockchip/filesystem/usr/bin/cputemp +++ b/projects/Rockchip/filesystem/usr/bin/cputemp @@ -5,4 +5,4 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" -echo "$(( $TEMP / 1000 )) C" +echo "$(($TEMP / 1000)) C" diff --git a/projects/Rockchip/packages/systemd/scripts/cpufreq b/projects/Rockchip/packages/systemd/scripts/cpufreq index 940e090a58..9afa1b1b06 100755 --- a/projects/Rockchip/packages/systemd/scripts/cpufreq +++ b/projects/Rockchip/packages/systemd/scripts/cpufreq @@ -8,16 +8,16 @@ SYS_CPUFREQ_GOV=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) if [ "${SYS_CPUFREQ_GOV}" = "ondemand" ]; then for io_is_busy in $(find /sys/devices/system/cpu -name io_is_busy); do - echo 1 > "${io_is_busy}" + echo 1 >"${io_is_busy}" done for up_threshold in $(find /sys/devices/system/cpu -name up_threshold); do - echo 50 > "${up_threshold}" + echo 50 >"${up_threshold}" done for sampling_rate in $(find /sys/devices/system/cpu -name sampling_rate); do - echo 100000 > "${sampling_rate}" + echo 100000 >"${sampling_rate}" done for sampling_down_factor in $(find /sys/devices/system/cpu -name sampling_down_factor); do - echo 50 > "${sampling_down_factor}" + echo 50 >"${sampling_down_factor}" done else echo "cpufreq: settings not found for current cpu governor." | systemd-cat -p info diff --git a/projects/Samsung/bootloader/update.sh b/projects/Samsung/bootloader/update.sh index e61ff3ef0f..80f88bea56 100644 --- a/projects/Samsung/bootloader/update.sh +++ b/projects/Samsung/bootloader/update.sh @@ -8,29 +8,29 @@ [ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '}) # identify the boot device - if [ -z "$BOOT_DISK" ]; then - case $BOOT_PART in - /dev/sd[a-z][0-9]*) - BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g") - ;; - /dev/mmcblk*) - BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g") - ;; - esac - fi +if [ -z "$BOOT_DISK" ]; then + case $BOOT_PART in + /dev/sd[a-z][0-9]*) + BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g") + ;; + /dev/mmcblk*) + BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g") + ;; + esac +fi # mount $BOOT_ROOT rw - mount -o remount,rw $BOOT_ROOT +mount -o remount,rw $BOOT_ROOT # update extlinux device trees - if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then - for dtbfile in $BOOT_ROOT/*.dtb ; do - dtb=$(basename $dtbfile) - echo "Updating $dtb" - cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/ 2>/dev/null || true - done - fi +if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then + for dtbfile in $BOOT_ROOT/*.dtb; do + dtb=$(basename $dtbfile) + echo "Updating $dtb" + cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/ 2>/dev/null || true + done +fi # mount $BOOT_ROOT ro - sync - mount -o remount,ro $BOOT_ROOT +sync +mount -o remount,ro $BOOT_ROOT diff --git a/projects/Samsung/filesystem/usr/bin/cputemp b/projects/Samsung/filesystem/usr/bin/cputemp index 5275e17be5..60e91cb63b 100755 --- a/projects/Samsung/filesystem/usr/bin/cputemp +++ b/projects/Samsung/filesystem/usr/bin/cputemp @@ -5,5 +5,5 @@ # XU4 has 5x sensors so read them all and report the highest value TEMP=$(cat /sys/devices/virtual/thermal/thermal_zone*/temp | sort -n | tail -1) -TEMP="$(( $TEMP / 1000 ))" +TEMP="$(($TEMP / 1000))" echo "${TEMP} C"