From e61738bf13463939bacab2481bb27ac98717181b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 07:44:43 +0100 Subject: [PATCH 1/2] Devtest images for new models, device info page (#/deviceinfo) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - board.sh: BOARD_DEVTEST (1 for a model that is being added, and for an unknown one). S03claim leaves root / shareos on such a box – the buttons of a new model are not known yet. - post-image.sh: a status column in MODELS (release | devtest); devtest files are named ShareOS---devtest.*, and the release job refuses them. - shareos-deviceinfo (system and rescue system): model, device tree, cmdline, CPU, memory, /proc/mtd, partitions, the U-Boot environment (read with dd), LEDs, hwmon, GPIO chips, input devices, interrupts, serial ports, I2C, USB, network, kernel log. MAC addresses and serial numbers masked unless --full. - shareos.deviceinfo get (admin) and a page not in the menu: http:///deviceinfo (redirect to #/deviceinfo), in the desktop view in the Settings window; download, copy, masking switch. A devtest box shows a banner on the overview and a reminder in the messages. - Tests: test-boards (devtest, S03claim, report and masking), test-notify (reminder), mock; ui-desktop expects the DISK CHANGE tab of #200. Docs: DEVICES/GERAETE, TESTING/TESTEN 14zz, RELEASE, CHANGELOG. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Sb3gb1FHs6DNkZHKinKAJv --- .github/workflows/build.yml | 9 ++ CHANGELOG.md | 5 + board/dlink/dns320l/initramfs/init | 1 + board/dlink/dns320l/mk-initramfs.sh | 2 + board/dlink/dns320l/post-image.sh | 25 ++- .../rootfs-overlay/etc/init.d/S03claim | 5 +- .../rootfs-overlay/usr/lib/shareos/board.sh | 11 +- .../usr/sbin/shareos-deviceinfo | 145 ++++++++++++++++++ docs/DEVICES.md | 29 ++++ docs/GERAETE.md | 30 ++++ docs/RELEASE.md | 4 +- docs/TESTEN.md | 8 + docs/TESTING.md | 8 + src/shareos-core/parts/README.md | 2 + src/shareos-core/parts/rpc/ORDER | 1 + src/shareos-core/parts/rpc/deviceinfo.uc | 23 +++ src/shareos-core/parts/rpc/system.uc | 2 +- src/shareos-core/parts/web/ORDER | 1 + src/shareos-core/parts/web/core.js | 2 + src/shareos-core/parts/web/deviceinfo.js | 69 +++++++++ src/shareos-core/parts/web/layout.js | 6 +- src/shareos-core/parts/web/overview.js | 2 +- src/shareos-core/usr/sbin/shareos-notify | 12 +- .../usr/share/rpcd/acl.d/shareos.json | 3 + src/shareos-core/www/desktop.js | 3 + src/shareos-core/www/deviceinfo/index.html | 4 + src/shareos-core/www/i18n/ar.json | 11 +- src/shareos-core/www/i18n/bn.json | 11 +- src/shareos-core/www/i18n/de.json | 11 +- src/shareos-core/www/i18n/es.json | 11 +- src/shareos-core/www/i18n/fr.json | 11 +- src/shareos-core/www/i18n/hi.json | 11 +- src/shareos-core/www/i18n/pt.json | 11 +- src/shareos-core/www/i18n/ru.json | 11 +- src/shareos-core/www/i18n/zh.json | 11 +- tests/mock-ubus.py | 8 +- tests/test-boards.sh | 33 ++++ tests/test-notify.sh | 5 + tests/ui-desktop.js | 4 +- tools/i18n/ar.tsv | 9 ++ tools/i18n/bn.tsv | 9 ++ tools/i18n/catalog.json | 11 +- tools/i18n/de.tsv | 9 ++ tools/i18n/es.tsv | 9 ++ tools/i18n/fr.tsv | 9 ++ tools/i18n/hi.tsv | 9 ++ tools/i18n/pt.tsv | 9 ++ tools/i18n/ru.tsv | 9 ++ tools/i18n/zh.tsv | 9 ++ 49 files changed, 622 insertions(+), 31 deletions(-) create mode 100755 board/dlink/dns320l/rootfs-overlay/usr/sbin/shareos-deviceinfo create mode 100644 src/shareos-core/parts/rpc/deviceinfo.uc create mode 100644 src/shareos-core/parts/web/deviceinfo.js create mode 100644 src/shareos-core/www/deviceinfo/index.html diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f08e3d3d..de11e6a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -233,6 +233,15 @@ jobs: path: artifacts merge-multiple: true + # a model that is being added (status "devtest" in post-image.sh) keeps + # the root password "shareos" – its files never go into a release + - name: No devtest images + run: | + if ls artifacts/*-devtest.* >/dev/null 2>&1; then + echo "::error::devtest images in the build: $(cd artifacts && ls *-devtest.* | tr '\n' ' ') – set the model to 'release' in board/dlink/dns320l/post-image.sh and BOARD_DEVTEST=0 in board.sh when it is tested, or take it out" + exit 1 + fi + - name: Sign the images env: RELEASE_SIGNING_KEY: ${{ secrets.RELEASE_SIGNING_KEY }} diff --git a/CHANGELOG.md b/CHANGELOG.md index e8515e35..153b8c77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Changes per release (newest first). The section of a version is added to its GitHub release automatically when the release is built. Test versions are pre-releases for test devices only. +## 0.3.0-beta.17 + +- **Devtest images for new models.** A model that is being added is built as `ShareOS---devtest.*` until it is tested (status `devtest` in `post-image.sh`, `BOARD_DEVTEST` in `board.sh`): root keeps the password `shareos` instead of being claimed with a button – the buttons of a new model are not known yet – and the overview and the messages say so. The release build refuses such files, so they only come from the build of a pull request. See [docs/DEVICES.md](docs/DEVICES.md#devtest-image-the-first-image-for-a-new-model). +- **Device info** (`http:///deviceinfo`, admins, on every model; not in the menu): everything needed to add a model – flash partitions, CPU, memory, device tree, LEDs, sensors, buttons, GPIOs, serial ports, I2C, USB, network, the U-Boot environment (read only) and the kernel log – as a text file to download or copy. MAC addresses and serial numbers are masked for public issues unless asked for. The same report in the rescue system: `shareos-deviceinfo`. + ## 0.3.0-beta.16 From the first test on a DNR-322L ([#180](https://github.com/UniqueDroid/ShareOS/issues/180), Marco): diff --git a/board/dlink/dns320l/initramfs/init b/board/dlink/dns320l/initramfs/init index d63796f4..9835b809 100755 --- a/board/dlink/dns320l/initramfs/init +++ b/board/dlink/dns320l/initramfs/init @@ -171,6 +171,7 @@ rescue() { ShareOS rescue system – $* $how shareos-install-ubi install the system into flash + shareos-deviceinfo > /tmp/info.txt hardware facts for a new model (scp) reboot EOF diff --git a/board/dlink/dns320l/mk-initramfs.sh b/board/dlink/dns320l/mk-initramfs.sh index e4d94a52..59b9c9ff 100755 --- a/board/dlink/dns320l/mk-initramfs.sh +++ b/board/dlink/dns320l/mk-initramfs.sh @@ -24,6 +24,8 @@ usr/bin/pk_verify FILES=" etc/passwd etc/group etc/shadow etc/shells etc/shareos-release usr/lib/shareos/board.sh +usr/sbin/shareos-boardinfo +usr/sbin/shareos-deviceinfo usr/share/udhcpc/default.script etc/ssl/certs/ca-certificates.crt etc/shareos/release.pub diff --git a/board/dlink/dns320l/post-image.sh b/board/dlink/dns320l/post-image.sh index fc3491ba..38050fb5 100755 --- a/board/dlink/dns320l/post-image.sh +++ b/board/dlink/dns320l/post-image.sh @@ -26,12 +26,16 @@ INITRD_MAX=3145728 # uImage per model (zImage + its device tree, U-Boot passes none), an initramfs # header per model (load address, see below) and a .bin with the D-Link # signature of the model (legacy/alt-f/mkfw.sh). -# firmware name device tree product custom model sub nver type initramfs address +# Last column: "release", or "devtest" for a model that is being added – its +# files are named ShareOS---devtest.* (BOARD_DEVTEST=1 in +# board.sh: root keeps the password "shareos", the web interface offers the +# device info), and the release job refuses them. +# firmware name device tree product custom model sub nver type initramfs address status MODELS=" -DNS-320L-rev-Ax kirkwood-dns320l 0 8 11 1 1 6 0x00800000 -DNS-320-rev-Bx kirkwood-dns320b 0 8 12 1 1 5 0x00800000 -DNS-320-rev-Ax kirkwood-dns320 0 8 7 2 0 4 0x01000000 -DNS-325-rev-Ax kirkwood-dns325 0 8 5 2 0 3 0x01000000 +DNS-320L-rev-Ax kirkwood-dns320l 0 8 11 1 1 6 0x00800000 release +DNS-320-rev-Bx kirkwood-dns320b 0 8 12 1 1 5 0x00800000 release +DNS-320-rev-Ax kirkwood-dns320 0 8 7 2 0 4 0x01000000 release +DNS-325-rev-Ax kirkwood-dns325 0 8 5 2 0 3 0x01000000 release " KVER=$(sed -n 's/^BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="\(.*\)"/\1/p' "$BR2_CONFIG") @@ -66,13 +70,18 @@ check_size() { T=$(mktemp -d) trap 'rm -rf "$T"' EXIT -echo "$MODELS" | while read -r NAME DTB PROD CUST MODEL SUB NVER TYPE INITRD_ADDR; do +echo "$MODELS" | while read -r NAME DTB PROD CUST MODEL SUB NVER TYPE INITRD_ADDR STATUS; do [ -n "$NAME" ] || continue + case "$STATUS" in + release) FILE=$NAME ;; + devtest) FILE=$NAME-devtest ;; + *) echo "post-image: status of $NAME is '$STATUS', not release or devtest" >&2; exit 1 ;; + esac ZIMAGE="$B/zImage.$DTB" [ -f "$ZIMAGE" ] || { echo "post-image: $ZIMAGE missing"; exit 1; } UIMAGE="$B/uImage.$NAME" UROOTFS="$B/urootfs.$NAME" - OUT="ShareOS-${VERSION}-${NAME}.bin" + OUT="ShareOS-${VERSION}-${FILE}.bin" "$MKIMAGE" -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 \ -n "ShareOS-${VERSION}, kernel ${KVER}" -d "$ZIMAGE" "$UIMAGE" >/dev/null @@ -105,7 +114,7 @@ echo "$MODELS" | while read -r NAME DTB PROD CUST MODEL SUB NVER TYPE INITRD_ADD # and for a netboot via TFTP (U-Boot loads uImage + urootfs, the initramfs # fetches rootfs.squashfs). Published in GitHub Releases with its .sha256. # The bundle names its model in shareos-release (SHAREOS_FWNAME). - SU="ShareOS-${VERSION}-${NAME}.sysupgrade.tar" + SU="ShareOS-${VERSION}-${FILE}.sysupgrade.tar" P="$T/su-$NAME"; mkdir -p "$P" cp "$UIMAGE" "$P/uImage"; cp "$UROOTFS" "$P/urootfs" ln -f "$B/rootfs.squashfs" "$P/rootfs.squashfs" 2>/dev/null || cp "$B/rootfs.squashfs" "$P/rootfs.squashfs" diff --git a/board/dlink/dns320l/rootfs-overlay/etc/init.d/S03claim b/board/dlink/dns320l/rootfs-overlay/etc/init.d/S03claim index 3ef845cd..ea0e8ed4 100755 --- a/board/dlink/dns320l/rootfs-overlay/etc/init.d/S03claim +++ b/board/dlink/dns320l/rootfs-overlay/etc/init.d/S03claim @@ -10,10 +10,13 @@ # console and the browser terminal stay closed until then. # # Not touched: boxes with their own root password, the development boot over -# TFTP (shareos.netroot) and the rescue system (initramfs, has its own root). +# TFTP (shareos.netroot), the rescue system (initramfs, has its own root) and +# a model that is being added (BOARD_DEVTEST in board.sh): its testers sign in +# with root / shareos before the buttons of the box are known. # [ "$1" = start ] || exit 0 grep -q 'shareos.netroot' /proc/cmdline 2>/dev/null && exit 0 +[ "$(shareos-boardinfo devtest 2>/dev/null)" = 1 ] && exit 0 [ -e /overlay/claim ] || exit 0 [ "$(uci -q get shareos.setup.done)" = 1 ] && { rm -f /overlay/claim; exit 0; } diff --git a/board/dlink/dns320l/rootfs-overlay/usr/lib/shareos/board.sh b/board/dlink/dns320l/rootfs-overlay/usr/lib/shareos/board.sh index 24e0450a..7b1862b5 100644 --- a/board/dlink/dns320l/rootfs-overlay/usr/lib/shareos/board.sh +++ b/board/dlink/dns320l/rootfs-overlay/usr/lib/shareos/board.sh @@ -28,10 +28,15 @@ # BOARD_LED_POWER power LED; empty: driven by the MCU (/tmp/sys/power_led) # BOARD_RAM_SMALL 1 on boxes with 128 MB RAM # BOARD_TESTED 1 when tested on real hardware +# BOARD_DEVTEST 1 on a model that is being added (devtest image): root +# keeps the password "shareos" (no claiming), the web +# interface says so and offers the device info +# (#/deviceinfo); its files are named …-devtest and are +# never part of a release. Also 1 on an unknown model. board_detect() { model=$( { tr -d '\000' < ${SHAREOS_ROOT:-}/proc/device-tree/model; } 2>/dev/null) - BOARD_POWER_BUTTON= BOARD_POWER_BACK= BOARD_LED_POWER= BOARD_RAM_SMALL=0 BOARD_TESTED=0 + BOARD_POWER_BUTTON= BOARD_POWER_BACK= BOARD_LED_POWER= BOARD_RAM_SMALL=0 BOARD_TESTED=0 BOARD_DEVTEST=0 case "$model" in *DNS-320L*) BOARD_ID=dns320l BOARD_NAME="D-Link DNS-320L rev A" BOARD_FWNAME=DNS-320L-rev-Ax @@ -71,14 +76,14 @@ board_detect() { *) BOARD_ID=unknown BOARD_NAME="${model:-unknown}" BOARD_FWNAME= BOARD_SIG= BOARD_MODEL= BOARD_CONTROL=none BOARD_RTC=kernel - BOARD_LED_STATUS= BOARD_LED_USB= BOARD_LED_DISK1= BOARD_LED_DISK2= ;; + BOARD_LED_STATUS= BOARD_LED_USB= BOARD_LED_DISK1= BOARD_LED_DISK2= BOARD_DEVTEST=1 ;; esac } # all variables as KEY=value lines (for /tmp/sys/board.env and shareos-boardinfo) board_env() { for v in ID NAME FWNAME SIG MODEL CONTROL RTC POWER_BUTTON POWER_BACK \ - LED_STATUS LED_USB LED_DISK1 LED_DISK2 LED_POWER RAM_SMALL TESTED; do + LED_STATUS LED_USB LED_DISK1 LED_DISK2 LED_POWER RAM_SMALL TESTED DEVTEST; do eval "printf 'BOARD_%s=\"%s\"\n' $v \"\$BOARD_$v\"" done } diff --git a/board/dlink/dns320l/rootfs-overlay/usr/sbin/shareos-deviceinfo b/board/dlink/dns320l/rootfs-overlay/usr/sbin/shareos-deviceinfo new file mode 100755 index 00000000..a7d77a50 --- /dev/null +++ b/board/dlink/dns320l/rootfs-overlay/usr/sbin/shareos-deviceinfo @@ -0,0 +1,145 @@ +#!/bin/sh +# +# shareos-deviceinfo – what a new model needs to be added to ShareOS +# +# shareos-deviceinfo report as text; MAC addresses and serial +# numbers masked, for a public issue +# shareos-deviceinfo --full the same without masking +# +# Runs in the system and in the rescue system (initramfs, BusyBox only), and +# only reads: /proc, /sys, the kernel log and the U-Boot environment in flash +# (read with dd, never written). The web interface shows it at #/deviceinfo. +# Tests: SHAREOS_ROOT= for the files; the programs come from PATH. +# +R=${SHAREOS_ROOT:-} +FULL=0 +[ "$1" = --full ] && FULL=1 + +sec() { printf '\n### %s\n' "$1"; } +show() { # <file>: the file, or "(not there)" + sec "$1" + if [ -r "$R$2" ]; then tr -d '\000' < "$R$2"; echo; else echo "(not there)"; fi +} +run() { # <title> <command…>: its output, or why there is none + t=$1; shift + sec "$t" + command -v "$1" >/dev/null 2>&1 || { echo "($1 not there)"; return; } + "$@" 2>&1 +} +list() { # <title> <folder>: the names in it + sec "$1" + if [ -d "$R$2" ]; then ls "$R$2"; else echo "(not there)"; fi +} + +# the U-Boot environment: the partition whose name has "env" in it, read +# with dd (variables are NUL-separated "name=value" after a 4-byte CRC) +uboot_env() { + sec "U-Boot environment (flash, read only)" + n=$(sed -n 's/^mtd\([0-9]*\):.*"[^"]*env[^"]*".*/\1/p' "$R/proc/mtd" 2>/dev/null | head -n 1) + if [ -z "$n" ] || [ ! -r "$R/dev/mtd$n" ]; then echo "(no environment partition found)"; return; fi + echo "(mtd$n)" + dd if="$R/dev/mtd$n" bs=65536 count=2 2>/dev/null | tr '\000' '\n' | + grep -a -o '[A-Za-z_][A-Za-z0-9_.-]*=[[:print:]]*' | head -n 200 +} + +hwmon() { + sec "hwmon sensors" + found=0 + for h in "$R"/sys/class/hwmon/hwmon*; do + [ -d "$h" ] || continue + found=1 + echo "${h##*/}: $(cat "$h/name" 2>/dev/null)" + for f in "$h"/temp*_input "$h"/fan*_input "$h"/pwm[0-9] "$h"/in*_input; do + [ -r "$f" ] && echo " ${f##*/} = $(cat "$f" 2>/dev/null)" + done + done + [ $found = 1 ] || echo "(none)" +} + +gpio() { + sec "GPIO chips" + found=0 + for c in "$R"/sys/class/gpio/gpiochip*; do + [ -d "$c" ] || continue + found=1 + echo "${c##*/}: label=$(cat "$c/label" 2>/dev/null) base=$(cat "$c/base" 2>/dev/null) ngpio=$(cat "$c/ngpio" 2>/dev/null)" + done + [ $found = 1 ] || echo "(none)" +} + +leds() { + sec "LEDs (current trigger)" + found=0 + for l in "$R"/sys/class/leds/*; do + [ -d "$l" ] || continue + found=1 + t=$(cat "$l/trigger" 2>/dev/null) + case "$t" in *\[*\]*) t=${t#*[}; t=${t%%]*} ;; esac + echo "${l##*/}: $t" + done + [ $found = 1 ] || echo "(none)" +} + +usb() { + sec "USB devices" + found=0 + for d in "$R"/sys/bus/usb/devices/*; do + [ -r "$d/idVendor" ] || continue + found=1 + echo "${d##*/}: $(cat "$d/idVendor"):$(cat "$d/idProduct") $(cat "$d/manufacturer" 2>/dev/null) $(cat "$d/product" 2>/dev/null)" + done + [ $found = 1 ] || echo "(none)" +} + +net() { + sec "network interfaces" + for i in "$R"/sys/class/net/*; do + [ -d "$i" ] || continue + n=${i##*/} + [ "$n" = lo ] && continue + echo "$n: address=$(cat "$i/address" 2>/dev/null) carrier=$(cat "$i/carrier" 2>/dev/null) speed=$(cat "$i/speed" 2>/dev/null) driver=$(basename "$(readlink "$i/device/driver" 2>/dev/null)" 2>/dev/null)" + done +} + +report() { + echo "ShareOS device info – $(date -u '+%Y-%m-%d %H:%M UTC' 2>/dev/null)" + [ $FULL = 1 ] && echo "NOT MASKED: contains MAC addresses and serial numbers" \ + || echo "MAC addresses and serial numbers are masked." + show "ShareOS version" /etc/shareos-release + run "detected board (board.sh)" shareos-boardinfo + show "device-tree model" /proc/device-tree/model + show "device-tree compatible" /proc/device-tree/compatible + show "kernel command line" /proc/cmdline + run "kernel" uname -a + show "CPU" /proc/cpuinfo + run "memory" free + show "flash partitions (/proc/mtd)" /proc/mtd + show "partitions" /proc/partitions + uboot_env + list "LEDs" /sys/class/leds + leds + list "hwmon" /sys/class/hwmon + hwmon + gpio + show "input devices (buttons)" /proc/bus/input/devices + show "interrupts" /proc/interrupts + sec "serial ports"; ls "$R"/dev/ttyS* 2>/dev/null || echo "(none)" + show "serial ports (driver)" /proc/tty/driver/serial + list "I2C devices" /sys/bus/i2c/devices + usb + net + run "eth0" ifconfig eth0 + run "kernel log" dmesg +} + +# MAC addresses keep their last two bytes; serial numbers, ethaddr lines +# and the like keep nothing +mask() { + sed -E \ + -e 's/(([0-9A-Fa-f]{2}[:-]){4})([0-9A-Fa-f]{2}[:-][0-9A-Fa-f]{2})/xx:xx:xx:xx:\3/g' \ + -e 's/^([A-Za-z0-9_]*([Ss]erial|SERIAL|SN|_sn)[A-Za-z0-9_]*=).*/\1(masked)/' \ + -e 's/^(sn=).*/\1(masked)/' \ + -e 's/(Serial[[:space:]]*:[[:space:]]*).*/\1(masked)/' +} + +if [ $FULL = 1 ]; then report; else report | mask; fi diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 43c26a08..ca9aa3cc 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -100,3 +100,32 @@ touched. device tree, D-Link signature from `legacy/alt-f/mkfw.sh`). 3. A case in `board_detect` of `board.sh` (model text, LEDs, control, buttons) and in `tests/test-boards.sh`. + +### Devtest image: the first image for a new model + +A model that is being added is built as a **devtest image** until it has been +tested: status `devtest` in its `MODELS` line (files +`ShareOS-<version>-<name>-devtest.bin` / `.sysupgrade.tar`) and +`BOARD_DEVTEST=1` in its case of `board.sh`. Its testers get the files from the +build of the pull request (Actions → artifact), never from a release – the +release job refuses devtest files. + +On such a box: + +- root keeps the password **shareos** – no claiming with a button (the buttons + of a new model are not known yet). Web interface and SSH: `root` / `shareos`. + Use it only in your own network. +- The overview and the messages say that it is a test image and link to the + **device info**: `http://<box>/deviceinfo` (also open for admins on every + other model). It collects what is needed to add the model – flash partitions, + CPU, memory, device tree, LEDs, sensors, buttons (input devices), GPIOs, + serial ports, I2C, USB, network, the U-Boot environment (read from flash, + never written) and the kernel log – and offers it as a text file. MAC + addresses and serial numbers are masked unless *Show MAC addresses and serial + numbers* is ticked: attach the masked file to the issue of the model. +- In the rescue system (SSH after a TFTP or rescue boot) the same report: + `shareos-deviceinfo > /tmp/info.txt`, then copy it with `scp` + (`--full`: without masking). + +When the model works: status `release`, `BOARD_DEVTEST=0`, and it goes into +the next release with the normal claiming. diff --git a/docs/GERAETE.md b/docs/GERAETE.md index 7e6737bf..10258eb3 100644 --- a/docs/GERAETE.md +++ b/docs/GERAETE.md @@ -103,3 +103,33 @@ kann. Die Daten auf den Platten werden nie angefasst. (Firmware-Name, Device-Tree, D-Link-Signatur aus `legacy/alt-f/mkfw.sh`). 3. Ein Fall in `board_detect` von `board.sh` (Modelltext, LEDs, Steuerung, Tasten) und in `tests/test-boards.sh`. + +### Devtest-Image: das erste Image für ein neues Modell + +Ein Modell, das hinzukommt, wird bis zum Test als **Devtest-Image** gebaut: +Status `devtest` in seiner `MODELS`-Zeile (Dateien +`ShareOS-<version>-<name>-devtest.bin` / `.sysupgrade.tar`) und +`BOARD_DEVTEST=1` in seinem Fall von `board.sh`. Seine Tester bekommen die +Dateien aus dem Build des Pull Requests (Actions → Artefakt), nie aus einem +Release – der Release-Job lehnt Devtest-Dateien ab. + +Auf so einer Box: + +- root behält das Passwort **shareos** – kein Beanspruchen per Taste (die + Tasten eines neuen Modells sind noch nicht bekannt). Weboberfläche und SSH: + `root` / `shareos`. Nur im eigenen Netz benutzen. +- Übersicht und Nachrichten sagen, dass es ein Testimage ist, und verlinken die + **Geräteinfo**: `http://<box>/deviceinfo` (für Admins auch auf jedem anderen + Modell offen). Sie sammelt, was zum Hinzufügen des Modells gebraucht wird – + Flash-Partitionen, CPU, Speicher, Device-Tree, LEDs, Sensoren, Tasten + (Eingabegeräte), GPIOs, serielle Schnittstellen, I2C, USB, Netzwerk, die + U-Boot-Umgebung (aus dem Flash gelesen, nie geschrieben) und das + Kernel-Protokoll – und bietet sie als Textdatei an. MAC-Adressen und + Seriennummern sind maskiert, solange *Show MAC addresses and serial numbers* + nicht angehakt ist: die maskierte Datei ans Issue des Modells hängen. +- Im Rettungssystem (SSH nach einem TFTP- oder Rescue-Start) derselbe Bericht: + `shareos-deviceinfo > /tmp/info.txt`, dann mit `scp` kopieren + (`--full`: ohne Maskierung). + +Wenn das Modell läuft: Status `release`, `BOARD_DEVTEST=0`, und es kommt mit +dem normalen Beanspruchen ins nächste Release. diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 2bdd240d..fc8e0009 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -1,6 +1,8 @@ # Releasing ShareOS -1. Everything for the release is merged into `main` (CI green). +1. Everything for the release is merged into `main` (CI green). Models with + the status `devtest` (see [DEVICES.md](DEVICES.md#devtest-image-the-first-image-for-a-new-model)) + stop the release job – set them to `release` when tested, or take them out. 2. **Docs are up to date in the same merge:** - `CHANGELOG.md`: section `## <version>` with the changes (it is attached to the GitHub release automatically) - `README.md`: status and feature list diff --git a/docs/TESTEN.md b/docs/TESTEN.md index 6079b13e..e2e00038 100644 --- a/docs/TESTEN.md +++ b/docs/TESTEN.md @@ -530,6 +530,14 @@ Braucht ein Tailscale-Konto (kostenlos), ein Handy oder einen Rechner mit Tailsc 5. Konto ohne persönlichen Ordner: Teilen meldet „no personal folder“; das Geteilte wird verworfen und kommt bei der nächsten Anmeldung nicht wieder. 6. Dateidialog einer App für ein Konto **ohne** *Dateien* (z. B. Webpad → *Öffnen*): Die Ordnerauswahl zeigt zuerst *App-Daten*, dann *Mein Ordner* und die Freigaben des Benutzers; Freigaben nur zum Lesen sind markiert und fehlen beim Speichern. Die App legt ihre eigenen Dateien weiter in *App-Daten* ab. +## 14zz. Geräteinfo, Devtest-Images (0.3.0-beta.17) + +1. Auf einer beliebigen Box als Admin angemeldet: `http://<box>/deviceinfo` öffnen. Die Seite *DEVICE INFO* öffnet sich (klassische Ansicht: unter *System*, ohne Reiter; Desktop-Ansicht: im Fenster *Settings*). Sie zeigt Modell, `/proc/mtd`, CPU, LEDs, hwmon-Sensoren, Eingabegeräte, die U-Boot-Umgebung und das Kernel-Protokoll. MAC-Adressen lauten `xx:xx:xx:xx:..:..`, Seriennummern `(masked)`. +2. *Show MAC addresses and serial numbers* anhaken: Der Bericht wird neu gelesen, vollständig, oben steht „NOT MASKED“. *Download* speichert `shareos-deviceinfo-<modell>-<datum>-full.txt`, *Copy* legt ihn in die Zwischenablage (nur über HTTPS oder auf localhost – sonst sagt die Seite, man soll *Download* nehmen). +3. Über SSH: `shareos-deviceinfo | head -40` und `shareos-deviceinfo --full | grep ethaddr`. Es wird nichts geschrieben: `md5sum /dev/mtd*` vorher und nachher gleich. +4. Rettungssystem (TFTP-Start mit `shareos.rescue`): Die Startmeldung nennt `shareos-deviceinfo`; `shareos-deviceinfo > /tmp/info.txt` geht dort auch, `scp root@<box>:/tmp/info.txt .` holt ihn ab. +5. Devtest-Image (nur mit einem Modell im Status `devtest`, z. B. einem Pull Request für ein neues Modell): nach dem Flashen geht `root` / `shareos` im Browser und über SSH ohne Tastendruck; die Übersicht zeigt den gelben Hinweis *Test image for a new model* mit dem Link, *Messages* dasselbe innerhalb von 10 Minuten. + ## 14zy. Plattenwechsel (0.3.0-beta.16) Braucht eine zweite Platte (Schacht oder USB-Gehäuse), die gelöscht werden darf. **Nicht auf einer Box mit Daten, die du ohne Sicherung nicht verlieren darfst.** diff --git a/docs/TESTING.md b/docs/TESTING.md index dcbc0ac2..41047b69 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -525,6 +525,14 @@ Needs a Tailscale account (free), a phone or computer with Tailscale, the file ` 5. An account without a personal folder: sharing shows "no personal folder"; the shared item is dropped and does not come back at the next login. 6. File dialog of an app for an account **without** *Files* (e.g. Webpad → *Open*): the list of folders shows *App data* first, then *My folder* and the user's shares; read-only shares are marked and are missing when saving. The app still keeps its own files in *App data*. +## 14zz. Device info, devtest images (0.3.0-beta.17) + +1. On any box, signed in as admin: open `http://<box>/deviceinfo`. The page *DEVICE INFO* opens (classic view: under *System*, no tab; desktop view: in the *Settings* window). It shows the model, `/proc/mtd`, the CPU, LEDs, hwmon sensors, input devices, the U-Boot environment and the kernel log. MAC addresses read `xx:xx:xx:xx:..:..`, serial numbers `(masked)`. +2. Tick *Show MAC addresses and serial numbers*: the report is read again, complete, with "NOT MASKED" at the top. *Download* saves `shareos-deviceinfo-<model>-<date>-full.txt`, *Copy* puts it on the clipboard (only over HTTPS or on localhost – otherwise the page says to use *Download*). +3. Over SSH: `shareos-deviceinfo | head -40` and `shareos-deviceinfo --full | grep ethaddr`. Nothing is written: `md5sum /dev/mtd*` before and after is the same. +4. Rescue system (TFTP boot with `shareos.rescue`): the start message names `shareos-deviceinfo`; `shareos-deviceinfo > /tmp/info.txt` works there too, `scp root@<box>:/tmp/info.txt .` fetches it. +5. Devtest image (only with a model that has the status `devtest`, e.g. a pull request for a new model): after flashing, `root` / `shareos` works in the browser and over SSH without pressing a button; the overview shows the yellow note *Test image for a new model* with the link, *Messages* the same within 10 minutes. + ## 14zy. Disk change (0.3.0-beta.16) Needs a second disk (bay or USB case) that may be erased. **Not on a box with data you cannot lose without a backup.** diff --git a/src/shareos-core/parts/README.md b/src/shareos-core/parts/README.md index 0c0203ff..7058867e 100644 --- a/src/shareos-core/parts/README.md +++ b/src/shareos-core/parts/README.md @@ -39,6 +39,7 @@ drawing and its clicks to the tables of `core.js`: `Object.assign(SYS, …)`, | `system-network.js` | System: Network, HTTPS, dynamic DNS, own CA | 382 | | `system-firmware.js` | System: Firmware, update flow | 245 | | `system-messages.js` | System: Messages, Logs | 106 | +| `deviceinfo.js` | System: device info (hidden page `#/deviceinfo`), devtest banner | 69 | | `firstrun.js` | First-run wizard, recovery mode | 243 | | `pwa.js` | installed app (PWA) and widget status | 154 | | `files.js` | File browser | 432 | @@ -68,6 +69,7 @@ all helpers first (in the order of `ORDER`) and all methods after them. | `cloud.uc` | shareos.cloud | 298 | | `devices.uc` | shareos.printer, ups | 106 | | `snapshots.uc` | shareos.snapshots | 156 | +| `deviceinfo.uc` | shareos.deviceinfo (hardware facts of a new model) | 23 | | `apps.uc` | shareos.apps, appstatus | 278 | | `files.uc` | shareos.files, appfs | 541 | | `files-jobs.uc` | copy, move and delete in the background: result, progress, stop | 78 | diff --git a/src/shareos-core/parts/rpc/ORDER b/src/shareos-core/parts/rpc/ORDER index 9a1aadfd..adfa0e6b 100644 --- a/src/shareos-core/parts/rpc/ORDER +++ b/src/shareos-core/parts/rpc/ORDER @@ -15,6 +15,7 @@ cloud.uc devices.uc snapshots.uc migrate.uc +deviceinfo.uc apps.uc files.uc files-jobs.uc diff --git a/src/shareos-core/parts/rpc/deviceinfo.uc b/src/shareos-core/parts/rpc/deviceinfo.uc new file mode 100644 index 00000000..3e184bf0 --- /dev/null +++ b/src/shareos-core/parts/rpc/deviceinfo.uc @@ -0,0 +1,23 @@ +/* ---------- device info: hardware facts of a new model (shareos-deviceinfo) ---------- */ + +const DEVICEINFO = '/usr/sbin/shareos-deviceinfo'; + +// a model that is being added (BOARD_DEVTEST in board.sh): root keeps the +// password "shareos", the web interface says so and offers the device info +function devtest() { return board().devtest == '1'; } + +/* ========== methods (joined after the helpers of all parts, see build-parts.sh) ========== */ + +add_methods({ + 'shareos.deviceinfo': { + // the report as text; full: without masking MAC addresses and serial numbers + get: { + args: { full: false }, + call: function(req) { + let r = sh(DEVICEINFO + (req.args.full === true ? ' --full' : '')); + return { text: r.out, full: req.args.full === true, devtest: devtest(), + fwname: board().fwname || board().id || 'unknown' }; + } + } + } +}); diff --git a/src/shareos-core/parts/rpc/system.uc b/src/shareos-core/parts/rpc/system.uc index 7ae95368..7c9d3b2d 100644 --- a/src/shareos-core/parts/rpc/system.uc +++ b/src/shareos-core/parts/rpc/system.uc @@ -102,7 +102,7 @@ add_methods({ let net = '/sys/class/net/eth0/'; return { model: read_trim('/proc/device-tree/model'), - board: { id: board().id ?? null, name: board().name ?? null, fwname: board().fwname ?? null, tested: board().tested == '1' }, + board: { id: board().id ?? null, name: board().name ?? null, fwname: board().fwname ?? null, tested: board().tested == '1', devtest: devtest() }, release: release(), hostname: read_trim('/proc/sys/kernel/hostname'), kernel: read_trim('/proc/sys/kernel/osrelease'), diff --git a/src/shareos-core/parts/web/ORDER b/src/shareos-core/parts/web/ORDER index 75cc8d47..6ec93630 100644 --- a/src/shareos-core/parts/web/ORDER +++ b/src/shareos-core/parts/web/ORDER @@ -22,6 +22,7 @@ system-general.js system-network.js system-firmware.js system-messages.js +deviceinfo.js firstrun.js pwa.js files.js diff --git a/src/shareos-core/parts/web/core.js b/src/shareos-core/parts/web/core.js index bffd758e..e0e6f36a 100644 --- a/src/shareos-core/parts/web/core.js +++ b/src/shareos-core/parts/web/core.js @@ -192,6 +192,8 @@ const TABS = [ ['overview', 'OVERVIEW'], ['storage', 'STORAGE'], ['shares', 'SHARES'], ['services', 'SERVICES'], ['apps', 'APPS'], ['cloud', 'CLOUD'], ['paperless', 'PAPERLESS'], ['dnsfilter', 'DNS FILTER'], ['system', 'SYSTEM'] ]; +// pages of System without a tab in its menu (reached by link) +const SYS_HIDDEN = ['deviceinfo']; const SYS_SUBS = [['general', 'GENERAL'], ['appearance', 'APPEARANCE'], ['network', 'NETWORK'], ['notifications', 'MESSAGES'], ['logs', 'LOGS'], ['terminal', 'TERMINAL'], ['time', 'TIME'], ['power', 'POWER & RESET'], ['firmware', 'FIRMWARE']]; const SVC_SUBS = [['status', 'STATUS'], ['autostart', 'AUTOSTART'], ['dlna', 'MEDIA SERVER'], ['printer', 'PRINTERS'], ['ups', 'UPS'], ['torrent', 'TORRENTS']]; const SHR_SUBS = [['shares', 'SHARES'], ['files', 'FILES'], ['users', 'USER'], ['groups', 'GROUPS']]; diff --git a/src/shareos-core/parts/web/deviceinfo.js b/src/shareos-core/parts/web/deviceinfo.js new file mode 100644 index 00000000..268c7260 --- /dev/null +++ b/src/shareos-core/parts/web/deviceinfo.js @@ -0,0 +1,69 @@ +/* ---------- System: device info (hidden page #/deviceinfo) -------------------- */ + +// What a new model needs to be added to ShareOS: flash layout, CPU, LEDs, +// sensors, buttons, the U-Boot environment and the kernel log, as one text +// file. Not in the menu: the testers of a devtest image get the link from the +// overview (and from the issue); every admin can open #/deviceinfo. + +const devtestBox = () => !!S.info?.board?.devtest; + +// the banner of a devtest image on the overview +function devtestBanner() { + if (!devtestBox()) return ''; + return html`<div class="banner" style="margin:0 0 16px">${svg(I.warn)}<span><b>Test image for a new model.</b> root keeps the password shareos – use the box only in your own network. Please send the device info: <a href="#/deviceinfo">Device info</a></span></div>`; +} + +function deviceinfoFile() { + const d = new Date(), p = (n) => String(n).padStart(2, '0'); + return `shareos-deviceinfo-${S.devinfo?.fwname || 'box'}-${d.getFullYear()}${p(d.getMonth() + 1)}${p(d.getDate())}${S.devinfo?.full ? '-full' : ''}.txt`; +} + +function loadDeviceinfo() { + const full = !!S.devinfoFull; + S.devinfo = { loading: true, full }; + renderMain(); + rpc('shareos.deviceinfo', 'get', { full }).then((r) => { S.devinfo = r; if (S.route.sub === 'deviceinfo') renderMain(); }) + .catch((e) => { S.devinfo = { error: e.message, full }; if (S.route.sub === 'deviceinfo') renderMain(); }); +} + +Object.assign(SYS, { + deviceinfo() { + const d = S.devinfo; + return html`<section class="sec"> + <h2 class="gh">DEVICE INFO <span>hardware facts for adding a model</span></h2> + <div class="panel"> + <p class="mut" style="margin:0 0 10px">Model, flash partitions, CPU, memory, LEDs, sensors, buttons, GPIOs, serial ports, network, the U-Boot environment and the kernel log of this box – everything a new model needs. Only read, nothing is changed. Attach the file to the issue of the model.</p> + <label class="chk"><input type="checkbox" id="di-full"${S.devinfoFull ? raw(' checked') : ''}><span>Show MAC addresses and serial numbers (otherwise masked – keep them out of public issues)</span></label> + <div class="acts" style="margin-top:10px"> + <button class="btn primary sm" type="button" data-act="di-download"${d?.text ? '' : raw(' disabled')}>Download</button> + <button class="btn sm" type="button" data-act="di-copy"${d?.text ? '' : raw(' disabled')}>Copy</button> + <button class="btn sm ghost" type="button" data-act="di-reload">Read again</button> + </div> + </div> + ${!d || d.loading ? html`<div class="panel"><div class="empty"><div class="spin" style="margin:0"></div><span>Reading …</span></div></div>` + : d.error ? html`<div class="banner">${svg(I.warn)}<span>${d.error}</span></div>` + : html`<pre class="panel" style="white-space:pre-wrap;word-break:break-all;font-size:12px;max-height:60vh;overflow:auto;margin:0">${d.text}</pre>`} + </section>`; + } +}); + +afterSystemPage('deviceinfo', () => { + if (!S.devinfo || S.devinfo.full !== !!S.devinfoFull) loadDeviceinfo(); + $('#di-full')?.addEventListener('change', (e) => { S.devinfoFull = e.target.checked; loadDeviceinfo(); }); +}); + +Object.assign(ACTIONS, { + 'di-reload'() { loadDeviceinfo(); }, + 'di-download'() { + if (!S.devinfo?.text) return; + const a = document.createElement('a'); + a.href = URL.createObjectURL(new Blob([S.devinfo.text], { type: 'text/plain' })); + a.download = deviceinfoFile(); + document.body.append(a); a.click(); a.remove(); + setTimeout(() => URL.revokeObjectURL(a.href), 5000); + }, + async 'di-copy'() { + try { await navigator.clipboard.writeText(S.devinfo?.text || ''); toast('Copied.'); } + catch (e) { toast('Copying is not allowed here – use Download.', true); } + } +}); diff --git a/src/shareos-core/parts/web/layout.js b/src/shareos-core/parts/web/layout.js index 379aac91..b1f56186 100644 --- a/src/shareos-core/parts/web/layout.js +++ b/src/shareos-core/parts/web/layout.js @@ -272,9 +272,11 @@ function renderTabs() { // the page of an address (#/tab/sub); hash: an address other than the current one function routeOf(hash) { - const [tab, sub, id] = routeParts(hash); + let [tab, sub, id] = routeParts(hash); + // pages of System that are not in its menu, also under their own address (#/deviceinfo) + if (SYS_HIDDEN.includes(tab)) [tab, sub] = ['system', tab]; const r = { tab: TABS.some((t) => t[0] === tab) && tabOn(tab) ? tab : 'overview', sub: SUB_MOVED[sub] || sub || '' }; - if (r.tab === 'system' && !SYS_SUBS.some((x) => x[0] === r.sub)) r.sub = 'general'; + if (r.tab === 'system' && !SYS_SUBS.some((x) => x[0] === r.sub) && !SYS_HIDDEN.includes(r.sub)) r.sub = 'general'; if (r.tab === 'services' && !SVC_SUBS.some((x) => x[0] === r.sub)) r.sub = 'status'; if (r.tab === 'shares' && !SHR_SUBS.some((x) => x[0] === r.sub)) r.sub = 'shares'; if (r.tab === 'storage' && !STO_SUBS.some((x) => x[0] === r.sub)) r.sub = 'volumes'; diff --git a/src/shareos-core/parts/web/overview.js b/src/shareos-core/parts/web/overview.js index 72859a4a..20dfd006 100644 --- a/src/shareos-core/parts/web/overview.js +++ b/src/shareos-core/parts/web/overview.js @@ -71,7 +71,7 @@ const VIEWS = { const e = i.network?.eth0 || {}; const bootTxt = { flash: 'Flash (UBI)', netroot: 'Network (RAM)', ram: 'RAM' }[i.boot] || i.boot; const svcUp = S.services ? S.services.filter((x) => x.running).length : null; - return html` + return html`${devtestBanner()} <section class="sec" data-part="load"> <h2 class="gh">SYSTEM <span>live · every 5 s · temperature up to 15 s old</span></h2> <div class="g2"> diff --git a/src/shareos-core/usr/sbin/shareos-notify b/src/shareos-core/usr/sbin/shareos-notify index 33e923cb..7bfc08bd 100755 --- a/src/shareos-core/usr/sbin/shareos-notify +++ b/src/shareos-core/usr/sbin/shareos-notify @@ -424,11 +424,21 @@ function check_update() { 'Unter System → Firmware installieren.', 'Install it under System → Firmware.'); } +// a box of a model that is being added (BOARD_DEVTEST, board.sh): a reminder +// that root keeps "shareos" and where the device info is (also for the desktop +// view, which has no overview banner) +function check_devtest() { + if (match(readfile(ROOT + '/tmp/sys/board.env') ?? '', /(^|\n)BOARD_DEVTEST="?1"?/)) + cmd_send('info', 'system', 'devtest', 'Testimage für ein neues Modell', 'Test image for a new model', + 'root behält das Passwort shareos – die Box nur im eigenen Netz nutzen. Bitte die Geräteinfo schicken: http://<Box>/deviceinfo', + 'root keeps the password shareos – use the box only in your own network. Please send the device info: http://<box>/deviceinfo'); +} + function cmd_check() { let n = conf().n; // the output of the single sends is not wanted here QUIET = true; - check_raid(); check_volumes(n); check_temp(n); check_smart(); check_update(); + check_raid(); check_volumes(n); check_temp(n); check_smart(); check_update(); check_devtest(); QUIET = false; out({ ok: true }); } diff --git a/src/shareos-core/usr/share/rpcd/acl.d/shareos.json b/src/shareos-core/usr/share/rpcd/acl.d/shareos.json index 8348c441..905d3ea2 100644 --- a/src/shareos-core/usr/share/rpcd/acl.d/shareos.json +++ b/src/shareos-core/usr/share/rpcd/acl.d/shareos.json @@ -130,6 +130,9 @@ "shareos.migrate": [ "plan", "state" + ], + "shareos.deviceinfo": [ + "get" ] } }, diff --git a/src/shareos-core/www/desktop.js b/src/shareos-core/www/desktop.js index 238b9406..11fec5fe 100644 --- a/src/shareos-core/www/desktop.js +++ b/src/shareos-core/www/desktop.js @@ -148,6 +148,8 @@ async function deskRun() { } S.desk = true; stopPolling(); + // a page that is only reached by its address (#/deviceinfo) opens as a window + const hidden = SYS_HIDDEN.includes(routeParts()[0]) ? location.hash : ''; if (location.hash) history.replaceState(null, '', location.pathname + location.search); D.ac?.abort(); D.ac = new AbortController(); @@ -193,6 +195,7 @@ async function deskRun() { const [desk] = await Promise.all([rpc('shareos.me', 'desk_get').then((r) => r.desk).catch(() => ({})), dkLoadApps()]); dkRestore(desk || {}); D.loaded = true; + if (hidden && !isUser()) dkOpenPage(routeOf(hidden)); dkTick(); D.timers.push(setInterval(dkTick, 5000)); D.timers.push(setInterval(dkBehind, 1500)); diff --git a/src/shareos-core/www/deviceinfo/index.html b/src/shareos-core/www/deviceinfo/index.html new file mode 100644 index 00000000..69b63221 --- /dev/null +++ b/src/shareos-core/www/deviceinfo/index.html @@ -0,0 +1,4 @@ +<!DOCTYPE html> +<html lang="en"><head><meta charset="utf-8"><title>ShareOS – device info + +Device info diff --git a/src/shareos-core/www/i18n/ar.json b/src/shareos-core/www/i18n/ar.json index dc102d57..dc8701c0 100644 --- a/src/shareos-core/www/i18n/ar.json +++ b/src/shareos-core/www/i18n/ar.json @@ -1783,7 +1783,16 @@ "a move is already running": "هناك نقل قيد التشغيل بالفعل", "a copy in Files, a cloud job, a snapshot or Paperless is still running – wait until it is done": "لا يزال نسخ في Files أو مهمة سحابية أو لقطة أو Paperless قيد التشغيل – انتظر حتى ينتهي", "switching stopped before it was done – start it again, or restart the box": "توقف التبديل قبل اكتماله – ابدأه مرة أخرى أو أعد تشغيل الجهاز", - "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: لا تزال المرشحات ذات الإجراء Watch dir تشير إلى مجلد التسليم على المحرك القديم – غيّره في autobrr إلى المجلد على المحرك الجديد." + "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: لا تزال المرشحات ذات الإجراء Watch dir تشير إلى مجلد التسليم على المحرك القديم – غيّره في autobrr إلى المجلد على المحرك الجديد.", + "Test image for a new model.": "صورة اختبار لطراز جديد.", + "root keeps the password shareos – use the box only in your own network. Please send the device info:": "يحتفظ root بكلمة المرور shareos – استخدم الجهاز في شبكتك فقط. يرجى إرسال معلومات الجهاز:", + "Device info": "معلومات الجهاز", + "Reading …": "جارٍ القراءة …", + "DEVICE INFO": "معلومات الجهاز", + "hardware facts for adding a model": "بيانات العتاد لإضافة طراز", + "Copying is not allowed here – use Download.": "النسخ غير مسموح هنا – استخدم التنزيل.", + "Model, flash partitions, CPU, memory, LEDs, sensors, buttons, GPIOs, serial ports, network, the U-Boot environment and the kernel log of this box – everything a new model needs. Only read, nothing is changed. Attach the file to the issue of the model.": "الطراز وأقسام الذاكرة الوميضية والمعالج والذاكرة والمصابيح والمستشعرات والأزرار ومنافذ GPIO والمنافذ التسلسلية والشبكة وبيئة U-Boot وسجل النواة لهذا الجهاز – كل ما يحتاجه طراز جديد. قراءة فقط، لا يتغير شيء. أرفق الملف بتذكرة الطراز.", + "Show MAC addresses and serial numbers (otherwise masked – keep them out of public issues)": "إظهار عناوين MAC والأرقام التسلسلية (وإلا فهي مخفية – لا تضعها في التذاكر العامة)" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/bn.json b/src/shareos-core/www/i18n/bn.json index 2827b82d..9ba88bf7 100644 --- a/src/shareos-core/www/i18n/bn.json +++ b/src/shareos-core/www/i18n/bn.json @@ -1783,7 +1783,16 @@ "a move is already running": "একটি সরানো ইতিমধ্যে চলছে", "a copy in Files, a cloud job, a snapshot or Paperless is still running – wait until it is done": "Files-এ কপি, ক্লাউড কাজ, স্ন্যাপশট বা Paperless এখনও চলছে – শেষ হওয়া পর্যন্ত অপেক্ষা করুন", "switching stopped before it was done – start it again, or restart the box": "বদল শেষ হওয়ার আগেই থেমে গেছে – আবার শুরু করুন বা বক্স আবার চালু করুন", - "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: Watch dir কাজের ফিল্টার এখনও পুরনো ড্রাইভের হস্তান্তর ফোল্ডার দেখায় – autobrr-এ এটিকে নতুন ড্রাইভের ফোল্ডারে বদলান।" + "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: Watch dir কাজের ফিল্টার এখনও পুরনো ড্রাইভের হস্তান্তর ফোল্ডার দেখায় – autobrr-এ এটিকে নতুন ড্রাইভের ফোল্ডারে বদলান।", + "Test image for a new model.": "নতুন মডেলের জন্য টেস্ট ইমেজ।", + "root keeps the password shareos – use the box only in your own network. Please send the device info:": "root-এর পাসওয়ার্ড shareos-ই থাকে – বক্সটি কেবল নিজের নেটওয়ার্কে ব্যবহার করুন। অনুগ্রহ করে ডিভাইসের তথ্য পাঠান:", + "Device info": "ডিভাইসের তথ্য", + "Reading …": "পড়া হচ্ছে …", + "DEVICE INFO": "ডিভাইসের তথ্য", + "hardware facts for adding a model": "মডেল যোগ করার জন্য হার্ডওয়্যারের তথ্য", + "Copying is not allowed here – use Download.": "এখানে কপি করার অনুমতি নেই – ডাউনলোড ব্যবহার করুন।", + "Model, flash partitions, CPU, memory, LEDs, sensors, buttons, GPIOs, serial ports, network, the U-Boot environment and the kernel log of this box – everything a new model needs. Only read, nothing is changed. Attach the file to the issue of the model.": "এই বক্সের মডেল, ফ্ল্যাশ পার্টিশন, CPU, মেমরি, LED, সেন্সর, বোতাম, GPIO, সিরিয়াল পোর্ট, নেটওয়ার্ক, U-Boot এনভায়রনমেন্ট ও কার্নেল লগ – নতুন মডেলের যা দরকার সব। কেবল পড়া হয়, কিছু বদলায় না। ফাইলটি মডেলের issue-তে সংযুক্ত করুন।", + "Show MAC addresses and serial numbers (otherwise masked – keep them out of public issues)": "MAC ঠিকানা ও সিরিয়াল নম্বর দেখান (নইলে লুকানো – সর্বজনীন issue-তে দেবেন না)" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/de.json b/src/shareos-core/www/i18n/de.json index b683a748..7029cbf1 100644 --- a/src/shareos-core/www/i18n/de.json +++ b/src/shareos-core/www/i18n/de.json @@ -1783,7 +1783,16 @@ "a move is already running": "ein Umzug läuft bereits", "a copy in Files, a cloud job, a snapshot or Paperless is still running – wait until it is done": "eine Kopie in Files, ein Cloud-Auftrag, ein Snapshot oder Paperless läuft noch – warte, bis er fertig ist", "switching stopped before it was done – start it again, or restart the box": "das Umschalten hat vor dem Ende aufgehört – starte es noch einmal oder starte die Box neu", - "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: Filter mit der Aktion Watch dir nennen noch den Übergabeordner auf dem alten Laufwerk – ändere ihn in autobrr auf den Ordner auf dem neuen Laufwerk." + "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: Filter mit der Aktion Watch dir nennen noch den Übergabeordner auf dem alten Laufwerk – ändere ihn in autobrr auf den Ordner auf dem neuen Laufwerk.", + "Test image for a new model.": "Testimage für ein neues Modell.", + "root keeps the password shareos – use the box only in your own network. Please send the device info:": "root behält das Passwort shareos – nutze die Box nur im eigenen Netz. Bitte schicke die Geräteinfo:", + "Device info": "Geräteinfo", + "Reading …": "Wird gelesen …", + "DEVICE INFO": "GERÄTEINFO", + "hardware facts for adding a model": "Hardware-Angaben zum Hinzufügen eines Modells", + "Copying is not allowed here – use Download.": "Kopieren ist hier nicht erlaubt – nimm Herunterladen.", + "Model, flash partitions, CPU, memory, LEDs, sensors, buttons, GPIOs, serial ports, network, the U-Boot environment and the kernel log of this box – everything a new model needs. Only read, nothing is changed. Attach the file to the issue of the model.": "Modell, Flash-Partitionen, CPU, Speicher, LEDs, Sensoren, Tasten, GPIOs, serielle Schnittstellen, Netzwerk, die U-Boot-Umgebung und das Kernel-Protokoll dieser Box – alles, was ein neues Modell braucht. Es wird nur gelesen, nichts geändert. Hänge die Datei an das Issue des Modells.", + "Show MAC addresses and serial numbers (otherwise masked – keep them out of public issues)": "MAC-Adressen und Seriennummern zeigen (sonst maskiert – nicht in öffentliche Issues)" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/es.json b/src/shareos-core/www/i18n/es.json index e166c8e6..fa99e5bd 100644 --- a/src/shareos-core/www/i18n/es.json +++ b/src/shareos-core/www/i18n/es.json @@ -1783,7 +1783,16 @@ "a move is already running": "ya hay un traslado en curso", "a copy in Files, a cloud job, a snapshot or Paperless is still running – wait until it is done": "todavía se está ejecutando una copia en Files, una tarea en la nube, una instantánea o Paperless – espera a que termine", "switching stopped before it was done – start it again, or restart the box": "el cambio se detuvo antes de terminar – inícialo de nuevo o reinicia el equipo", - "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: los filtros con la acción Watch dir aún indican la carpeta de entrega en la unidad antigua – cámbiala en autobrr por la carpeta de la unidad nueva." + "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: los filtros con la acción Watch dir aún indican la carpeta de entrega en la unidad antigua – cámbiala en autobrr por la carpeta de la unidad nueva.", + "Test image for a new model.": "Imagen de prueba para un modelo nuevo.", + "root keeps the password shareos – use the box only in your own network. Please send the device info:": "root conserva la contraseña shareos – usa el equipo solo en tu propia red. Envía la información del dispositivo:", + "Device info": "Información del dispositivo", + "Reading …": "Leyendo …", + "DEVICE INFO": "INFORMACIÓN DEL DISPOSITIVO", + "hardware facts for adding a model": "datos de hardware para añadir un modelo", + "Copying is not allowed here – use Download.": "Aquí no se permite copiar – usa Descargar.", + "Model, flash partitions, CPU, memory, LEDs, sensors, buttons, GPIOs, serial ports, network, the U-Boot environment and the kernel log of this box – everything a new model needs. Only read, nothing is changed. Attach the file to the issue of the model.": "Modelo, particiones flash, CPU, memoria, LED, sensores, botones, GPIO, puertos serie, red, el entorno U-Boot y el registro del kernel de este equipo – todo lo que necesita un modelo nuevo. Solo se lee, no se cambia nada. Adjunta el archivo a la incidencia del modelo.", + "Show MAC addresses and serial numbers (otherwise masked – keep them out of public issues)": "Mostrar direcciones MAC y números de serie (si no, ocultos – no los pongas en incidencias públicas)" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/fr.json b/src/shareos-core/www/i18n/fr.json index 7ef0fee2..603b0c97 100644 --- a/src/shareos-core/www/i18n/fr.json +++ b/src/shareos-core/www/i18n/fr.json @@ -1783,7 +1783,16 @@ "a move is already running": "un déménagement est déjà en cours", "a copy in Files, a cloud job, a snapshot or Paperless is still running – wait until it is done": "une copie dans Files, une tâche cloud, un instantané ou Paperless est encore en cours – attendez qu’elle se termine", "switching stopped before it was done – start it again, or restart the box": "le basculement s’est arrêté avant la fin – relancez-le ou redémarrez le boîtier", - "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr : les filtres avec l’action Watch dir indiquent encore le dossier de dépôt sur l’ancien disque – remplacez-le dans autobrr par le dossier du nouveau disque." + "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr : les filtres avec l’action Watch dir indiquent encore le dossier de dépôt sur l’ancien disque – remplacez-le dans autobrr par le dossier du nouveau disque.", + "Test image for a new model.": "Image de test pour un nouveau modèle.", + "root keeps the password shareos – use the box only in your own network. Please send the device info:": "root garde le mot de passe shareos – n’utilisez le boîtier que dans votre propre réseau. Envoyez les infos de l’appareil :", + "Device info": "Infos de l’appareil", + "Reading …": "Lecture …", + "DEVICE INFO": "INFOS DE L’APPAREIL", + "hardware facts for adding a model": "données matérielles pour ajouter un modèle", + "Copying is not allowed here – use Download.": "La copie n’est pas autorisée ici – utilisez Télécharger.", + "Model, flash partitions, CPU, memory, LEDs, sensors, buttons, GPIOs, serial ports, network, the U-Boot environment and the kernel log of this box – everything a new model needs. Only read, nothing is changed. Attach the file to the issue of the model.": "Modèle, partitions flash, CPU, mémoire, LED, capteurs, boutons, GPIO, ports série, réseau, environnement U-Boot et journal du noyau de ce boîtier – tout ce dont un nouveau modèle a besoin. Lecture seule, rien n’est modifié. Joignez le fichier au ticket du modèle.", + "Show MAC addresses and serial numbers (otherwise masked – keep them out of public issues)": "Afficher les adresses MAC et numéros de série (sinon masqués – à garder hors des tickets publics)" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/hi.json b/src/shareos-core/www/i18n/hi.json index 460dc17f..b71e5543 100644 --- a/src/shareos-core/www/i18n/hi.json +++ b/src/shareos-core/www/i18n/hi.json @@ -1783,7 +1783,16 @@ "a move is already running": "एक स्थानांतरण पहले से चल रहा है", "a copy in Files, a cloud job, a snapshot or Paperless is still running – wait until it is done": "Files में कॉपी, क्लाउड कार्य, स्नैपशॉट या Paperless अभी चल रहा है – पूरा होने तक रुकें", "switching stopped before it was done – start it again, or restart the box": "बदलना पूरा होने से पहले रुक गया – इसे फिर से शुरू करें या बॉक्स को फिर से चालू करें", - "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: Watch dir क्रिया वाले फ़िल्टर अभी भी पुरानी ड्राइव पर सौंपने वाले फ़ोल्डर को बताते हैं – autobrr में इसे नई ड्राइव के फ़ोल्डर में बदलें।" + "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: Watch dir क्रिया वाले फ़िल्टर अभी भी पुरानी ड्राइव पर सौंपने वाले फ़ोल्डर को बताते हैं – autobrr में इसे नई ड्राइव के फ़ोल्डर में बदलें।", + "Test image for a new model.": "नए मॉडल के लिए टेस्ट इमेज।", + "root keeps the password shareos – use the box only in your own network. Please send the device info:": "root का पासवर्ड shareos ही रहता है – बॉक्स को केवल अपने नेटवर्क में उपयोग करें। कृपया डिवाइस जानकारी भेजें:", + "Device info": "डिवाइस जानकारी", + "Reading …": "पढ़ा जा रहा है …", + "DEVICE INFO": "डिवाइस जानकारी", + "hardware facts for adding a model": "मॉडल जोड़ने के लिए हार्डवेयर जानकारी", + "Copying is not allowed here – use Download.": "यहाँ कॉपी करने की अनुमति नहीं है – डाउनलोड का उपयोग करें।", + "Model, flash partitions, CPU, memory, LEDs, sensors, buttons, GPIOs, serial ports, network, the U-Boot environment and the kernel log of this box – everything a new model needs. Only read, nothing is changed. Attach the file to the issue of the model.": "इस बॉक्स का मॉडल, फ़्लैश पार्टीशन, CPU, मेमोरी, LED, सेंसर, बटन, GPIO, सीरियल पोर्ट, नेटवर्क, U-Boot एनवायरनमेंट और कर्नेल लॉग – नए मॉडल के लिए आवश्यक सब कुछ। केवल पढ़ा जाता है, कुछ नहीं बदलता। फ़ाइल को मॉडल के issue में संलग्न करें।", + "Show MAC addresses and serial numbers (otherwise masked – keep them out of public issues)": "MAC पते और सीरियल नंबर दिखाएँ (अन्यथा छिपे हुए – इन्हें सार्वजनिक issue में न डालें)" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/pt.json b/src/shareos-core/www/i18n/pt.json index 7a8ea9b7..0e180924 100644 --- a/src/shareos-core/www/i18n/pt.json +++ b/src/shareos-core/www/i18n/pt.json @@ -1783,7 +1783,16 @@ "a move is already running": "já está a decorrer uma mudança", "a copy in Files, a cloud job, a snapshot or Paperless is still running – wait until it is done": "ainda está a decorrer uma cópia em Files, uma tarefa na nuvem, um instantâneo ou o Paperless – aguarde até terminar", "switching stopped before it was done – start it again, or restart the box": "a mudança parou antes de terminar – inicie-a novamente ou reinicie a caixa", - "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: os filtros com a ação Watch dir ainda indicam a pasta de entrega na unidade antiga – altere-a no autobrr para a pasta na nova unidade." + "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: os filtros com a ação Watch dir ainda indicam a pasta de entrega na unidade antiga – altere-a no autobrr para a pasta na nova unidade.", + "Test image for a new model.": "Imagem de teste para um novo modelo.", + "root keeps the password shareos – use the box only in your own network. Please send the device info:": "o root mantém a palavra-passe shareos – use a caixa apenas na sua própria rede. Envie as informações do dispositivo:", + "Device info": "Informações do dispositivo", + "Reading …": "A ler …", + "DEVICE INFO": "INFORMAÇÕES DO DISPOSITIVO", + "hardware facts for adding a model": "dados de hardware para adicionar um modelo", + "Copying is not allowed here – use Download.": "Copiar não é permitido aqui – use Transferir.", + "Model, flash partitions, CPU, memory, LEDs, sensors, buttons, GPIOs, serial ports, network, the U-Boot environment and the kernel log of this box – everything a new model needs. Only read, nothing is changed. Attach the file to the issue of the model.": "Modelo, partições flash, CPU, memória, LEDs, sensores, botões, GPIOs, portas série, rede, o ambiente U-Boot e o registo do kernel desta caixa – tudo o que um novo modelo precisa. Só é lido, nada é alterado. Anexe o ficheiro ao issue do modelo.", + "Show MAC addresses and serial numbers (otherwise masked – keep them out of public issues)": "Mostrar endereços MAC e números de série (caso contrário ocultos – não os coloque em issues públicos)" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/ru.json b/src/shareos-core/www/i18n/ru.json index b4ab2bd2..ad473fee 100644 --- a/src/shareos-core/www/i18n/ru.json +++ b/src/shareos-core/www/i18n/ru.json @@ -1783,7 +1783,16 @@ "a move is already running": "перенос уже выполняется", "a copy in Files, a cloud job, a snapshot or Paperless is still running – wait until it is done": "ещё выполняется копирование в Files, облачное задание, снимок или Paperless – дождитесь завершения", "switching stopped before it was done – start it again, or restart the box": "переключение прервалось до завершения – запустите его снова или перезагрузите устройство", - "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: фильтры с действием Watch dir всё ещё указывают папку передачи на старом диске – измените её в autobrr на папку на новом диске." + "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr: фильтры с действием Watch dir всё ещё указывают папку передачи на старом диске – измените её в autobrr на папку на новом диске.", + "Test image for a new model.": "Тестовый образ для новой модели.", + "root keeps the password shareos – use the box only in your own network. Please send the device info:": "root сохраняет пароль shareos – используйте устройство только в своей сети. Пришлите сведения об устройстве:", + "Device info": "Сведения об устройстве", + "Reading …": "Чтение …", + "DEVICE INFO": "СВЕДЕНИЯ ОБ УСТРОЙСТВЕ", + "hardware facts for adding a model": "данные оборудования для добавления модели", + "Copying is not allowed here – use Download.": "Копирование здесь запрещено – используйте «Скачать».", + "Model, flash partitions, CPU, memory, LEDs, sensors, buttons, GPIOs, serial ports, network, the U-Boot environment and the kernel log of this box – everything a new model needs. Only read, nothing is changed. Attach the file to the issue of the model.": "Модель, разделы флеш-памяти, процессор, память, светодиоды, датчики, кнопки, GPIO, последовательные порты, сеть, окружение U-Boot и журнал ядра этого устройства – всё, что нужно для новой модели. Только чтение, ничего не меняется. Приложите файл к issue модели.", + "Show MAC addresses and serial numbers (otherwise masked – keep them out of public issues)": "Показать MAC-адреса и серийные номера (иначе скрыты – не публикуйте их в открытых issue)" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/zh.json b/src/shareos-core/www/i18n/zh.json index 738baae0..1113457a 100644 --- a/src/shareos-core/www/i18n/zh.json +++ b/src/shareos-core/www/i18n/zh.json @@ -1783,7 +1783,16 @@ "a move is already running": "迁移已在进行中", "a copy in Files, a cloud job, a snapshot or Paperless is still running – wait until it is done": "Files 中的复制、云任务、快照或 Paperless 仍在运行 – 请等待其完成", "switching stopped before it was done – start it again, or restart the box": "切换在完成前中断 – 请重新开始,或重启设备", - "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr:使用 Watch dir 操作的过滤器仍指向旧驱动器上的交接文件夹 – 请在 autobrr 中将其改为新驱动器上的文件夹。" + "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.": "autobrr:使用 Watch dir 操作的过滤器仍指向旧驱动器上的交接文件夹 – 请在 autobrr 中将其改为新驱动器上的文件夹。", + "Test image for a new model.": "新型号的测试镜像。", + "root keeps the password shareos – use the box only in your own network. Please send the device info:": "root 保留密码 shareos – 请仅在自己的网络中使用此设备。请发送设备信息:", + "Device info": "设备信息", + "Reading …": "正在读取 …", + "DEVICE INFO": "设备信息", + "hardware facts for adding a model": "用于添加型号的硬件信息", + "Copying is not allowed here – use Download.": "此处不允许复制 – 请使用下载。", + "Model, flash partitions, CPU, memory, LEDs, sensors, buttons, GPIOs, serial ports, network, the U-Boot environment and the kernel log of this box – everything a new model needs. Only read, nothing is changed. Attach the file to the issue of the model.": "此设备的型号、闪存分区、CPU、内存、LED、传感器、按键、GPIO、串口、网络、U-Boot 环境和内核日志 – 新型号所需的一切。只读取,不做任何更改。请将文件附加到该型号的 issue。", + "Show MAC addresses and serial numbers (otherwise masked – keep them out of public issues)": "显示 MAC 地址和序列号(否则已遮盖 – 请勿放入公开 issue)" }, "patterns": [ [ diff --git a/tests/mock-ubus.py b/tests/mock-ubus.py index 09bf807f..cbd43db8 100644 --- a/tests/mock-ubus.py +++ b/tests/mock-ubus.py @@ -88,7 +88,7 @@ def info(): return { 'model': 'D-Link DNS-320L-rev-Ax NAS', 'hostname': 'skynet-nas', 'kernel': '6.18.58', 'boot': 'flash', 'release': {'version': '0.1.0-beta.1', 'board': 'dns320l', 'fwname': 'DNS-320L-rev-Ax', 'stage': 'beta'}, - 'board': {'id': 'dns320l', 'name': 'D-Link DNS-320L rev A', 'fwname': 'DNS-320L-rev-Ax', 'tested': True}, + 'board': {'id': 'dns320l', 'name': 'D-Link DNS-320L rev A', 'fwname': 'DNS-320L-rev-Ax', 'tested': True, 'devtest': bool(os.environ.get('MOCK_DEVTEST'))}, 'time': int(time.time()), 'uptime': up, 'load': [0.42, 0.38, 0.35], 'cpu': {'total': int(up * 100), 'idle': int(up * 85)}, 'memory': {'memtotal': 253092 * 1024, 'memavailable': 160000 * 1024}, @@ -629,6 +629,12 @@ def call(obj, method, args): if method == 'rescan': d['scanning'] = True return d + if obj == 'shareos.deviceinfo': + # MOCK_DEVTEST=1: a box of a model that is being added (banner on the overview) + mac = '00:50:43:12:ab:cd' if args.get('full') else 'xx:xx:xx:xx:ab:cd' + return {'full': bool(args.get('full')), 'devtest': bool(os.environ.get('MOCK_DEVTEST')), 'fwname': 'DNS-320L-rev-Ax', + 'text': 'ShareOS device info\n\n### device-tree model\nD-Link DNS-320L-rev-Ax NAS\n\n### flash partitions (/proc/mtd)\n' + 'dev: size erasesize name\nmtd0: 00100000 00020000 "u-boot"\n\n### network interfaces\neth0: address=' + mac + '\n'} if obj == 'shareos.migrate': # disk change: a copy that advances with every state call, a switch that is done at once mg = STATE.setdefault('mig', {'state': 'none'}) diff --git a/tests/test-boards.sh b/tests/test-boards.sh index 2abf4eb4..460058c9 100755 --- a/tests/test-boards.sh +++ b/tests/test-boards.sh @@ -44,6 +44,39 @@ check "boardinfo prints all keys" "[ \$(info | grep -c '^BOARD_') -ge 16 ] && in box "D-Link DNS-325 NAS (Rev A1)" check "only the DNS-320L counts as tested" "[ \"\$(info tested)\" = 0 ]" +# --- devtest: a model that is being added, and an unknown one +check "known models are no devtest" "[ \"\$(info devtest)\" = 0 ] && info | grep -qx 'BOARD_DEVTEST=\"0\"'" +box "Some other NAS" +check "an unknown model counts as devtest" "[ \"\$(info devtest)\" = 1 ]" +# S03claim leaves root alone on a devtest box +cl() { # model -> root hash after S03claim (fake /etc, /overlay) + box "$1"; mkdir -p $T/c/etc $T/c/overlay; : > $T/c/overlay/claim + h=$(openssl passwd -1 -salt abcdefgh shareos); echo "root:$h:19000:0:99999:7:::" > $T/c/shadow + sed -e "s|/proc/cmdline|$T/c/cmdline|; s|/overlay/claim|$T/c/overlay/claim|g; s|/etc/shadow|$T/c/shadow|g" $O/etc/init.d/S03claim > $T/c/S03claim + printf '#!/bin/sh\nexec sh %s "$@"\n' $O/usr/sbin/shareos-boardinfo > $S/shareos-boardinfo + printf '#!/bin/sh\n[ "$1" = -P ] && { read -r p <&0; openssl passwd -1 -salt abcdefgh "$p"; }\n' > $S/mkpasswd; chmod 755 $S/* + : > $T/c/cmdline; sh $T/c/S03claim start; cut -d: -f2 $T/c/shadow +} +if command -v openssl >/dev/null; then + check "S03claim: a new DNS-320L gets root locked" "[ \"\$(cl 'D-Link DNS-320L-rev-Ax NAS')\" = '!' ]" + check "S03claim: a devtest box keeps root / shareos" "case \"\$(cl 'Some other NAS')\" in '\$1\$'*) true ;; *) false ;; esac" +fi + +# --- shareos-deviceinfo: masked for public issues, --full on request +D=$O/usr/sbin/shareos-deviceinfo +box "D-Link DNR-322L"; mkdir -p $SHAREOS_ROOT/sys/class/net/eth0 $SHAREOS_ROOT/dev $SHAREOS_ROOT/sys/class/leds/dnr:blue:power +echo "[none] timer heartbeat" > "$SHAREOS_ROOT/sys/class/leds/dnr:blue:power/trigger" +echo 00:50:43:12:ab:cd > $SHAREOS_ROOT/sys/class/net/eth0/address +printf 'Processor\t: Feroceon 88FR131 rev 1 (v5l)\nSerial\t\t: 1234567890abcdef\n' > $SHAREOS_ROOT/proc/cpuinfo +printf 'dev: size erasesize name\nmtd0: 00100000 00020000 "u-boot"\nmtd1: 00020000 00020000 "u-boot-env"\n' > $SHAREOS_ROOT/proc/mtd +printf 'ABCDbootcmd=nand read 0xa00000 0x100000 0x300000\0ethaddr=00:50:43:12:ab:cd\0serialno=XYZ123456\0\0' > $SHAREOS_ROOT/dev/mtd1 +printf 'console=ttyS0,115200\0' > $SHAREOS_ROOT/proc/cmdline +printf '#!/bin/sh\necho "[ 0.000] Booting Linux, MAC 00:50:43:12:ab:cd"\n' > $S/dmesg; chmod 755 $S/dmesg +sh $D > $T/di.txt 2>&1; sh $D --full > $T/full.txt 2>&1 +check "deviceinfo: model, flash, U-Boot environment, LEDs, kernel log" "grep -q 'DNR-322L' $T/di.txt && grep -q 'u-boot-env' $T/di.txt && grep -q 'bootcmd=nand read' $T/di.txt && grep -q 'dnr:blue:power: none' $T/di.txt && grep -q 'Booting Linux' $T/di.txt" +check "deviceinfo: MAC addresses and serial numbers masked by default" "! grep -qi '00:50:43:12:ab:cd\\|XYZ123456\\|1234567890abcdef' $T/di.txt && grep -q 'xx:xx:xx:xx:ab:cd' $T/di.txt && grep -q 'serialno=(masked)' $T/di.txt" +check "deviceinfo --full: everything as it is" "grep -q 'ethaddr=00:50:43:12:ab:cd' $T/full.txt && grep -q 'serialno=XYZ123456' $T/full.txt && grep -q 'NOT MASKED' $T/full.txt" + # --- LEDs box "D-Link DNS-320L-rev-Ax NAS"; leds dns320l:blue:usb dns320l:red:sata0 dns320l:red:sata1; mkdir -p $SHAREOS_ROOT/tmp/sys/power_led sh $O/usr/sbin/shareos-leds diff --git a/tests/test-notify.sh b/tests/test-notify.sh index d6168fab..1a8f2951 100755 --- a/tests/test-notify.sh +++ b/tests/test-notify.sh @@ -62,6 +62,11 @@ check "check: degraded RAID is an error" "echo '$L' | js \"any(x['key']=='raid-m check "check: missing volume, temperature, SMART, update" "echo '$L' | js \"{'vol-missing-daten','temp','smart-sdb','update-0.1.0-beta.9'} <= {x['key'] for x in d['items']}\"" "$L" N check >/dev/null check "check again: no duplicates" "N list | js \"len(d['items'])==5\"" +printf 'BOARD_ID="unknown"\nBOARD_DEVTEST="1"\n' > "$R/tmp/sys/board.env" +N check >/dev/null +check "check: a devtest box gets the reminder with the device info" "N list | js \"any(x['key']=='devtest' and x['level']=='info' and 'deviceinfo' in x['text_en'] for x in d['items'])\"" +N delete "$(N list | python3 -c 'import json,sys; print([x["id"] for x in json.load(sys.stdin)["items"] if x["key"]=="devtest"][0])')" >/dev/null; rm "$R/tmp/sys/board.env" +check "the reminder removed again, the other messages stay" "N list | js \"len(d['items'])==5\"" printf 'md0 : active raid1 sdb2[1] sda2[0]\n 3906886464 blocks super 1.2 [2/2] [UU]\n' > "$R/proc/mdstat" echo 40000 > "$R/tmp/sys/temp1_input" N check >/dev/null diff --git a/tests/ui-desktop.js b/tests/ui-desktop.js index 74bb8614..24ac642b 100644 --- a/tests/ui-desktop.js +++ b/tests/ui-desktop.js @@ -82,7 +82,7 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); check('window: the area itself, no frame', await p.locator(win('storage') + ' iframe').count() === 0 && await p.locator(win('storage') + ' .dk-view .sec').count() > 0); check('window: no header, tabs or footer of the page', await p.locator('#hd, #tabs, #ft, #main').count() === 0); const bar = await p.$$eval(win('storage') + ' .subtabs a', (l) => l.map((x) => x.getAttribute('href'))); - check('window: parts of the area as a bar', bar.join() === '#/storage/volumes,#/storage/health,#/storage/snapshots', bar.join()); + check('window: parts of the area as a bar', bar.join() === '#/storage/volumes,#/storage/health,#/storage/snapshots,#/storage/move', bar.join()); check('taskbar: window listed', await p.locator('.dk-tw[data-task="storage"]').count() === 1); // a part of the area: the same window shows it await p.click(win('storage') + ' .subtabs a[href="#/storage/health"]'); @@ -295,7 +295,7 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); await p.waitForSelector('#main .subtabs a.on[href="#/storage/volumes"]'); await p.click('#main .subtabs a[href="#/storage/health"]'); await p.waitForSelector('#main .subtabs a.on[href="#/storage/health"]'); - check('classic: tabs and parts change the page', await p.evaluate(() => location.hash) === '#/storage/health' && await p.locator('#main .subtabs a').count() === 3); + check('classic: tabs and parts change the page', await p.evaluate(() => location.hash) === '#/storage/health' && await p.locator('#main .subtabs a').count() === 4); await p.click('#tabs a[href="#/overview"]'); await p.waitForSelector('#main .mbars'); check('classic: overview with all its sections', await p.locator('#main .sec[data-part]').count() === 4); diff --git a/tools/i18n/ar.tsv b/tools/i18n/ar.tsv index 7f4250f4..1d426c9f 100644 --- a/tools/i18n/ar.tsv +++ b/tools/i18n/ar.tsv @@ -2244,3 +2244,12 @@ P400 المحرك $1 غير موصول E1798 لا يزال نسخ في Files أو مهمة سحابية أو لقطة أو Paperless قيد التشغيل – انتظر حتى ينتهي E1799 توقف التبديل قبل اكتماله – ابدأه مرة أخرى أو أعد تشغيل الجهاز E1800 autobrr: لا تزال المرشحات ذات الإجراء Watch dir تشير إلى مجلد التسليم على المحرك القديم – غيّره في autobrr إلى المجلد على المحرك الجديد. +E1801 صورة اختبار لطراز جديد. +E1802 يحتفظ root بكلمة المرور shareos – استخدم الجهاز في شبكتك فقط. يرجى إرسال معلومات الجهاز: +E1803 معلومات الجهاز +E1804 جارٍ القراءة … +E1805 معلومات الجهاز +E1806 بيانات العتاد لإضافة طراز +E1807 النسخ غير مسموح هنا – استخدم التنزيل. +E1808 الطراز وأقسام الذاكرة الوميضية والمعالج والذاكرة والمصابيح والمستشعرات والأزرار ومنافذ GPIO والمنافذ التسلسلية والشبكة وبيئة U-Boot وسجل النواة لهذا الجهاز – كل ما يحتاجه طراز جديد. قراءة فقط، لا يتغير شيء. أرفق الملف بتذكرة الطراز. +E1809 إظهار عناوين MAC والأرقام التسلسلية (وإلا فهي مخفية – لا تضعها في التذاكر العامة) diff --git a/tools/i18n/bn.tsv b/tools/i18n/bn.tsv index 0bdb1b10..51dc7cde 100644 --- a/tools/i18n/bn.tsv +++ b/tools/i18n/bn.tsv @@ -2244,3 +2244,12 @@ P400 ড্রাইভ $1 মাউন্ট করা নেই E1798 Files-এ কপি, ক্লাউড কাজ, স্ন্যাপশট বা Paperless এখনও চলছে – শেষ হওয়া পর্যন্ত অপেক্ষা করুন E1799 বদল শেষ হওয়ার আগেই থেমে গেছে – আবার শুরু করুন বা বক্স আবার চালু করুন E1800 autobrr: Watch dir কাজের ফিল্টার এখনও পুরনো ড্রাইভের হস্তান্তর ফোল্ডার দেখায় – autobrr-এ এটিকে নতুন ড্রাইভের ফোল্ডারে বদলান। +E1801 নতুন মডেলের জন্য টেস্ট ইমেজ। +E1802 root-এর পাসওয়ার্ড shareos-ই থাকে – বক্সটি কেবল নিজের নেটওয়ার্কে ব্যবহার করুন। অনুগ্রহ করে ডিভাইসের তথ্য পাঠান: +E1803 ডিভাইসের তথ্য +E1804 পড়া হচ্ছে … +E1805 ডিভাইসের তথ্য +E1806 মডেল যোগ করার জন্য হার্ডওয়্যারের তথ্য +E1807 এখানে কপি করার অনুমতি নেই – ডাউনলোড ব্যবহার করুন। +E1808 এই বক্সের মডেল, ফ্ল্যাশ পার্টিশন, CPU, মেমরি, LED, সেন্সর, বোতাম, GPIO, সিরিয়াল পোর্ট, নেটওয়ার্ক, U-Boot এনভায়রনমেন্ট ও কার্নেল লগ – নতুন মডেলের যা দরকার সব। কেবল পড়া হয়, কিছু বদলায় না। ফাইলটি মডেলের issue-তে সংযুক্ত করুন। +E1809 MAC ঠিকানা ও সিরিয়াল নম্বর দেখান (নইলে লুকানো – সর্বজনীন issue-তে দেবেন না) diff --git a/tools/i18n/catalog.json b/tools/i18n/catalog.json index c2539b3f..5c2981d3 100644 --- a/tools/i18n/catalog.json +++ b/tools/i18n/catalog.json @@ -1801,7 +1801,16 @@ "a move is already running", "a copy in Files, a cloud job, a snapshot or Paperless is still running – wait until it is done", "switching stopped before it was done – start it again, or restart the box", - "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive." + "autobrr: filters with the action Watch dir still name the hand-over folder on the old drive – change it in autobrr to the folder on the new drive.", + "Test image for a new model.", + "root keeps the password shareos – use the box only in your own network. Please send the device info:", + "Device info", + "Reading …", + "DEVICE INFO", + "hardware facts for adding a model", + "Copying is not allowed here – use Download.", + "Model, flash partitions, CPU, memory, LEDs, sensors, buttons, GPIOs, serial ports, network, the U-Boot environment and the kernel log of this box – everything a new model needs. Only read, nothing is changed. Attach the file to the issue of the model.", + "Show MAC addresses and serial numbers (otherwise masked – keep them out of public issues)" ], "patterns": [ [ diff --git a/tools/i18n/de.tsv b/tools/i18n/de.tsv index 7636c3e4..b60ac1b2 100644 --- a/tools/i18n/de.tsv +++ b/tools/i18n/de.tsv @@ -2228,3 +2228,12 @@ P400 Laufwerk $1 ist nicht eingehängt E1798 eine Kopie in Files, ein Cloud-Auftrag, ein Snapshot oder Paperless läuft noch – warte, bis er fertig ist E1799 das Umschalten hat vor dem Ende aufgehört – starte es noch einmal oder starte die Box neu E1800 autobrr: Filter mit der Aktion Watch dir nennen noch den Übergabeordner auf dem alten Laufwerk – ändere ihn in autobrr auf den Ordner auf dem neuen Laufwerk. +E1801 Testimage für ein neues Modell. +E1802 root behält das Passwort shareos – nutze die Box nur im eigenen Netz. Bitte schicke die Geräteinfo: +E1803 Geräteinfo +E1804 Wird gelesen … +E1805 GERÄTEINFO +E1806 Hardware-Angaben zum Hinzufügen eines Modells +E1807 Kopieren ist hier nicht erlaubt – nimm Herunterladen. +E1808 Modell, Flash-Partitionen, CPU, Speicher, LEDs, Sensoren, Tasten, GPIOs, serielle Schnittstellen, Netzwerk, die U-Boot-Umgebung und das Kernel-Protokoll dieser Box – alles, was ein neues Modell braucht. Es wird nur gelesen, nichts geändert. Hänge die Datei an das Issue des Modells. +E1809 MAC-Adressen und Seriennummern zeigen (sonst maskiert – nicht in öffentliche Issues) diff --git a/tools/i18n/es.tsv b/tools/i18n/es.tsv index 93f531b2..c8fcae03 100644 --- a/tools/i18n/es.tsv +++ b/tools/i18n/es.tsv @@ -2244,3 +2244,12 @@ P400 la unidad $1 no está montada E1798 todavía se está ejecutando una copia en Files, una tarea en la nube, una instantánea o Paperless – espera a que termine E1799 el cambio se detuvo antes de terminar – inícialo de nuevo o reinicia el equipo E1800 autobrr: los filtros con la acción Watch dir aún indican la carpeta de entrega en la unidad antigua – cámbiala en autobrr por la carpeta de la unidad nueva. +E1801 Imagen de prueba para un modelo nuevo. +E1802 root conserva la contraseña shareos – usa el equipo solo en tu propia red. Envía la información del dispositivo: +E1803 Información del dispositivo +E1804 Leyendo … +E1805 INFORMACIÓN DEL DISPOSITIVO +E1806 datos de hardware para añadir un modelo +E1807 Aquí no se permite copiar – usa Descargar. +E1808 Modelo, particiones flash, CPU, memoria, LED, sensores, botones, GPIO, puertos serie, red, el entorno U-Boot y el registro del kernel de este equipo – todo lo que necesita un modelo nuevo. Solo se lee, no se cambia nada. Adjunta el archivo a la incidencia del modelo. +E1809 Mostrar direcciones MAC y números de serie (si no, ocultos – no los pongas en incidencias públicas) diff --git a/tools/i18n/fr.tsv b/tools/i18n/fr.tsv index 8829398b..71a10426 100644 --- a/tools/i18n/fr.tsv +++ b/tools/i18n/fr.tsv @@ -2244,3 +2244,12 @@ P400 le disque $1 n’est pas monté E1798 une copie dans Files, une tâche cloud, un instantané ou Paperless est encore en cours – attendez qu’elle se termine E1799 le basculement s’est arrêté avant la fin – relancez-le ou redémarrez le boîtier E1800 autobrr : les filtres avec l’action Watch dir indiquent encore le dossier de dépôt sur l’ancien disque – remplacez-le dans autobrr par le dossier du nouveau disque. +E1801 Image de test pour un nouveau modèle. +E1802 root garde le mot de passe shareos – n’utilisez le boîtier que dans votre propre réseau. Envoyez les infos de l’appareil : +E1803 Infos de l’appareil +E1804 Lecture … +E1805 INFOS DE L’APPAREIL +E1806 données matérielles pour ajouter un modèle +E1807 La copie n’est pas autorisée ici – utilisez Télécharger. +E1808 Modèle, partitions flash, CPU, mémoire, LED, capteurs, boutons, GPIO, ports série, réseau, environnement U-Boot et journal du noyau de ce boîtier – tout ce dont un nouveau modèle a besoin. Lecture seule, rien n’est modifié. Joignez le fichier au ticket du modèle. +E1809 Afficher les adresses MAC et numéros de série (sinon masqués – à garder hors des tickets publics) diff --git a/tools/i18n/hi.tsv b/tools/i18n/hi.tsv index a7a7b360..834b644e 100644 --- a/tools/i18n/hi.tsv +++ b/tools/i18n/hi.tsv @@ -2244,3 +2244,12 @@ P400 ड्राइव $1 माउंट नहीं है E1798 Files में कॉपी, क्लाउड कार्य, स्नैपशॉट या Paperless अभी चल रहा है – पूरा होने तक रुकें E1799 बदलना पूरा होने से पहले रुक गया – इसे फिर से शुरू करें या बॉक्स को फिर से चालू करें E1800 autobrr: Watch dir क्रिया वाले फ़िल्टर अभी भी पुरानी ड्राइव पर सौंपने वाले फ़ोल्डर को बताते हैं – autobrr में इसे नई ड्राइव के फ़ोल्डर में बदलें। +E1801 नए मॉडल के लिए टेस्ट इमेज। +E1802 root का पासवर्ड shareos ही रहता है – बॉक्स को केवल अपने नेटवर्क में उपयोग करें। कृपया डिवाइस जानकारी भेजें: +E1803 डिवाइस जानकारी +E1804 पढ़ा जा रहा है … +E1805 डिवाइस जानकारी +E1806 मॉडल जोड़ने के लिए हार्डवेयर जानकारी +E1807 यहाँ कॉपी करने की अनुमति नहीं है – डाउनलोड का उपयोग करें। +E1808 इस बॉक्स का मॉडल, फ़्लैश पार्टीशन, CPU, मेमोरी, LED, सेंसर, बटन, GPIO, सीरियल पोर्ट, नेटवर्क, U-Boot एनवायरनमेंट और कर्नेल लॉग – नए मॉडल के लिए आवश्यक सब कुछ। केवल पढ़ा जाता है, कुछ नहीं बदलता। फ़ाइल को मॉडल के issue में संलग्न करें। +E1809 MAC पते और सीरियल नंबर दिखाएँ (अन्यथा छिपे हुए – इन्हें सार्वजनिक issue में न डालें) diff --git a/tools/i18n/pt.tsv b/tools/i18n/pt.tsv index ef516f4b..27968415 100644 --- a/tools/i18n/pt.tsv +++ b/tools/i18n/pt.tsv @@ -2244,3 +2244,12 @@ P400 a unidade $1 não está montada E1798 ainda está a decorrer uma cópia em Files, uma tarefa na nuvem, um instantâneo ou o Paperless – aguarde até terminar E1799 a mudança parou antes de terminar – inicie-a novamente ou reinicie a caixa E1800 autobrr: os filtros com a ação Watch dir ainda indicam a pasta de entrega na unidade antiga – altere-a no autobrr para a pasta na nova unidade. +E1801 Imagem de teste para um novo modelo. +E1802 o root mantém a palavra-passe shareos – use a caixa apenas na sua própria rede. Envie as informações do dispositivo: +E1803 Informações do dispositivo +E1804 A ler … +E1805 INFORMAÇÕES DO DISPOSITIVO +E1806 dados de hardware para adicionar um modelo +E1807 Copiar não é permitido aqui – use Transferir. +E1808 Modelo, partições flash, CPU, memória, LEDs, sensores, botões, GPIOs, portas série, rede, o ambiente U-Boot e o registo do kernel desta caixa – tudo o que um novo modelo precisa. Só é lido, nada é alterado. Anexe o ficheiro ao issue do modelo. +E1809 Mostrar endereços MAC e números de série (caso contrário ocultos – não os coloque em issues públicos) diff --git a/tools/i18n/ru.tsv b/tools/i18n/ru.tsv index b19ae048..94ec13c8 100644 --- a/tools/i18n/ru.tsv +++ b/tools/i18n/ru.tsv @@ -2244,3 +2244,12 @@ P400 диск $1 не подключён E1798 ещё выполняется копирование в Files, облачное задание, снимок или Paperless – дождитесь завершения E1799 переключение прервалось до завершения – запустите его снова или перезагрузите устройство E1800 autobrr: фильтры с действием Watch dir всё ещё указывают папку передачи на старом диске – измените её в autobrr на папку на новом диске. +E1801 Тестовый образ для новой модели. +E1802 root сохраняет пароль shareos – используйте устройство только в своей сети. Пришлите сведения об устройстве: +E1803 Сведения об устройстве +E1804 Чтение … +E1805 СВЕДЕНИЯ ОБ УСТРОЙСТВЕ +E1806 данные оборудования для добавления модели +E1807 Копирование здесь запрещено – используйте «Скачать». +E1808 Модель, разделы флеш-памяти, процессор, память, светодиоды, датчики, кнопки, GPIO, последовательные порты, сеть, окружение U-Boot и журнал ядра этого устройства – всё, что нужно для новой модели. Только чтение, ничего не меняется. Приложите файл к issue модели. +E1809 Показать MAC-адреса и серийные номера (иначе скрыты – не публикуйте их в открытых issue) diff --git a/tools/i18n/zh.tsv b/tools/i18n/zh.tsv index 1cced6a1..89661881 100644 --- a/tools/i18n/zh.tsv +++ b/tools/i18n/zh.tsv @@ -2244,3 +2244,12 @@ P400 驱动器 $1 未挂载 E1798 Files 中的复制、云任务、快照或 Paperless 仍在运行 – 请等待其完成 E1799 切换在完成前中断 – 请重新开始,或重启设备 E1800 autobrr:使用 Watch dir 操作的过滤器仍指向旧驱动器上的交接文件夹 – 请在 autobrr 中将其改为新驱动器上的文件夹。 +E1801 新型号的测试镜像。 +E1802 root 保留密码 shareos – 请仅在自己的网络中使用此设备。请发送设备信息: +E1803 设备信息 +E1804 正在读取 … +E1805 设备信息 +E1806 用于添加型号的硬件信息 +E1807 此处不允许复制 – 请使用下载。 +E1808 此设备的型号、闪存分区、CPU、内存、LED、传感器、按键、GPIO、串口、网络、U-Boot 环境和内核日志 – 新型号所需的一切。只读取,不做任何更改。请将文件附加到该型号的 issue。 +E1809 显示 MAC 地址和序列号(否则已遮盖 – 请勿放入公开 issue) From 3728a2fdb30d149e72f6ba505f00ae15c4c7dd8e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 09:02:42 +0100 Subject: [PATCH 2/2] Devtest only for a model whose case sets it, not for an unknown one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The emulator tests (test-users) run without a device tree, so the model is unknown – with BOARD_DEVTEST=1 for unknown models S03claim left root unlocked there and the six claim checks failed. A real box of a new model gets its own case in board.sh anyway; an unknown model is claimed as before. test-boards: unknown model locked, a board.sh with a devtest case keeps root / shareos. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Sb3gb1FHs6DNkZHKinKAJv --- .../dns320l/rootfs-overlay/usr/lib/shareos/board.sh | 6 ++++-- tests/test-boards.sh | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/board/dlink/dns320l/rootfs-overlay/usr/lib/shareos/board.sh b/board/dlink/dns320l/rootfs-overlay/usr/lib/shareos/board.sh index 7b1862b5..b3dc7982 100644 --- a/board/dlink/dns320l/rootfs-overlay/usr/lib/shareos/board.sh +++ b/board/dlink/dns320l/rootfs-overlay/usr/lib/shareos/board.sh @@ -32,7 +32,9 @@ # keeps the password "shareos" (no claiming), the web # interface says so and offers the device info # (#/deviceinfo); its files are named …-devtest and are -# never part of a release. Also 1 on an unknown model. +# never part of a release. Only set in the case of +# such a model – an unknown model (no device tree, the +# emulator) is claimed as usual. board_detect() { model=$( { tr -d '\000' < ${SHAREOS_ROOT:-}/proc/device-tree/model; } 2>/dev/null) @@ -76,7 +78,7 @@ board_detect() { *) BOARD_ID=unknown BOARD_NAME="${model:-unknown}" BOARD_FWNAME= BOARD_SIG= BOARD_MODEL= BOARD_CONTROL=none BOARD_RTC=kernel - BOARD_LED_STATUS= BOARD_LED_USB= BOARD_LED_DISK1= BOARD_LED_DISK2= BOARD_DEVTEST=1 ;; + BOARD_LED_STATUS= BOARD_LED_USB= BOARD_LED_DISK1= BOARD_LED_DISK2= ;; esac } diff --git a/tests/test-boards.sh b/tests/test-boards.sh index 460058c9..a320ace9 100755 --- a/tests/test-boards.sh +++ b/tests/test-boards.sh @@ -47,7 +47,11 @@ check "only the DNS-320L counts as tested" "[ \"\$(info tested)\" = 0 ]" # --- devtest: a model that is being added, and an unknown one check "known models are no devtest" "[ \"\$(info devtest)\" = 0 ] && info | grep -qx 'BOARD_DEVTEST=\"0\"'" box "Some other NAS" -check "an unknown model counts as devtest" "[ \"\$(info devtest)\" = 1 ]" +check "an unknown model is no devtest either (claimed as usual)" "[ \"\$(info devtest)\" = 0 ]" +# a model that is being added: its case in board.sh sets BOARD_DEVTEST=1 – here +# a copy of board.sh with such a case for the unknown model +sed 's/BOARD_LED_DISK2= ;;/BOARD_LED_DISK2= BOARD_DEVTEST=1 ;;/' $O/usr/lib/shareos/board.sh > $T/board-devtest.sh +check "a case with BOARD_DEVTEST=1 counts as devtest" "[ \"\$(sh -c '. $T/board-devtest.sh; board_detect; echo \$BOARD_DEVTEST')\" = 1 ]" # S03claim leaves root alone on a devtest box cl() { # model -> root hash after S03claim (fake /etc, /overlay) box "$1"; mkdir -p $T/c/etc $T/c/overlay; : > $T/c/overlay/claim @@ -59,7 +63,8 @@ cl() { # model -> root hash after S03claim (fake /etc, /overlay) } if command -v openssl >/dev/null; then check "S03claim: a new DNS-320L gets root locked" "[ \"\$(cl 'D-Link DNS-320L-rev-Ax NAS')\" = '!' ]" - check "S03claim: a devtest box keeps root / shareos" "case \"\$(cl 'Some other NAS')\" in '\$1\$'*) true ;; *) false ;; esac" + check "S03claim: an unknown model gets root locked too" "[ \"\$(cl 'Some other NAS')\" = '!' ]" + check "S03claim: a devtest box keeps root / shareos" "case \"\$(SHAREOS_BOARD_LIB=$T/board-devtest.sh cl 'Some other NAS')\" in '\$1\$'*) true ;; *) false ;; esac" fi # --- shareos-deviceinfo: masked for public issues, --full on request