cleanup scripts: projects/

This commit is contained in:
CvH 2024-07-06 11:09:42 +02:00
parent 67dcda694b
commit 52d0bad764
20 changed files with 183 additions and 183 deletions

View File

@ -5,4 +5,4 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)"
echo "$(( $TEMP / 1000 )) C" echo "$(($TEMP / 1000)) C"

View File

@ -5,8 +5,8 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
if [ -f /sys/class/thermal/thermal_zone1/temp ]; then 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 else
TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)"
fi fi
echo "$(( $TEMP / 1000 )) C" echo "$(($TEMP / 1000)) C"

View File

@ -5,7 +5,7 @@
# detect legacy kernel installs and abort to prevent upgrades # detect legacy kernel installs and abort to prevent upgrades
case $(uname -r) in case $(uname -r) in
3.14*|4.9*) 3.14* | 4.9*)
echo "Updates from Amlogic vendor kernels are not supported!" echo "Updates from Amlogic vendor kernels are not supported!"
sleep 10 sleep 10
exit 1 exit 1

View File

@ -8,56 +8,56 @@
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '}) [ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
# identify the boot device # identify the boot device
if [ -z "$BOOT_DISK" ]; then if [ -z "$BOOT_DISK" ]; then
case $BOOT_PART in case $BOOT_PART in
/dev/sd[a-z][0-9]*) /dev/sd[a-z][0-9]*)
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g") BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g")
;; ;;
/dev/mmcblk*) /dev/mmcblk*)
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g") BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g")
;; ;;
esac esac
fi fi
# mount $BOOT_ROOT rw # mount $BOOT_ROOT rw
mount -o remount,rw $BOOT_ROOT mount -o remount,rw $BOOT_ROOT
# update /amlogic device trees # update /amlogic device trees
if [ -d $BOOT_ROOT/amlogic ]; then if [ -d $BOOT_ROOT/amlogic ]; then
for dtbfile in $BOOT_ROOT/amlogic/*.dtb ; do for dtbfile in $BOOT_ROOT/amlogic/*.dtb; do
dtb=$(basename $dtbfile) dtb=$(basename $dtbfile)
echo "Updating $dtb" echo "Updating $dtb"
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/amlogic/ 2>/dev/null || true cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/amlogic/ 2>/dev/null || true
done done
fi fi
# update /extlinux device trees # update /extlinux device trees
if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then
for dtbfile in $BOOT_ROOT/*.dtb ; do for dtbfile in $BOOT_ROOT/*.dtb; do
dtb=$(basename $dtbfile) dtb=$(basename $dtbfile)
echo "Updating $dtb" echo "Updating $dtb"
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/ 2>/dev/null || true cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/ 2>/dev/null || true
done done
fi fi
# update /dtb device trees # update /dtb device trees
if [ -d $BOOT_ROOT/dtb ]; then if [ -d $BOOT_ROOT/dtb ]; then
for dtbfile in $BOOT_ROOT/dtb/*.dtb ; do for dtbfile in $BOOT_ROOT/dtb/*.dtb; do
dtb=$(basename $dtbfile) dtb=$(basename $dtbfile)
echo "Updating $dtb" echo "Updating $dtb"
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/dtb/ 2>/dev/null || true cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/dtb/ 2>/dev/null || true
done done
fi fi
# update u-boot scripts # update u-boot scripts
if [ -f $BOOT_ROOT/uEnv.ini ]; then if [ -f $BOOT_ROOT/uEnv.ini ]; then
for scriptfile in $SYSTEM_ROOT/usr/share/bootloader/*_autoscript* $SYSTEM_ROOT/usr/share/bootloader/*.scr ; do for scriptfile in $SYSTEM_ROOT/usr/share/bootloader/*_autoscript* $SYSTEM_ROOT/usr/share/bootloader/*.scr; do
script=$(basename $scriptfile) script=$(basename $scriptfile)
echo "Updating $script" echo "Updating $script"
cp -p $SYSTEM_ROOT/usr/share/bootloader/$script $BOOT_ROOT/ 2>/dev/null || true cp -p $SYSTEM_ROOT/usr/share/bootloader/$script $BOOT_ROOT/ 2>/dev/null || true
done done
fi fi
# mount $BOOT_ROOT ro # mount $BOOT_ROOT ro
sync sync
mount -o remount,ro $BOOT_ROOT mount -o remount,ro $BOOT_ROOT

View File

@ -4,7 +4,7 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
case $(dtsoc) in case $(dtsoc) in
amlogic,g12*|amlogic,sm1) amlogic,g12* | amlogic,sm1)
TEMP=$(cat /sys/devices/virtual/thermal/thermal_zone1/temp) TEMP=$(cat /sys/devices/virtual/thermal/thermal_zone1/temp)
;; ;;
*) *)
@ -12,5 +12,5 @@ case $(dtsoc) in
;; ;;
esac esac
TEMP="$(( $TEMP / 1000 ))" TEMP="$(($TEMP / 1000))"
echo "${TEMP} C" echo "${TEMP} C"

View File

@ -8,16 +8,16 @@ SYS_CPUFREQ_GOV=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
if [ "${SYS_CPUFREQ_GOV}" = "ondemand" ]; then if [ "${SYS_CPUFREQ_GOV}" = "ondemand" ]; then
for io_is_busy in $(find /sys/devices/system/cpu -name io_is_busy); do 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 done
for up_threshold in $(find /sys/devices/system/cpu -name up_threshold); do for up_threshold in $(find /sys/devices/system/cpu -name up_threshold); do
echo 50 > "${up_threshold}" echo 50 >"${up_threshold}"
done done
for sampling_rate in $(find /sys/devices/system/cpu -name sampling_rate); do for sampling_rate in $(find /sys/devices/system/cpu -name sampling_rate); do
echo 100000 > "${sampling_rate}" echo 100000 >"${sampling_rate}"
done done
for sampling_down_factor in $(find /sys/devices/system/cpu -name sampling_down_factor); do 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 done
else else
echo "cpufreq: settings not found for current cpu governor." | systemd-cat -p info echo "cpufreq: settings not found for current cpu governor." | systemd-cat -p info

View File

@ -2,14 +2,15 @@
FB_TYPE="$(grep '^0 ' /proc/fb | sed 's/[^[:space:]] //')" FB_TYPE="$(grep '^0 ' /proc/fb | sed 's/[^[:space:]] //')"
if [ "$FB_TYPE" == "inteldrmfb" ] || echo "$FB_TYPE" | grep -q "^i9[0-9]*drmfb$"; then 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'` OUTPUT=$(/usr/bin/xrandr -display :0 -q | sed '/ connected/!d;s/ .*//;q')
for out in $OUTPUT ; do for out in $OUTPUT; do
# Hack - something is not yet fully right # Hack - something is not yet fully right
/usr/bin/xrandr -display :0 --output $out --set "Broadcast RGB" "Full" /usr/bin/xrandr -display :0 --output $out --set "Broadcast RGB" "Full"
# Seems there is a little race somewhere on some outputs # Seems there is a little race somewhere on some outputs
# Turn the display shortly off and on again # Turn the display shortly off and on again
if [ -e "/storage/.config/forcedisplay" ]; then 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 fi
done done
fi fi

View File

@ -16,16 +16,16 @@ if [ $(basename "$0") = "gputemp" -o "$1" = "gpu" ]; then
for hwmon in /sys/class/hwmon/*; do for hwmon in /sys/class/hwmon/*; do
if [ -f "${hwmon}/name" ]; then if [ -f "${hwmon}/name" ]; then
case $(cat ${hwmon}/name) in case $(cat ${hwmon}/name) in
nouveau|radeon|amdgpu) nouveau | radeon | amdgpu)
[[ -f "${hwmon}/temp1_input" ]] && TEMP="$(cat ${hwmon}/temp1_input)" && break [[ -f "${hwmon}/temp1_input" ]] && TEMP="$(cat ${hwmon}/temp1_input)" && break
[[ -f "${hwmon}/temp2_input" ]] && TEMP="$(cat ${hwmon}/temp2_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 esac
fi fi
done done
TEMP="$(( $TEMP / 1000 ))" TEMP="$(($TEMP / 1000))"
fi fi
fi fi
@ -34,7 +34,7 @@ if [ "$1" = "cpu" -o "$TEMP" = "0" ]; then
for hwmon in /sys/class/hwmon/*; do for hwmon in /sys/class/hwmon/*; do
if [ -f "${hwmon}/name" ]; then if [ -f "${hwmon}/name" ]; then
case $(cat ${hwmon}/name) in 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}/temp1_input" ]] && TEMP="$(cat ${hwmon}/temp1_input)" && break
[[ -f "${hwmon}/temp2_input" ]] && TEMP="$(cat ${hwmon}/temp2_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)" TEMP="$(cat /sys/class/hwmon/hwmon0/device/temp1_input)"
fi fi
TEMP="$(( $TEMP / 1000 ))" TEMP="$(($TEMP / 1000))"
fi fi
echo "${TEMP} C" echo "${TEMP} C"

View File

@ -13,105 +13,104 @@ USED_IFACES=""
function log function log
{ {
logger -t "${LOGGER_TAG}" "$@" logger -t "${LOGGER_TAG}" "$@"
} }
function logerr function logerr
{ {
logger -t "${LOGGER_TAG}" -p "err" "$@" logger -t "${LOGGER_TAG}" -p "err" "$@"
} }
# Select setup based on model # Select setup based on model
case "${MODEL}" in case "${MODEL}" in
"ZII RDU2+ Board" | "ZII RDU2 Board") "ZII RDU2+ Board" | "ZII RDU2 Board")
log "Loading RDU2 networking setup..." log "Loading RDU2 networking setup..."
IP_IFACE="eth1" IP_IFACE="eth1"
BR_NAME="br0" BR_NAME="br0"
BR_IFACES="netaux netleft netright gigabit_proc" BR_IFACES="netaux netleft netright gigabit_proc"
ALL_IFACES="eth0 ${IP_IFACE} ${BR_IFACES} ${BR_NAME}" ALL_IFACES="eth0 ${IP_IFACE} ${BR_IFACES} ${BR_NAME}"
;; ;;
"ZII RDU1 Board") "ZII RDU1 Board")
log "Loading RDU1 networking setup..." log "Loading RDU1 networking setup..."
IP_IFACE="br0" IP_IFACE="br0"
BR_NAME="br0" BR_NAME="br0"
BR_IFACES="netaux netleft netright" BR_IFACES="netaux netleft netright"
ALL_IFACES="eth0 ${BR_NAME} ${BR_IFACES}" ALL_IFACES="eth0 ${BR_NAME} ${BR_IFACES}"
;; ;;
*) *)
logerr "invalid hardware model detected: ${MODEL}" logerr "invalid hardware model detected: ${MODEL}"
exit 1 exit 1
;; ;;
esac esac
case "${ACTION}" in case "${ACTION}" in
"start") "start")
# Assume RDU network is already started if the bridge is available # Assume RDU network is already started if the bridge is available
if [ -d /sys/class/net/${BR_NAME} ]; then if [ -d /sys/class/net/${BR_NAME} ]; then
log "Networking setup is already started" log "Networking setup is already started"
exit 0 exit 0
fi fi
# Cleanup all addresses from all interfaces and bring them down # Cleanup all addresses from all interfaces and bring them down
log "Resetting interfaces..." log "Resetting interfaces..."
for IFACE in ${ALL_IFACES}; do for IFACE in ${ALL_IFACES}; do
log " Resetting ${IFACE}..." log " Resetting ${IFACE}..."
ip addr flush dev ${IFACE} >/dev/null 2>&1 ip addr flush dev ${IFACE} >/dev/null 2>&1
ip link set dev ${IFACE} down >/dev/null 2>&1 ip link set dev ${IFACE} down >/dev/null 2>&1
done done
# Create bridge with all interfaces # Create bridge with all interfaces
log "Creating bridge interface..." log "Creating bridge interface..."
brctl addbr ${BR_NAME} >/dev/null 2>&1 brctl addbr ${BR_NAME} >/dev/null 2>&1
for IFACE in ${BR_IFACES}; do for IFACE in ${BR_IFACES}; do
log " Adding ${IFACE} to bridge..." log " Adding ${IFACE} to bridge..."
brctl addif ${BR_NAME} ${IFACE} >/dev/null 2>&1 brctl addif ${BR_NAME} ${IFACE} >/dev/null 2>&1
done done
# Bring all bridge interfaces and the bridge itself up # Bring all bridge interfaces and the bridge itself up
log "Bringing up all interfaces..." log "Bringing up all interfaces..."
for IFACE in ${ALL_IFACES}; do for IFACE in ${ALL_IFACES}; do
log " Bringing up ${IFACE}..." log " Bringing up ${IFACE}..."
ip link set dev ${IFACE} up >/dev/null 2>&1 ip link set dev ${IFACE} up >/dev/null 2>&1
done done
# All done # All done
log "RDU networking started" log "RDU networking started"
exit 0 exit 0
;; ;;
"stop") "stop")
# Assume RDU network is already stopped if the bridge is available # Assume RDU network is already stopped if the bridge is available
if [ ! -d /sys/class/net/${BR_NAME} ]; then if [ ! -d /sys/class/net/${BR_NAME} ]; then
log "Networking setup is already stopped" log "Networking setup is already stopped"
exit 0 exit 0
fi fi
# Cleanup all addresses from all interfaces and bring them down # Cleanup all addresses from all interfaces and bring them down
log "Resetting interfaces..." log "Resetting interfaces..."
for IFACE in ${ALL_IFACES}; do for IFACE in ${ALL_IFACES}; do
ip addr flush dev ${IFACE} >/dev/null 2>&1 ip addr flush dev ${IFACE} >/dev/null 2>&1
ip link set dev ${IFACE} down >/dev/null 2>&1 ip link set dev ${IFACE} down >/dev/null 2>&1
done done
# Remove bridge interfaces and bridge itself # Remove bridge interfaces and bridge itself
log "Removing bridge interface..." log "Removing bridge interface..."
for IFACE in ${BR_IFACES}; do for IFACE in ${BR_IFACES}; do
brctl delif ${BR_NAME} ${IFACE} >/dev/null 2>&1 brctl delif ${BR_NAME} ${IFACE} >/dev/null 2>&1
done done
brctl delbr ${BR_NAME} >/dev/null 2>&1 brctl delbr ${BR_NAME} >/dev/null 2>&1
# All done # All done
log "RDU networking stopped" log "RDU networking stopped"
exit 0 exit 0
;; ;;
*) *)
logerr "invalid action requested: ${ACTION}" logerr "invalid action requested: ${ACTION}"
exit 2 exit 2
;; ;;
esac esac

View File

@ -4,4 +4,4 @@
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)
TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)"
echo "$(( $TEMP / 1000 )) C" echo "$(($TEMP / 1000)) C"

View File

@ -4,4 +4,4 @@
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)
TEMP="$(cat /sys/class/thermal/thermal_zone1/temp)" TEMP="$(cat /sys/class/thermal/thermal_zone1/temp)"
echo "$(( $TEMP / 1000 )) C" echo "$(($TEMP / 1000)) C"

View File

@ -16,17 +16,17 @@ if [ -z "$BOOT_DISK" ]; then
fi fi
# mount $BOOT_ROOT r/w # mount $BOOT_ROOT r/w
mount -o remount,rw $BOOT_ROOT mount -o remount,rw $BOOT_ROOT
# update Device Tree Blobs # update Device Tree Blobs
for all_dtb in /flash/*.dtb; do for all_dtb in /flash/*.dtb; do
dtb=$(basename $all_dtb) dtb=$(basename $all_dtb)
if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then
echo "*** updating Device Tree Blob: $dtb ..." echo "*** updating Device Tree Blob: $dtb ..."
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT
fi fi
done done
# mount $BOOT_ROOT r/o # mount $BOOT_ROOT r/o
sync sync
mount -o remount,ro $BOOT_ROOT mount -o remount,ro $BOOT_ROOT

View File

@ -5,4 +5,4 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)"
echo "$(( $TEMP / 1000 )) C" echo "$(($TEMP / 1000)) C"

View File

@ -4,15 +4,15 @@
# Copyright (C) 2009-2015 Stephan Raue (stephan@openelec.tv) # Copyright (C) 2009-2015 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.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/" SYS_ONDEMAND_DIR="/sys/devices/system/cpu/cpufreq/ondemand/"
# Configure frequency scaling properties # Configure frequency scaling properties
if [ "${SYS_CPUFREQ_GOV}" = "ondemand" ]; then if [ "${SYS_CPUFREQ_GOV}" = "ondemand" ]; then
echo 1 > "${SYS_ONDEMAND_DIR}/io_is_busy" echo 1 >"${SYS_ONDEMAND_DIR}/io_is_busy"
echo 50 > "${SYS_ONDEMAND_DIR}/up_threshold" echo 50 >"${SYS_ONDEMAND_DIR}/up_threshold"
echo 100000 > "${SYS_ONDEMAND_DIR}/sampling_rate" echo 100000 >"${SYS_ONDEMAND_DIR}/sampling_rate"
echo 50 > "${SYS_ONDEMAND_DIR}/sampling_down_factor" echo 50 >"${SYS_ONDEMAND_DIR}/sampling_down_factor"
else else
echo "cpufreq: settings not found for current cpu governor." | systemd-cat -p info echo "cpufreq: settings not found for current cpu governor." | systemd-cat -p info
fi fi

View File

@ -5,4 +5,4 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)"
echo "$(( $TEMP / 1000 )) C" echo "$(($TEMP / 1000)) C"

View File

@ -5,4 +5,4 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
TEMP="$(cat /sys/class/thermal/thermal_zone1/temp)" TEMP="$(cat /sys/class/thermal/thermal_zone1/temp)"
echo "$(( $TEMP / 1000 )) C" echo "$(($TEMP / 1000)) C"

View File

@ -5,4 +5,4 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)" TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)"
echo "$(( $TEMP / 1000 )) C" echo "$(($TEMP / 1000)) C"

View File

@ -8,16 +8,16 @@ SYS_CPUFREQ_GOV=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
if [ "${SYS_CPUFREQ_GOV}" = "ondemand" ]; then if [ "${SYS_CPUFREQ_GOV}" = "ondemand" ]; then
for io_is_busy in $(find /sys/devices/system/cpu -name io_is_busy); do 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 done
for up_threshold in $(find /sys/devices/system/cpu -name up_threshold); do for up_threshold in $(find /sys/devices/system/cpu -name up_threshold); do
echo 50 > "${up_threshold}" echo 50 >"${up_threshold}"
done done
for sampling_rate in $(find /sys/devices/system/cpu -name sampling_rate); do for sampling_rate in $(find /sys/devices/system/cpu -name sampling_rate); do
echo 100000 > "${sampling_rate}" echo 100000 >"${sampling_rate}"
done done
for sampling_down_factor in $(find /sys/devices/system/cpu -name sampling_down_factor); do 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 done
else else
echo "cpufreq: settings not found for current cpu governor." | systemd-cat -p info echo "cpufreq: settings not found for current cpu governor." | systemd-cat -p info

View File

@ -8,29 +8,29 @@
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '}) [ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
# identify the boot device # identify the boot device
if [ -z "$BOOT_DISK" ]; then if [ -z "$BOOT_DISK" ]; then
case $BOOT_PART in case $BOOT_PART in
/dev/sd[a-z][0-9]*) /dev/sd[a-z][0-9]*)
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g") BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g")
;; ;;
/dev/mmcblk*) /dev/mmcblk*)
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g") BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g")
;; ;;
esac esac
fi fi
# mount $BOOT_ROOT rw # mount $BOOT_ROOT rw
mount -o remount,rw $BOOT_ROOT mount -o remount,rw $BOOT_ROOT
# update extlinux device trees # update extlinux device trees
if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then
for dtbfile in $BOOT_ROOT/*.dtb ; do for dtbfile in $BOOT_ROOT/*.dtb; do
dtb=$(basename $dtbfile) dtb=$(basename $dtbfile)
echo "Updating $dtb" echo "Updating $dtb"
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/ 2>/dev/null || true cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/ 2>/dev/null || true
done done
fi fi
# mount $BOOT_ROOT ro # mount $BOOT_ROOT ro
sync sync
mount -o remount,ro $BOOT_ROOT mount -o remount,ro $BOOT_ROOT

View File

@ -5,5 +5,5 @@
# XU4 has 5x sensors so read them all and report the highest value # 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=$(cat /sys/devices/virtual/thermal/thermal_zone*/temp | sort -n | tail -1)
TEMP="$(( $TEMP / 1000 ))" TEMP="$(($TEMP / 1000))"
echo "${TEMP} C" echo "${TEMP} C"