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 Jan 3, 2025
2 parents dfb56b1 + 88e10cd commit 3548cfd
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 53 deletions.
Binary file modified objects.tar.gz
Binary file not shown.
Binary file modified sherpa-manager.tar.gz
Binary file not shown.
83 changes: 51 additions & 32 deletions support/sherpa-manager.source
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,11 @@ LoadCMDs()
# Cherry-pick Entware binaries.

readonly r_gnu_awk_cmd=/opt/bin/awk
readonly r_gnu_dd_cmd=/opt/bin/dd
readonly r_gnu_find_cmd=/opt/bin/find
readonly r_gnu_grep_cmd=/opt/bin/grep
readonly r_gnu_less_cmd=/opt/bin/less
readonly r_gnu_nice_cmd=/opt/bin/nice
readonly r_gnu_sleep_cmd=/opt/bin/sleep
readonly r_gnu_stty_cmd=/opt/bin/stty
readonly r_gnu_timeout_cmd=/opt/bin/timeout
Expand Down Expand Up @@ -424,6 +426,7 @@ CMDsIsOk()
IsSysFileExist /usr/sbin/screen || return
# `/bin/sed` has already been called before arriving here.
IsSysFileExist /bin/sh || return
IsSysFileExist /bin/sha1sum || return
# `/bin/sleep` has already been called before arriving here.
[[ ! -e /usr/bin/sort ]] && ln -s /bin/busybox /usr/bin/sort # KLUDGE: `/usr/bin/sort` randomly disappears from QTS.
IsSysFileExist /usr/bin/tail || return
Expand Down Expand Up @@ -459,7 +462,7 @@ LocateSQLiteBinary()
[[ -e $sqlite_pathfile ]] && sqlite_cmd=$sqlite_pathfile
fi

# If that can't be found, then try several other locations...
# If that can't be found, then try several other locations ...

# These use a specific path to the binary:
# HybridBackup = `Hybrid Backup Sync`
Expand Down Expand Up @@ -825,6 +828,18 @@ DebugLogEnv()
DebugOS ok 'load averages' "$(GetOsSysLoadAverages)"
fi

DebugStorage ok 'default volume' "$(GetUserDefVol)"
DebugStorage ok 'write benchmark' "$(GetHardwareVolumeBenchmark)"
DebugStorage ok /opt "$(/usr/bin/readlink /opt 2> /dev/null || printf 'not present')"

local public_share=$(/sbin/getcfg SHARE_DEF defPublic -d Qpublic -f /etc/config/def_share.info)

if [[ -L /share/$public_share ]]; then
DebugStorage ok "'$public_share' share" /share/$public_share
else
DebugStorage warning "'$public_share' share" 'not present'
fi

DebugUserspace ok libc "$(GetUserLIBC)"
DebugUserspace ok 'libc copyright' "$(GetUserLIBCCopyright)"

Expand All @@ -835,18 +850,6 @@ DebugLogEnv()
fi

DebugUserspace ok '$EUID' "$EUID"
DebugUserspace ok 'default volume' "$(GetUserDefVol)"
DebugUserspace ok 'write benchmark' "$(GetHardwareVolumeBenchmark)"
DebugUserspace ok /opt "$(/usr/bin/readlink /opt 2> /dev/null || printf 'not present')"

local public_share=$(/sbin/getcfg SHARE_DEF defPublic -d Qpublic -f /etc/config/def_share.info)

if [[ -L /share/$public_share ]]; then
DebugUserspace ok "'$public_share' share" /share/$public_share
else
DebugUserspace warning "'$public_share' share" 'not present'
fi

DebugUserspace ok '$SHELL' "$(GetShell)"
DebugShell ok version "$(GetShellVersion)"
DebugShell ok copyright "$(GetShellCopyright)"
Expand Down Expand Up @@ -1021,7 +1024,7 @@ CheckEnv()
local target_packages=''

if [[ $(/bin/grep -iE 'out of memory|oom-killer' /mnt/HDA_ROOT/.logs/kmsg | /usr/bin/wc -l) -gt 0 ]]; then
ShowAsWarn "the $(TextBrightRed 'Out-Of-Memory killer') has been triggered ... check for $(TextBrightRed inactive) QPKGs"
ShowAsWarn "the $(TextBrightRed 'Out-Of-Memory killer') has been triggered, check for $(TextBrightRed inactive) QPKGs"
fi

if IsQpkgInstalled Entware; then
Expand Down Expand Up @@ -5965,7 +5968,7 @@ FormatReportField()

# Inputs: (local)
# $1 = field text
# $2 (optional) = type of field prefix to generate ('attention', 'alert', 'blank', etc...)
# $2 (optional) = type of field prefix to generate ('attention', 'alert', 'blank', etc ...)

# Inputs: (global)
# $r_chars_alert
Expand Down Expand Up @@ -7616,9 +7619,9 @@ BuildQPKGsStates()
InitQPKGsStates

if IsOsStartingPackages; then
ShowAsNote "$(GetOsName) is starting QPKGs ... check again in a few minutes"
ShowAsNote "$(GetOsName) is starting QPKGs, check again in a few minutes"
elif IsOsStarting; then
ShowAsNote "$(GetOsName) is still booting ... check again in a few minutes"
ShowAsNote "$(GetOsName) is still booting, check again in a few minutes"
elif IsOsStopping; then
ShowAsNote "$(GetOsName) is shutting-down"
elif IsOsStoppingPackages; then
Expand Down Expand Up @@ -8677,7 +8680,7 @@ ShowQPKGList()
{

# Inputs: (local)
# $1 = state or group list object name ('ISbackedup', 'ISNTbackedup', 'GRall', etc...)
# $1 = state or group list object name ('ISbackedup', 'ISNTbackedup', 'GRall', etc ...)

[[ -n ${1:-} ]] || return

Expand Down Expand Up @@ -8972,13 +8975,13 @@ GetHardwareCPUBenchmark()
local -i b=16 # Maximum time to run is around 1 second on my slowest NAS (TS-220).
local -i c=-20 # Run benchmark with highest priority.

if [[ -e /opt/bin/dd && -e /bin/sha1sum ]]; then
if [[ -e /opt/bin/nice ]]; then
a=$({ /opt/bin/nice -$c /opt/bin/dd if=/dev/zero bs=1MB count=$b | /bin/sha1sum > /dev/null; } 2>&1)
if [[ -e $r_gnu_dd_cmd ]]; then
if [[ -e $r_gnu_nice_cmd ]]; then
a=$({ $r_gnu_nice_cmd -$c $r_gnu_dd_cmd if=/dev/zero bs=1MB count=$b | /bin/sha1sum > /dev/null; } 2>&1)
elif [[ -e /bin/renice ]]; then
/bin/renice $c $$ &> /dev/null

a=$({ /opt/bin/dd if=/dev/zero bs=1MB count=$b | /bin/sha1sum > /dev/null; } 2>&1)
a=$({ $r_gnu_dd_cmd if=/dev/zero bs=1MB count=$b | /bin/sha1sum > /dev/null; } 2>&1)

/bin/renice 0 $$ &> /dev/null
fi
Expand Down Expand Up @@ -9009,13 +9012,13 @@ GetHardwareVolumeBenchmark()
if [[ -d $(/usr/bin/dirname "$d") ]]; then
[[ -e $d ]] && rm -f "$d"

if [[ -e /opt/bin/dd && -e /bin/sha1sum ]]; then
if [[ -e /opt/bin/nice ]]; then
a=$(/opt/bin/nice -$c /opt/bin/dd if=/dev/zero of=$d bs=8k count=$b 2>&1)
if [[ -e $r_gnu_dd_cmd ]]; then
if [[ -e $r_gnu_nice_cmd ]]; then
a=$($r_gnu_nice_cmd -$c $r_gnu_dd_cmd if=/dev/zero of=$d bs=8k count=$b 2>&1)
elif [[ -e /bin/renice ]]; then
/bin/renice $c $$ &> /dev/null

a=$(/opt/bin/dd if=/dev/zero of=$d bs=8k count=$b 2>&1)
a=$($r_gnu_dd_cmd if=/dev/zero of=$d bs=8k count=$b 2>&1)

/bin/renice 0 $$ &> /dev/null
fi
Expand Down Expand Up @@ -13438,14 +13441,18 @@ AddPeriod()
Uppercase()
{

tr 'a-z' 'A-Z' <<< "${1:-}"
[[ -n ${1:-} ]] || return

tr 'a-z' 'A-Z' <<< "$1"

}

Lowercase()
{

tr 'A-Z' 'a-z' <<< "${1:-}"
[[ -n ${1:-} ]] || return

tr 'A-Z' 'a-z' <<< "$1"

}

Expand Down Expand Up @@ -13837,6 +13844,18 @@ DebugUserspace()

}

DebugStorage()
{

# Inputs: (local)
# $1 = type
# $2 = name
# $3 = value

DebugItem "$1" storage "$2" "$3"

}

DebugScript()
{

Expand Down Expand Up @@ -14518,7 +14537,7 @@ ShowAsProc()

# Inputs: (local)
# $1 = task being carried-out.
# $2 = trailing task (after the ellipsis) (optional). If specified, $useropt_terse will be ignored.
# $2 = trailing task, shown after the ellipsis (optional). If specified, $useropt_terse will be ignored.

# Inputs: (global)
# $r_inhibit_display_pathfile
Expand All @@ -14533,7 +14552,7 @@ ShowAsProc()
local c="$a ... $b"

if [[ -n ${r_inhibit_display_pathfile:-} && ! -e $r_inhibit_display_pathfile ]]; then
if [[ ${useropt_verbose:=false} = false && ${useropt_terse:=true} = true ]] || [[ ${useropt_verbose:=false} = false && -n ${2:-} ]]; then
if [[ ${useropt_verbose:=false} = false && ${useropt_terse:=true} = true ]] || [[ ${useropt_verbose:=false} = false && -n $b ]]; then
OpStepClearWait "$(TextBrightYellow proc)" "$c"
else
OpStepClear "$(TextBrightYellow proc)" "$c"
Expand Down Expand Up @@ -14760,7 +14779,7 @@ ShowAsActionLogDetail()
# $4 = result 'ok', 'skipped-ok', 'skipped', 'failed'
# $5 = duration in milliseconds
# $6 = reason (optional) "file already exists in local cache"
# $7 = package type 'QPKG', 'IPK', etc...
# $7 = package type 'QPKG', 'IPK', etc ...
# $8 = quantity number of packages affected.

if [[ ${2:-undefined} = undefined ]]; then
Expand Down Expand Up @@ -14808,7 +14827,7 @@ ShowAsActionLogDetail()
;;
*)
if IsQpkgDbWillLog "$2"; then
DisplayAsIndentActionResultDurationReason "$3" "$2 $package_type" "$5" "For more information: /etc/init.d/$(/usr/bin/basename "$(GetQpkgServicePathFile "$2")") log"
DisplayAsIndentActionResultDurationReason "$3" "$2 $package_type" "$5" "for more information: /etc/init.d/$(/usr/bin/basename "$(GetQpkgServicePathFile "$2")") log"
else
DisplayAsIndentActionResultDurationReason "$3" "$2 $package_type" "$5" "$6"
fi
Expand Down
24 changes: 3 additions & 21 deletions workshop/ideas.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* When package actions are in-progress and user SIGINT, abort remaining actions, then show regular results report.
- Must show which actions completed before SIGINT, and which had to be aborted.

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

Expand Down Expand Up @@ -95,27 +98,6 @@
* In production, sherpa 'stable' branch should only update once per-day.
- 'unstable' should update once per 10 minutes.

* Examine TS-231 QTS executables with 'file'.
- In what way are they different to x41 executables?

x31:
-------------------------------------------------------------------------------------------------------------------------
[/sbin] # file getcfg
getcfg: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 2.6.16, stripped
-------------------------------------------------------------------------------------------------------------------------
[/sbin] # cat /etc/platform.conf
Platform = ARM_MS
-------------------------------------------------------------------------------------------------------------------------

x41:
-------------------------------------------------------------------------------------------------------------------------
[/sbin] # file getcfg
getcfg: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.1.1, BuildID[sha1]=5ffd3652ef380f1a3665b325f0a171e3e34fca7a, stripped
-------------------------------------------------------------------------------------------------------------------------
[/sbin] # cat /etc/platform.conf
Platform = ARM_AL
-------------------------------------------------------------------------------------------------------------------------

* QDK looks like it will now write installation scripts that extract to unique paths.
- Should now be able to install more than one QPKG simultaneously. https://github.com/qnap-dev/QDK/commit/f1eaf3bf0a9547d449592369e555cdfd6cc3c405
- It will take time for this ability to make its way into all QPKGs, so will need to note which QPKGs can be installed this way. 'packages' file will need an extra field to note this.
Expand Down
6 changes: 6 additions & 0 deletions workshop/issues.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Observed issues:

* Tableise() needs to support a new arg to change format of a single column.
- Needed for backup files report. Second column is filesize, which should be shown right-justified.

* Slight pause before on-screen messages are shown on slower NAS models under heavier load.
- This happens before 'proc: args ...' is shown.

* Service-script daemon PID shown twice consecutively during 'clean' action:
--------------------------------------------------------------------------------------------------
[/share/Public] # /etc/init.d/sabnzbd.sh clean
Expand Down

0 comments on commit 3548cfd

Please sign in to comment.