Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion onnx/bench_npu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
# PORT serve port (default 52625)
set -uo pipefail

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- several of these ranges
# had drifted past the end of their header and printed code to whoever asked for help (the same defect engine PR #2258 fixed in scripts/).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

BIN="${ONEBIT_BIN:-$HOME/src/engine-laya-npu/build-npu/1bit}"
MODEL="${ONEBIT_MODEL:-$HOME/.config/flm/models/Qwen3-0.6B-NPU2}"
KERNELS="${ONEBIT_DX_KERNELS:-}"
Expand All @@ -60,7 +64,7 @@ while [ $# -gt 0 ]; do
--kernels) KERNELS="$2"; shift 2 ;;
--port) PORT="$2"; shift 2 ;;
--lens|--gen|-w|--warmup|-r|--repeat|--mode|--endpoint) BENCH_ARGS+=("$1" "$2"); shift 2 ;;
-h|--help) sed -n '2,30p' "$0"; exit 0 ;;
-h|--help) usage; exit 0 ;;
*) echo "bench_npu.sh: unknown option $1" >&2; exit 2 ;;
esac
done
Expand Down
6 changes: 5 additions & 1 deletion os/v2/mkdebs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
# prefix (bin/lemond, bin/lemonade, bin/resources). <version> is the release tag, with or without the
# leading v: v2026.43 becomes 2026.43-1.
set -euo pipefail
[ $# -ge 4 ] || { sed -n '22,45p' "$0"; exit 2; }

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- several of these ranges
# had drifted past the end of their header and printed code to whoever asked for help (the same defect engine PR #2258 fixed in scripts/).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }
[ $# -ge 4 ] || { usage; exit 2; }
stage_in=$1 lemon=$2 version=${3#v} out=$4 keyring=${5:-} kstage=${KERNEL_STAGE:-} kver=
here=$(cd "$(dirname "$0")" && pwd)
src=$(cd "$here/../.." && pwd)
Expand Down
6 changes: 5 additions & 1 deletion os/v2/mkrepo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
# Release file is produced unsigned and the script says so - useful for a local run, never for
# publishing. The result is a directory of static files: publish it to 1bit.gg/apt as it is.
set -euo pipefail
[ $# -ge 2 ] || { sed -n '21,27p' "$0"; exit 2; }

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- several of these ranges
# had drifted past the end of their header and printed code to whoever asked for help (the same defect engine PR #2258 fixed in scripts/).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }
[ $# -ge 2 ] || { usage; exit 2; }
debs=$1 repo=$2 gnupg=${3:-} keyid=${4:-}
[ -d "$debs" ] || { echo "mkrepo: no $debs"; exit 2; }
dist=$repo/dists/stable
Expand Down
6 changes: 5 additions & 1 deletion os/v2/mkrootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
# The repository goes in at /srv/1bit-apt and apt reads it as file://, so the signed-by chain is the
# same one https would use: an unsigned or wrongly signed Release file fails the build here.
set -euo pipefail
[ $# -ge 2 ] || { sed -n '21,32p' "$0"; exit 2; }

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- several of these ranges
# had drifted past the end of their header and printed code to whoever asked for help (the same defect engine PR #2258 fixed in scripts/).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }
[ $# -ge 2 ] || { usage; exit 2; }
repo=$(cd "$1" && pwd) rootfs=$2 sshkey=${3:-}
here=$(cd "$(dirname "$0")" && pwd)
. "$here/pin.txt"
Expand Down
6 changes: 5 additions & 1 deletion os/v2/proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
# directory to seed the data partition with (so the VM needs no network for Lemonade's backends), and
# [model.gguf] a small model for the chat row.
set -euo pipefail
[ $# -ge 3 ] || { sed -n '21,32p' "$0"; exit 2; }

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- several of these ranges
# had drifted past the end of their header and printed code to whoever asked for help (the same defect engine PR #2258 fixed in scripts/).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }
[ $# -ge 3 ] || { usage; exit 2; }
w=$1 stage=$2 lemon=$3 backends=${4:-} model=${5:-$HOME/models/Qwen3-0.6B-Q4_K_M.gguf}
here=$(cd "$(dirname "$0")" && pwd)
version=v2026.43
Expand Down
6 changes: 5 additions & 1 deletion os/v2/vmtest-v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
#
# Prints VMTEST-V2 PASS or FAIL.
set -uo pipefail
[ $# -ge 2 ] || { sed -n '21,34p' "$0"; exit 2; }

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- several of these ranges
# had drifted past the end of their header and printed code to whoever asked for help (the same defect engine PR #2258 fixed in scripts/).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }
[ $# -ge 2 ] || { usage; exit 2; }
rootfs=$(cd "$1" && pwd) seed=$(cd "$2" && pwd) key=${3:-}
# an mmdebstrap rootfs is root-owned with root-only files: populating a filesystem image from it and
# handing it to qemu needs root, so the whole test runs as root rather than half of it
Expand Down
6 changes: 5 additions & 1 deletion os/v3/puppy/demo-seq-probe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
# 1 when any did not, 2 on usage/setup error.
set -uo pipefail

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- several of these ranges
# had drifted past the end of their header and printed code to whoever asked for help (the same defect engine PR #2258 fixed in scripts/).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

rounds=10
url=${LEMONADE:-http://1bit-os.local:13305/api/v1}
npu=${NPU_MODEL:-Qwen3-0.6B-NPU-1bit}
Expand All @@ -56,7 +60,7 @@ while [ $# -gt 0 ]; do
--big) big=${2:?}; shift 2 ;;
--dmesg) dmesg_file=${2:?}; shift 2 ;;
--state) state=${2:?}; shift 2 ;;
-h | --help) sed -n '28,48p' "$0"; exit 0 ;;
-h | --help) usage; exit 0 ;;
*[!0-9]*) echo "demo-seq-probe: unknown argument: $1" >&2; exit 2 ;;
*) rounds=$1; shift ;;
esac
Expand Down
6 changes: 5 additions & 1 deletion tools/xhci_keepawake_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
# 2 = usage/IO problem. Never 0 by accident: a machine where the rule does not apply says so.
set -u

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- several of these ranges
# had drifted past the end of their header and printed code to whoever asked for help (the same defect engine PR #2258 fixed in scripts/).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

SYSFS=${SYSFS:-/sys}
MODE=report

Expand All @@ -56,7 +60,7 @@ while [ $# -gt 0 ]; do
--apply) MODE=apply; shift;;
--revert) MODE=revert; shift;;
--sysfs-root) SYSFS=${2:?--sysfs-root needs a directory}; shift 2;;
-h|--help) sed -n '17,40p' "$0"; exit 0;;
-h|--help) usage; exit 0;;
*) echo "xhci_keepawake_check: unknown argument '$1'" >&2; exit 2;;
esac
done
Expand Down
Loading