From 8db06901f83910131643b33942f47be99e4ce8d9 Mon Sep 17 00:00:00 2001 From: nagumii Date: Sat, 18 Jan 2025 01:04:10 +0200 Subject: [PATCH 1/2] More sysinfo stuff --- .../rootfs_uclibc_rv1106/usr/local/bin/femto-config | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config index 6ca5aa8..d1b111d 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config @@ -206,8 +206,9 @@ logging() { # at some point this will be moved to a different script, and have many functions instead of one giant dump system_info() { - local cpu_architecture="armv7l (armhf 32bit)" - local cpu_model="Rockchip rv1103 (rev$(awk '/CPU revision/ {print $4}' /proc/cpuinfo))" + local cpu_architecture="$(uname -m) ($(dpkg --print-architecture) $(python3 -c "import platform; print(platform.architecture()[0])"))" + local cpu_model="$(dmesg | grep "soc_id" | sed -n 's/.*soc_id: //p')" + local cpu_temp="$(echo "scale=1; $(cat /sys/class/thermal/thermal_zone0/temp) / 1000" | bc)°C" local cpu_serial="$(awk '/Serial/ {print $3}' /proc/cpuinfo)" local cpu_speed="$(lscpu | grep "CPU min MHz" | awk '{print int($4)}') - $(lscpu | grep "CPU max MHz" | awk '{print int($4)}')mhz" local microsd_size="$(df -h / | awk 'NR==2 {printf "%s (%.0f%% free)", $4, (100 - $5+0)}')" @@ -236,7 +237,7 @@ system_info() { echo -e "\ Femtofox\n\ -Core: Luckfox Pico Mini\n\ +Core: $(cat /sys/firmware/devicetree/base/model)\n\ Operating System: $os_version\n\ Kernel version: $(uname -r)\n\ Uptime: $system_uptime\n\ @@ -249,8 +250,9 @@ K boot modules: $boot_modules\n\ Architecture: $cpu_architecture\n\ Model: $cpu_model\n\ Serial # $cpu_serial\n\ -Cores: 1\n\ +Cores: $(nproc)\n\ Speed: $cpu_speed\n\ +Temperature: $cpu_temp \n\ Storage:\n\ microSD size: $microsd_size\n\ From de1e0009739b9babf093be9c14d68e5248c42c4d Mon Sep 17 00:00:00 2001 From: nagumii Date: Sat, 18 Jan 2025 15:38:43 +0200 Subject: [PATCH 2/2] Increment foxbuntu release --- .../rootfs_uclibc_rv1106/etc/foxbuntu-release | 6 ++--- .../usr/local/bin/femto-software.sh | 26 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/foxbuntu-release b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/foxbuntu-release index 8cdb706..dfde80b 100644 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/foxbuntu-release +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/foxbuntu-release @@ -1,6 +1,6 @@ major=0 -minor=96 -patch=1 +minor=97 +patch=0 hotfix= -# major, minor and patch must be numbers. hotfix must be letters. \ No newline at end of file +# major, minor and patch must be numbers and populated. hotfix must be letters and can be blank. diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh index ac32818..4ed1a53 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh @@ -4,7 +4,7 @@ title="Software Manager" package_dir="/usr/local/bin/packages" install() { - dialog --title "$title" --yesno "\nInstall $($package_dir/$1.sh -N)\n\nProceed?" 10 40 + dialog --no-collapse --title "$title" --yesno "\nInstall $($package_dir/$1.sh -N)\n\nProceed?" 10 40 if [ $? -eq 1 ]; then #if cancel/no return 1 fi @@ -17,14 +17,14 @@ install() { #output=$(echo -e "$output" | sed '/user_message: /,$d') # remove the user message from the detailed output if [ $install_status -eq 0 ]; then # if the installation was successful - dialog --colors --title "$title" --beep --msgbox "\n\ZuInstallation of $($package_dir/$1.sh -N) successful!\Zn$([ -n "$user_message" ] && echo "\n\n$user_message")\n\nLog:\n$(echo $output)" 0 0 # if there's a user_message, display it with two preceeding line breaks + dialog --no-collapse --colors --title "$title" --beep --msgbox "\n\ZuInstallation of $($package_dir/$1.sh -N) successful!\Zn$([ -n "$user_message" ] && echo "\n\n$user_message")\n\nLog:\n$(echo $output)" 0 0 # if there's a user_message, display it with two preceeding line breaks else - dialog --colors --title "$title" --beep --msgbox "\n\ZuInstallation of $($package_dir/$1.sh -N) FAILED!\Zn\n\n$user_message\n\nLog:\n$(echo -e $output)" 0 0 # if there's a user_message, display it with two preceeding line breaks + dialog --no-collapse --colors --title "$title" --beep --msgbox "\n\ZuInstallation of $($package_dir/$1.sh -N) FAILED!\Zn\n\n$user_message\n\nLog:\n$(echo -e $output)" 0 0 # if there's a user_message, display it with two preceeding line breaks fi } uninstall() { - dialog --title "$title" --yesno "\nUninstall $1\n\nProceed?" 10 40 + dialog --no-collapse --title "$title" --yesno "\nUninstall $1\n\nProceed?" 10 40 if [ $? -eq 1 ]; then #if cancel/no return 1 fi @@ -34,14 +34,14 @@ uninstall() { user_message=$(echo "$output" | awk '/user_message: / {found=1; split($0, arr, "user_message: "); print arr[2]; next} found {print}' | sed '/^$/q') # grab the user_message, if present #output=$(echo "$output" | sed '/user_message: /,$d') # remove the user message from the detailed output if [ $install_status -eq 0 ]; then # if the installation was successful - dialog --colors --title "$title" --beep --msgbox "\n\ZuUninstallation of $($package_dir/$1.sh -N) successful!\Zn$([ -n "$user_message" ] && echo "\n\n$user_message")\n\nLog:\n$(echo -e "$output")" 0 0 # if there's a user_message, display it with two preceeding line breaks + dialog --no-collapse --colors --title "$title" --beep --msgbox "\n\ZuUninstallation of $($package_dir/$1.sh -N) successful!\Zn$([ -n "$user_message" ] && echo "\n\n$user_message")\n\nLog:\n$(echo -e "$output")" 0 0 # if there's a user_message, display it with two preceeding line breaks else - dialog --colors --title "$title" --beep --msgbox "\n\ZuUninstallation of $($package_dir/$1.sh -N) FAILED!\Zn\n\n$user_message\n\nLog:\n$(echo "$output")" 0 0 # if there's a user_message, display it with two preceeding line breaks + dialog --no-collapse --colors --title "$title" --beep --msgbox "\n\ZuUninstallation of $($package_dir/$1.sh -N) FAILED!\Zn\n\n$user_message\n\nLog:\n$(echo "$output")" 0 0 # if there's a user_message, display it with two preceeding line breaks fi } upgrade() { - dialog --title "$title" --yesno "\nUpgrade $1\n\nProceed?" 10 40 + dialog --no-collapse --title "$title" --yesno "\nUpgrade $1\n\nProceed?" 10 40 if [ $? -eq 1 ]; then #if cancel/no return 1 fi @@ -51,9 +51,9 @@ upgrade() { user_message=$(echo "$output" | awk '/user_message: / {found=1; split($0, arr, "user_message: "); print arr[2]; next} found {print}' | sed '/^$/q') # grab the user_message, if present output=$(echo "$output" | sed '/user_message: /,$d') # remove the user message from the detailed output if [ $install_status -eq 0 ]; then # if the installation was successful - dialog --colors --title "$title" --beep --msgbox "\n\ZuUpgrade of $($package_dir/$1.sh -N) successful!\Zn$([ -n "$user_message" ] && echo "\n\n$user_message")\n\nLog:\n$output" 0 0 # if there's a user_message, display it with two preceeding line breaks + dialog --no-collapse --colors --title "$title" --beep --msgbox "\n\ZuUpgrade of $($package_dir/$1.sh -N) successful!\Zn$([ -n "$user_message" ] && echo "\n\n$user_message")\n\nLog:\n$output" 0 0 # if there's a user_message, display it with two preceeding line breaks else - dialog --colors --title "$title" --beep --msgbox "\n\ZuUpgrade of $($package_dir/$1.sh -N) FAILED!\Zn\n\n$user_message\n\nLog:\n$output" 0 0 # if there's a user_message, display it with two preceeding line breaks + dialog --no-collapse --colors --title "$title" --beep --msgbox "\n\ZuUpgrade of $($package_dir/$1.sh -N) FAILED!\Zn\n\n$user_message\n\nLog:\n$output" 0 0 # if there's a user_message, display it with two preceeding line breaks fi } @@ -63,7 +63,7 @@ upgrade() { package_intro() { echo "Loading package info..." # check if each field in the package info is supported by the package, and if so get it and insert it into the package info dialog - dialog --colors --title "$title" --msgbox "\ + dialog --no-collapse --colors --title "$title" --msgbox "\ $($package_dir/$1.sh -N)\n\ $(if $package_dir/$1.sh -O | grep -q 'A'; then echo -e "by $($package_dir/$1.sh -A)"; fi)\n\ $(if $package_dir/$1.sh -O | grep -q 'D'; then echo "\n$($package_dir/$1.sh -D)"; fi)\n\ @@ -80,7 +80,7 @@ package_menu() { while true; do echo "Loading package menu..." # for each line, check if it's supported by the package, display it if the current install state of the package is appropriate (example: don't display "install" if the package is already installed, don't display "stop service" for a package with no services) - choice=$(dialog --title "$title" --cancel-label "Back" --menu "$($package_dir/$1.sh -N)" 17 45 5 \ + choice=$(dialog --no-collapse --title "$title" --cancel-label "Back" --menu "$($package_dir/$1.sh -N)" 17 45 5 \ $(if $package_dir/$1.sh -O | grep -q 'l' && $package_dir/$1.sh -I; then echo "Run software x"; fi) \ $(if $package_dir/$1.sh -O | grep -q 'i' && ! $package_dir/$1.sh -I; then echo "Install x"; fi) \ $(if $package_dir/$1.sh -O | grep -q 'u' && $package_dir/$1.sh -I; then echo "Uninstall x"; fi) \ @@ -109,7 +109,7 @@ package_menu() { "Disable service") eval "$package_dir/$1.sh -d" ;; "Stop service") eval "$package_dir/$1.sh -s" ;; "Start/restart service") eval "$package_dir/$1.sh -r" ;; - "Get service status") dialog --title "$title" --msgbox "$(eval "$package_dir/$1.sh -S")" 0 0 ;; + "Get service status") dialog --no-collapse --title "$title" --msgbox "$(eval "$package_dir/$1.sh -S")" 0 0 ;; "Back to software manager") break ;; esac done @@ -119,7 +119,7 @@ package_menu() { while true; do title="$title" option="" - option=$(dialog --cancel-label "Back" --menu "$title" 0 0 6 \ + option=$(dialog --no-collapse --cancel-label "Back" --menu "$title" 0 0 6 \ 1 "The Comms Channel BBS, TC²BBS" \ 2 "Contact (Meshtastic client)" \ 3 "Meshing Around by Spud" \