Additional FreeMiNT simplifications. Added careful fix for CPU clocking check on FreeMiNT.

This commit is contained in:
Jeffrey Armstrong 2018-01-02 20:33:54 -05:00
parent 69c219e351
commit 82875114fe

View file

@ -412,7 +412,7 @@ get_uptime() {
seconds="${seconds/.*}" seconds="${seconds/.*}"
;; ;;
"Mac OS X" | "iPhone OS" | "BSD") "Mac OS X" | "iPhone OS" | "BSD" | "FreeMiNT")
boot="$(sysctl -n kern.boottime)" boot="$(sysctl -n kern.boottime)"
boot="${boot/'{ sec = '}" boot="${boot/'{ sec = '}"
boot="${boot/,*}" boot="${boot/,*}"
@ -435,12 +435,6 @@ get_uptime() {
h="${h#0}" t="${t#0}" h="${h#0}" t="${t#0}"
seconds="$((d*86400 + h*3600 + ${t%%:*}*60 + ${t#*:}))" seconds="$((d*86400 + h*3600 + ${t%%:*}*60 + ${t#*:}))"
;; ;;
"FreeMiNT")
boot="$(sysctl -n kern.boottime)"
now="$(date +%s)"
seconds="$((now - boot))"
;;
esac esac
days="$((seconds / 60 / 60 / 24)) days" days="$((seconds / 60 / 60 / 24)) days"
@ -676,8 +670,8 @@ get_de() {
"FreeMiNT") "FreeMiNT")
get_wm get_wm
for possibles in "$(ls /proc)"; do for files in /proc/*; do
case "$possibles" in case "$files" in
*thing*) de="Thing" ;; *thing*) de="Thing" ;;
*jinnee*) de="Jinnee" ;; *jinnee*) de="Jinnee" ;;
*tera*) de="Teradesk" ;; *tera*) de="Teradesk" ;;
@ -801,8 +795,8 @@ get_wm() {
"FreeMiNT") "FreeMiNT")
wm="Atari AES" wm="Atari AES"
for possibles in "$(ls /proc | awk -F'[ .]' '/aes|geneva/ {print $1}')"; do for files in /proc/*; do
case "$possibles" in case "$files" in
*xaaes*) wm="XaAES" ;; *xaaes*) wm="XaAES" ;;
*myaes*) wm="MyAES" ;; *myaes*) wm="MyAES" ;;
*naes*) wm="N.AES" ;; *naes*) wm="N.AES" ;;
@ -1154,7 +1148,7 @@ get_cpu() {
"FreeMiNT") "FreeMiNT")
cpu="$(awk -F':' '/CPU:/ {printf $2}' /kern/cpuinfo)" cpu="$(awk -F':' '/CPU:/ {printf $2}' /kern/cpuinfo)"
speed="$(awk -F'[:.]' '/Clocking:/ {printf $2}' /kern/cpuinfo)" speed="$(awk -F '[:.M]' '/Clocking:/ {printf $2}' /kern/cpuinfo)"
;; ;;
esac esac
@ -1500,8 +1494,9 @@ get_memory() {
;; ;;
"FreeMiNT") "FreeMiNT")
mem_total="$(awk -F ':|kB' '/MemTotal:/ {printf $2}' /kern/meminfo)" mem="$(awk -F ':|kB' '/MemTotal:|MemFree:/ {printf $2, " "}' /kern/meminfo)"
mem_free="$(awk -F ':|kB' '/MemFree:/ {printf $2}' /kern/meminfo)" mem_free="${mem/* }"
mem_total="${mem/ *}"
mem_used="$((mem_total - mem_free))" mem_used="$((mem_total - mem_free))"
mem_total="$((mem_total / 1024))" mem_total="$((mem_total / 1024))"
mem_used="$((mem_used / 1024))" mem_used="$((mem_used / 1024))"