Add screensaver auto-lock, lynx/gsocket/apexrc defaults, htoprc, and Bantam updates
This commit is contained in:
1 parent
b7dca4f15f
commit
c12ed68d19
36 files changed
+1421
-75
No files matched your search
@@ -58,12 +58,12 @@ if command -v apk >/dev/null 2>&1 && \
|
||||
# Clear any older @geminux world pins and installed hashes so rebuilt local
|
||||
# packages with unchanged -r0 version strings always extract updated payloads.
|
||||
if [ -f "$TARGET_ROOTFS/etc/apk/world" ]; then
|
||||
grep -v -E '^geminux-(kernel-modules|xlibre|suckless|dunst|ui|bantam|config)(@|=|$)' \
|
||||
grep -v -E '^geminux-(kernel-modules|xlibre|suckless|dunst|ui|bantam|gsocket|config)(@|=|$)' \
|
||||
"$TARGET_ROOTFS/etc/apk/world" > "$TARGET_ROOTFS/etc/apk/world.tmp" || true
|
||||
mv "$TARGET_ROOTFS/etc/apk/world.tmp" "$TARGET_ROOTFS/etc/apk/world"
|
||||
fi
|
||||
apk --root "$TARGET_ROOTFS" --arch aarch64 del --no-scripts --purge=yes \
|
||||
geminux-config geminux-bantam geminux-ui geminux-dunst geminux-suckless \
|
||||
geminux-config geminux-gsocket geminux-bantam geminux-ui geminux-dunst geminux-suckless \
|
||||
geminux-xlibre geminux-kernel-modules 2>/dev/null || true
|
||||
|
||||
apk --root "$TARGET_ROOTFS" --arch aarch64 add --no-scripts --clean-protected=no \
|
||||
@@ -73,13 +73,14 @@ if command -v apk >/dev/null 2>&1 && \
|
||||
"geminux-dunst@geminux=1.12.2-r0" \
|
||||
"geminux-ui@geminux=${VER}-r0" \
|
||||
"geminux-bantam@geminux=${VER}-r0" \
|
||||
"geminux-gsocket@geminux=1.4.43-r0" \
|
||||
"geminux-config@geminux=${VER}-r0"
|
||||
else
|
||||
# Fallback direct copy when running on host without apk-tools
|
||||
if [ -d "$BASE_DIR/overlay/rootfs" ]; then
|
||||
cp -af "$BASE_DIR/overlay/rootfs/." "$TARGET_ROOTFS/"
|
||||
fi
|
||||
for subdir in xlibre suckless dunst geminux bantam; do
|
||||
for subdir in xlibre suckless dunst geminux bantam gsocket; do
|
||||
if [ -d "$BASE_DIR/prebuilt/$subdir" ]; then
|
||||
cp -af "$BASE_DIR/prebuilt/$subdir/." "$TARGET_ROOTFS/"
|
||||
fi
|
||||
@@ -195,8 +196,8 @@ if [ -f "$TARGET_ROOTFS/etc/passwd" ]; then
|
||||
"$TARGET_ROOTFS/etc/passwd"
|
||||
fi
|
||||
|
||||
mkdir -p "$TARGET_ROOTFS/root"
|
||||
for f in .bashrc .profile .bash_profile .gitconfig; do
|
||||
mkdir -p "$TARGET_ROOTFS/root" "$TARGET_ROOTFS/root/.config/htop"
|
||||
for f in .bashrc .profile .bash_profile .gitconfig .apexrc .lynx.cfg .config/htop/htoprc; do
|
||||
if [ -f "$TARGET_ROOTFS/etc/skel/$f" ]; then
|
||||
cp -f "$TARGET_ROOTFS/etc/skel/$f" "$TARGET_ROOTFS/root/$f"
|
||||
fi
|
||||
|
||||
@@ -43,7 +43,7 @@ apk add --no-cache python3 kmod openssl glib >/dev/null
|
||||
echo "[3/8] Installing the Geminux aarch64 package set..."
|
||||
PKGS="$(grep -v '^[[:space:]]*#' "$PKGS_FILE" | grep -v '^[[:space:]]*$' | tr '\n' ' ')"
|
||||
if [ -f "$ROOTFS/etc/apk/world" ]; then
|
||||
grep -v -E '^geminux-(kernel-modules|xlibre|suckless|dunst|ui|bantam|config)(@|=|$)' \
|
||||
grep -v -E '^geminux-(kernel-modules|xlibre|suckless|dunst|ui|bantam|gsocket|config)(@|=|$)' \
|
||||
"$ROOTFS/etc/apk/world" > "$ROOTFS/etc/apk/world.tmp" || true
|
||||
mv "$ROOTFS/etc/apk/world.tmp" "$ROOTFS/etc/apk/world"
|
||||
fi
|
||||
|
||||
@@ -15,6 +15,8 @@ if [ -f "$BANTAM_SRC/bantam.hpp" ]; then
|
||||
[ -f "$f" ] && cp -f "$f" "$BASE_DIR/src/bantam/"
|
||||
done
|
||||
fi
|
||||
sed -i 's|c\.model = "openrouter/free";|c.model = "kilo-auto/free";|' "$BASE_DIR/src/bantam/config.cpp"
|
||||
sed -i 's|openrouter/free|kilo-auto/free|g' "$BASE_DIR/src/bantam/README.md"
|
||||
|
||||
exec docker run --rm --network=host \
|
||||
-e HOST_UID="$(id -u)" \
|
||||
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
# Download, verify, strip, and stage prebuilt gsocket aarch64 binaries for Geminux.
|
||||
set -eu
|
||||
|
||||
BASE_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
GS_VER="1.4.43"
|
||||
GS_URL="https://github.com/hackerschoice/gsocket/releases/download/v${GS_VER}/gsocket_linux-aarch64.tar.gz"
|
||||
GS_SHA="2b50ce654feb110208745394267539364f3b60d7be6428ab5059e9815115f2d8"
|
||||
TARBALL="$BASE_DIR/build-cache/gsocket_linux-aarch64-${GS_VER}.tar.gz"
|
||||
OUT_DIR="$BASE_DIR/prebuilt/gsocket/usr/local/bin"
|
||||
|
||||
mkdir -p "$BASE_DIR/build-cache" "$OUT_DIR"
|
||||
|
||||
if [ ! -f "$TARBALL" ] || ! printf '%s %s\n' "$GS_SHA" "$TARBALL" | sha256sum -c - >/dev/null 2>&1; then
|
||||
echo "[*] Downloading gsocket ${GS_VER} (linux-aarch64)..."
|
||||
curl -fsSL -o "${TARBALL}.tmp" "$GS_URL"
|
||||
printf '%s %s\n' "$GS_SHA" "${TARBALL}.tmp" | sha256sum -c -
|
||||
mv -f "${TARBALL}.tmp" "$TARBALL"
|
||||
fi
|
||||
|
||||
rm -rf "$OUT_DIR"
|
||||
mkdir -p "$OUT_DIR"
|
||||
tar -xzf "$TARBALL" -C "$OUT_DIR"
|
||||
chmod 0755 "$OUT_DIR"/*
|
||||
|
||||
# Strip debug symbols from gsocket DSO helpers using Alpine aarch64 binutils
|
||||
exec docker run --rm --network=host \
|
||||
-e HOST_UID="$(id -u)" \
|
||||
-e HOST_GID="$(id -g)" \
|
||||
-v "$BASE_DIR:/geminux" \
|
||||
alpine:3.24 sh -eu -c '
|
||||
cat > /etc/apk/repositories <<EOF
|
||||
https://mirror.nura.eco/postmarketos/v26.06
|
||||
https://dl-cdn.alpinelinux.org/alpine/edge/main
|
||||
EOF
|
||||
cp /geminux/keys/*.rsa.pub /etc/apk/keys/ 2>/dev/null || true
|
||||
apk add --no-cache binutils-aarch64 >/dev/null
|
||||
for so in /geminux/prebuilt/gsocket/usr/local/bin/gsocket_*.so.*; do
|
||||
[ -f "$so" ] && aarch64-alpine-linux-musl-strip --strip-unneeded "$so"
|
||||
done
|
||||
chown -R "$HOST_UID:$HOST_GID" /geminux/prebuilt/gsocket
|
||||
'
|
||||
@@ -108,7 +108,7 @@ docker run --rm --network=host \
|
||||
printf "%s\n" "$UPG_OUT"
|
||||
|
||||
for pkg in geminux-kernel-modules geminux-xlibre geminux-suckless \
|
||||
geminux-dunst geminux-ui geminux-bantam geminux-config; do
|
||||
geminux-dunst geminux-ui geminux-bantam geminux-gsocket geminux-config; do
|
||||
if ! grep -q "^${pkg}@geminux=" /rootfs/etc/apk/world; then
|
||||
echo "FAIL: ${pkg} is not exact-version pinned to @geminux in world" >&2
|
||||
exit 1
|
||||
@@ -146,7 +146,10 @@ file \
|
||||
"$BASE_DIR/prebuilt/geminux/usr/lib/libgemui.so" \
|
||||
"$BASE_DIR/prebuilt/geminux/usr/bin/"* \
|
||||
"$BASE_DIR/prebuilt/geminux/usr/sbin/"* \
|
||||
"$BASE_DIR/prebuilt/bantam/usr/bin/bantam" | \
|
||||
"$BASE_DIR/prebuilt/bantam/usr/bin/bantam" \
|
||||
"$BASE_DIR/prebuilt/gsocket/usr/local/bin/gs-netcat" \
|
||||
"$BASE_DIR/prebuilt/gsocket/usr/local/bin/gsocket_dso.so.0" \
|
||||
"$BASE_DIR/prebuilt/gsocket/usr/local/bin/gsocket_uchroot_dso.so.0" | \
|
||||
awk '!/ARM aarch64/ { print "FAIL: not aarch64: " $0; bad=1 } END { exit bad }'
|
||||
echo "OK (all aarch64 ELFs verified)"
|
||||
|
||||
@@ -283,9 +286,24 @@ for req_rel in ("etc/pam.d/autologin", "etc/init.d/geminux-hwinit",
|
||||
"usr/sbin/geminux-wifi-nvram", "usr/sbin/geminux-tzctl",
|
||||
"usr/bin/geminux-datetime",
|
||||
"usr/bin/bantam",
|
||||
"usr/bin/lynx",
|
||||
"usr/bin/dtach",
|
||||
"usr/bin/openssl",
|
||||
"usr/local/bin/gs-netcat",
|
||||
"usr/local/bin/gsocket",
|
||||
"etc/htoprc",
|
||||
"etc/keymap/gemini-us.map",
|
||||
"etc/skel/.gitconfig",
|
||||
"etc/skel/.config/htop/htoprc",
|
||||
"etc/skel/.lynx.cfg",
|
||||
"etc/skel/.apexrc",
|
||||
"home/user/.gitconfig",
|
||||
"home/user/.config/htop/htoprc",
|
||||
"home/user/.lynx.cfg",
|
||||
"home/user/.apexrc",
|
||||
"root/.config/htop/htoprc",
|
||||
"root/.lynx.cfg",
|
||||
"root/.apexrc",
|
||||
"etc/NetworkManager/dispatcher.d/30-geminux-chrony",
|
||||
"etc/polkit-1/rules.d/10-geminux.rules"):
|
||||
if not os.path.lexists(os.path.join(rootfs, req_rel)):
|
||||
@@ -309,6 +327,7 @@ for rel, needle in (
|
||||
("etc/NetworkManager/conf.d/20-geminux-wifi.conf", "wifi.scan-rand-mac-address = no"),
|
||||
("etc/NetworkManager/conf.d/20-geminux-wifi.conf", "wifi-sec.pmf = 1"),
|
||||
("etc/shells", "/bin/bash"),
|
||||
("usr/bin/geminux-launcher", "Bantam AI agent"),
|
||||
):
|
||||
p = os.path.join(rootfs, rel)
|
||||
with open(p, "r", encoding="utf-8") as f:
|
||||
@@ -317,6 +336,10 @@ for rel, needle in (
|
||||
xorg_mode = os.stat(os.path.join(rootfs, "usr/bin/Xorg")).st_mode & 0o7777
|
||||
if xorg_mode != 0o4755:
|
||||
raise SystemExit(f"FAIL: rootfs/usr/bin/Xorg mode is {oct(xorg_mode)}, expected 0o4755")
|
||||
with open(os.path.join(rootfs, "usr/bin/bantam"), "rb") as f:
|
||||
bantam_bin = f.read()
|
||||
if b"kilo-auto/free" not in bantam_bin or b"openrouter/free" in bantam_bin:
|
||||
raise SystemExit("FAIL: rootfs/usr/bin/bantam does not default to 'kilo-auto/free'")
|
||||
|
||||
awk_path = os.path.join(rootfs, "usr", "bin", "awk")
|
||||
if not os.path.lexists(awk_path):
|
||||
|
||||
@@ -94,7 +94,7 @@ def collect_needed_so(stage_dir):
|
||||
m = re.search(r"\(NEEDED\)\s+Shared library:\s+\[([^\]]+)\]", line)
|
||||
if m:
|
||||
so = m.group(1)
|
||||
if so.startswith("ld-musl-") or so in internal:
|
||||
if so.startswith("ld-musl-") or so == "libc.so" or so in internal:
|
||||
continue
|
||||
needed.add(f"so:{so}")
|
||||
return sorted(needed)
|
||||
@@ -239,7 +239,18 @@ make_pkg(
|
||||
depends=collect_needed_so(bstage),
|
||||
)
|
||||
|
||||
# 7. geminux-config
|
||||
# 7. geminux-gsocket
|
||||
gstage = os.path.join(work_dir, "geminux-gsocket")
|
||||
copy_tree_dedup("/geminux/prebuilt/gsocket", gstage)
|
||||
make_pkg(
|
||||
"geminux-gsocket", "1.4.43-r0",
|
||||
"Gsocket end-to-end encrypted NAT traversal toolkit (gs-netcat, gsocket)",
|
||||
gstage,
|
||||
provides=["cmd:gs-netcat=1.4.43-r0", "cmd:gsocket=1.4.43-r0", "gsocket=1.4.43-r0"],
|
||||
depends=["bash", "openssl"] + collect_needed_so(gstage),
|
||||
)
|
||||
|
||||
# 8. geminux-config
|
||||
cstage = os.path.join(work_dir, "geminux-config")
|
||||
copy_tree_dedup("/geminux/overlay/rootfs", cstage, dedup=True)
|
||||
for rel in ("etc/os-release", "usr/lib/os-release", "etc/issue", "etc/motd"):
|
||||
@@ -261,6 +272,7 @@ make_pkg(
|
||||
f"geminux-dunst=1.12.2-r0",
|
||||
f"geminux-ui={pkg_ver}",
|
||||
f"geminux-bantam={pkg_ver}",
|
||||
f"geminux-gsocket=1.4.43-r0",
|
||||
],
|
||||
replaces=[
|
||||
"alpine-baselayout",
|
||||
|
||||
@@ -25,6 +25,7 @@ dbus-openrc
|
||||
dnsmasq
|
||||
doas
|
||||
dosfstools
|
||||
dtach
|
||||
e2fsprogs
|
||||
e2fsprogs-extra
|
||||
ed
|
||||
@@ -79,6 +80,7 @@ libxinerama
|
||||
libxrandr
|
||||
libxscrnsaver
|
||||
libxtst
|
||||
lynx
|
||||
mandoc
|
||||
mc
|
||||
mesa-dri-gallium
|
||||
@@ -103,6 +105,7 @@ nsxiv
|
||||
openrc
|
||||
openssh
|
||||
openssh-server-pam
|
||||
openssl
|
||||
pango
|
||||
perl
|
||||
perl-io-socket-ssl
|
||||
|
||||
@@ -173,6 +173,48 @@ int main(void) {
|
||||
assert(perf.a72_online);
|
||||
assert(perf.suspend_timeout_s == 0);
|
||||
|
||||
/* Idle screensaver timing from last active input (battery balanced: dim=120s, suspend=300s) */
|
||||
pol.lid_closed = false;
|
||||
pol.hdmi_connected = false;
|
||||
pol.on_ac_power = false;
|
||||
uint64_t next_wait = 999999;
|
||||
assert(geminux_policy_eval_idle(&pol, IDLE_STAGE_ACTIVE, 0, &next_wait) == IDLE_ACT_NONE);
|
||||
assert(next_wait == 120000);
|
||||
/* User typed at t=100s, so when initial 120s timer fires (elapsed=20s) it re-arms for 100s */
|
||||
assert(geminux_policy_eval_idle(&pol, IDLE_STAGE_ACTIVE, 20000, &next_wait) == IDLE_ACT_NONE);
|
||||
assert(next_wait == 100000);
|
||||
assert(geminux_policy_eval_idle(&pol, IDLE_STAGE_ACTIVE, 120000, &next_wait) == IDLE_ACT_DIM);
|
||||
assert(next_wait == 180000);
|
||||
assert(geminux_policy_eval_idle(&pol, IDLE_STAGE_DIMMED, 200000, &next_wait) == IDLE_ACT_NONE);
|
||||
assert(next_wait == 100000);
|
||||
assert(geminux_policy_eval_idle(&pol, IDLE_STAGE_DIMMED, 300000, &next_wait) == IDLE_ACT_SUSPEND);
|
||||
assert(next_wait == 0);
|
||||
|
||||
/* AC balanced (dim=300s, suspend=0): acts as lock + blank screensaver without auto-suspend */
|
||||
pol.lid_closed = false;
|
||||
pol.on_ac_power = true;
|
||||
assert(geminux_policy_eval_idle(&pol, IDLE_STAGE_ACTIVE, 299000, &next_wait) == IDLE_ACT_NONE);
|
||||
assert(next_wait == 1000);
|
||||
assert(geminux_policy_eval_idle(&pol, IDLE_STAGE_ACTIVE, 300000, &next_wait) == IDLE_ACT_LOCK_BLANK);
|
||||
assert(next_wait == 0);
|
||||
assert(geminux_policy_eval_idle(&pol, IDLE_STAGE_LOCKED_BLANK, 450000, &next_wait) == IDLE_ACT_NONE);
|
||||
assert(next_wait == 0);
|
||||
|
||||
/* Inhibitors, HDMI, and closed lid suppress idle screensaver timers */
|
||||
assert(geminux_policy_add_inhibit(&pol, "video"));
|
||||
assert(geminux_policy_eval_idle(&pol, IDLE_STAGE_ACTIVE, 400000, &next_wait) == IDLE_ACT_NONE);
|
||||
assert(next_wait == 0);
|
||||
assert(geminux_policy_del_inhibit(&pol, "video"));
|
||||
pol.hdmi_connected = true;
|
||||
assert(geminux_policy_eval_idle(&pol, IDLE_STAGE_ACTIVE, 400000, &next_wait) == IDLE_ACT_NONE);
|
||||
assert(next_wait == 0);
|
||||
pol.hdmi_connected = false;
|
||||
pol.lid_closed = true;
|
||||
assert(geminux_policy_eval_idle(&pol, IDLE_STAGE_ACTIVE, 400000, &next_wait) == IDLE_ACT_NONE);
|
||||
assert(next_wait == 0);
|
||||
pol.lid_closed = false;
|
||||
pol.on_ac_power = false;
|
||||
|
||||
test_touch_gestures();
|
||||
|
||||
/* Wi-Fi NVRAM record validation, scan, and deterministic MAC fallback */
|
||||
|
||||
Reference in new issue
Block a user