Skip to content

Commit

Permalink
[merge] from unstable into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
OneCDOnly committed Dec 23, 2024
2 parents 0669ed2 + 28404cd commit 76b7cbd
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 7 deletions.
Binary file modified objects.tar.gz
Binary file not shown.
Binary file modified sherpa-manager.tar.gz
Binary file not shown.
51 changes: 46 additions & 5 deletions support/sherpa-manager.source
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ DebugLogEnv()
DebugHardware ok CPU "$(GetHardwareCPUInfo)"
DebugHardware ok 'CPU cores' "$r_cpu_cores"
DebugHardware ok 'CPU architecture' "$r_nas_arch"
DebugHardware ok 'CPU benchmark' "$(GetHardwareCPUBenchmark)"
DebugHardware ok RAM "$(FormatAsThous "$r_nas_ram_kb")kiB"
DebugKernel ok name "$(GetOsKernelName)"
DebugKernel ok version "$(GetOsKernelVersion)"
Expand Down Expand Up @@ -8870,11 +8871,13 @@ ModPathToEntware()

if QPKGs-ISenabled.Exist Entware; then
! [[ $PATH =~ $b ]] || return

a=$(/bin/sed "s|${b}:||" <<< "$PATH:") # Append colon prior to searching, then remove existing Entware paths.
export PATH=$b:${a%:} # ... now prepend Entware paths and remove trailing colon
DebugAsDone 'prepended Entware to $PATH'
else
[[ $PATH =~ $b ]] || return

a=$(/bin/sed "s|${b}:||" <<< "$PATH:") # Append colon prior to searching, then remove existing Entware paths.
export PATH=${a%:} # ... now remove trailing colon
DebugAsDone 'removed Entware from $PATH'
Expand Down Expand Up @@ -8905,6 +8908,43 @@ GetHardwareCPUInfo()

}

GetHardwareCPUBenchmark()
{

# Get a basic CPU benchmark based-on time to calculate a single SHA checksum.

# Adapted from: https://bash-prompt.net/guides/bash-simple-bash-benchmark/ and modified to get a quick result that works in QTS. Less accurate, but this figure is for indication-only.

# QTS 4.3.3 has `sha1sum`, but no `sha256sum`.
# QTS 4.3.6 has both `sha1sum` and `sha256sum`.

# Use GNU `dd` because it generates speed statistics. BusyBox 1.01 `dd` does not.

if [[ ! -e /opt/bin/dd ]]; then
printf undefined

return 1
fi

# Run benchmark with highest priority.

/bin/renice -20 $$ &> /dev/null

# Capture stderr from `dd`.

local a=$({ /opt/bin/dd if=/dev/zero bs=1MB count=10 | /bin/sha1sum > /dev/null; } 2>&1 | /bin/grep copied | cut -d, -f4)

/bin/renice 0 $$ &> /dev/null

a=${a//[[:blank:]]/}
[[ -n $a ]] || a=undefined

printf '%s' "$a"

return 0

}

GetOsArch()
{

Expand Down Expand Up @@ -8964,6 +9004,8 @@ IsPythonOutdated()

# Check if Python3 interpreter needs upgrading for this NAS arch.

# NOTE: Entware Python3 packages are no-longer updated for ARMv5 arches.

# Inputs: (global)
# $r_min_python_version
# $r_nas_arch
Expand All @@ -8973,8 +9015,8 @@ IsPythonOutdated()
# $? = 0 if outdated, !0 if not

[[ -e $r_python3_cmd ]] || return
local a=$(GetPython3Ver "$r_python3_cmd")

local a=$(GetPython3Ver "$r_python3_cmd")
[[ $r_nas_arch = armv5tel && ${a//./} -lt 3114 ]] || [[ $r_nas_arch != armv5tel && ${a//./} -lt $r_min_python_version ]]

}
Expand All @@ -8998,6 +9040,8 @@ IsPerlOutdated()

# Check if Perl interpreter needs upgrading for this NAS arch.

# NOTE: Entware Perl packages are no-longer updated for ARMv5 arches.

# Inputs: (global)
# $r_min_perl_version
# $r_nas_arch
Expand All @@ -9007,8 +9051,8 @@ IsPerlOutdated()
# $? = 0 if outdated, !0 if not

[[ -e $r_perl_cmd ]] || return
local a=$(GetPerlVer "$r_perl_cmd")

local a=$(GetPerlVer "$r_perl_cmd")
[[ $r_nas_arch = armv5tel && ${a//./} -lt 5281 ]] || [[ $r_nas_arch != armv5tel && ${a//./} -lt $r_min_perl_version ]]

}
Expand Down Expand Up @@ -9046,7 +9090,6 @@ GetOsUptime()
{

local n=$(< /proc/uptime)

ConvertSecondsToDuration "${n%%.*}"

}
Expand Down Expand Up @@ -9083,7 +9126,6 @@ GetShellVersion()
# $SHELL

[[ -n ${SHELL:-} ]] || printf undefined

$SHELL --version | head -n1

}
Expand All @@ -9095,7 +9137,6 @@ GetShellCopyright()
# $SHELL

[[ -n ${SHELL:-} ]] || printf undefined

$SHELL --version | /bin/grep -i copyright | /bin/sed 's|\$||'

}
Expand Down
22 changes: 22 additions & 0 deletions workshop/ideas.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
* Include basic benchmark for storage speed read/write?

* Rename 'O' QPKGs:
# QPKGs to migrate from leading-'O'.

migration_qpkgs=(Lidarr Medusa qBittorrent Readarr SickGear Sonarr Tautulli Transmission Watcher3 Whisparr)

# Will need to modify:
# 'qpkg.conf'
# [OTransmission]
# Name = OTransmission
# QPKG_File = OTransmission.qpkg
# Shell = /share/CACHEDEV1_DATA/.qpkg/OTransmission/otransmission.sh
# Install_Path = /share/CACHEDEV1_DATA/.qpkg/OTransmission

# 1. stop QPKG,
# 2. rename service script,
# 3. rename installation path,
# 4. 'sed' replace all remaining occurrences in 'qpkg.conf',
# 5. application config files? internal paths, etc...
# 6. start QPKG.

* Checking 'upgradable' status is slow (due to the number of checks that must be performed).
- Consider only running this during `check` or `upgrade` actions.

Expand Down
6 changes: 4 additions & 2 deletions workshop/issues.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Observed issues:

* Features report: incompatible author message shown in 'CanBack?' column.

* Service-script daemon PID shown twice consecutively during 'clean' action:
--------------------------------------------------------------------------------------------------
[/share/Public] # /etc/init.d/sabnzbd.sh clean
Expand All @@ -21,8 +23,8 @@ Observed issues:

* Near the end of installing IPKs, monitored download path can remain at non-zero size while packages complete installation.
- Include a separate progress message when dir size stops increasing and shrinks instead?
- Maybe force increase to "100%" and stop monitoring?
- Maybe change progress message to "installing"?
- Force increase to "100%" and stop monitoring?
- Change progress message to "installing"?

* 'sherpa' and 'opkg' were not available after installing Entware.
- Entware installation may be corrupt.
Expand Down

0 comments on commit 76b7cbd

Please sign in to comment.