From 3339fb009c766a99d90699591b49cef1cfb858be Mon Sep 17 00:00:00 2001 From: sergio Date: Fri, 22 May 2026 00:40:34 +0000 Subject: [PATCH] =?UTF-8?q?fix(arje):=20saneo=20ente-=E2=86=92arje-=20en?= =?UTF-8?q?=20scripts=20y=20seeds=20de=20boot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El rename ente→arje dejó referencias stale al binario PID 1 y a los shims. Los nombres reales (verificados con cargo metadata) son todos arje-*: arje-zero, los 14 arje-*-compat, arje-echo, arje-policy-provider, arje-bus, arje-brain. - build-arje-initrd.sh, install-arje-as-init.sh, uninstall-arje.sh, run-arje-qemu.sh: `-p ente-*` → `-p arje-*`, paths /sbin/arje-zero y /usr/sbin/arje-*, RUST_LOG arje_zero=info. - seeds/arje-prod y arje-host: los exec `/usr/sbin/ente-*-compat` apuntaban a binarios que no existirían tras instalar — corregidos a `/usr/sbin/arje-*`. (validate.sh no chequea exec, por eso «validaban» igual; al boot real habrían fallado.) Intactos a propósito: `/ente/` (directorio canónico de la Semilla) y `ente.slice/*` (jerarquía cgroup). Las 3 seeds validan. Co-Authored-By: Claude Opus 4.7 --- scripts/build-arje-initrd.sh | 80 ++++++++++++++++----------------- scripts/install-arje-as-init.sh | 24 +++++----- scripts/run-arje-qemu.sh | 2 +- scripts/uninstall-arje.sh | 16 +++---- seeds/arje-host.card.json | 18 ++++---- seeds/arje-prod.card.json | 30 ++++++------- 6 files changed, 85 insertions(+), 85 deletions(-) diff --git a/scripts/build-arje-initrd.sh b/scripts/build-arje-initrd.sh index e0cb350..23afe01 100755 --- a/scripts/build-arje-initrd.sh +++ b/scripts/build-arje-initrd.sh @@ -1,20 +1,20 @@ #!/usr/bin/env bash -# build-arje-initrd.sh — empaqueta ente-zero + shims compat + Tarjeta Semilla +# build-arje-initrd.sh — empaqueta arje-zero + shims compat + Tarjeta Semilla # en un initramfs CPIO+gzip listo para arrancar bajo QEMU o como /init real. # -# Toolchain: musl-static por default. ente-zero es PID 1; cualquier +# Toolchain: musl-static por default. arje-zero es PID 1; cualquier # dependencia dinámica (libgcc_s, libc.so.6, ld-linux) que no esté en el # initramfs produce kernel panic. Compilar contra musl elimina el problema # completamente — un solo ELF estático. # # Layout del initrd resultante: -# /init → wrapper sh que exec /sbin/ente-zero -# /sbin/ente-zero → PID 1 (musl-static) -# /usr/sbin/ente-*-compat → shims systemd (musl-static) -# /usr/sbin/ente-echo, ente-policy-provider +# /init → wrapper sh que exec /sbin/arje-zero +# /sbin/arje-zero → PID 1 (musl-static) +# /usr/sbin/arje-*-compat → shims systemd (musl-static) +# /usr/sbin/arje-echo, arje-policy-provider # /ente/seed.card.json → Tarjeta Semilla # /bin/{sh,ls,cat,...} → busybox-static (recomendado) -# /dev, /proc, /sys, /run → puntos de montaje (ente-zero los monta) +# /dev, /proc, /sys, /run → puntos de montaje (arje-zero los monta) # # Uso: # scripts/build-arje-initrd.sh [seed.card.json] [out.cpio.gz] @@ -90,33 +90,33 @@ EOF fi fi -# 1. Build release de ente-zero y todos los compat shims con el target elegido. -echo "[build-initrd] cargo build --release --target $TARGET de ente-zero + shims" +# 1. Build release de arje-zero y todos los compat shims con el target elegido. +echo "[build-initrd] cargo build --release --target $TARGET de arje-zero + shims" cargo build --release --target "$TARGET" \ - -p ente-zero \ - -p ente-echo \ - -p ente-logind-compat \ - -p ente-hostnamed-compat \ - -p ente-timedated-compat \ - -p ente-localed-compat \ - -p ente-journald-compat \ - -p ente-resolved-compat \ - -p ente-polkit-compat \ - -p ente-machined-compat \ - -p ente-systemd1-compat \ - -p ente-notify-compat \ - -p ente-timer-compat \ - -p ente-tmpfiles-compat \ - -p ente-binfmt-compat \ - -p ente-policy-provider + -p arje-zero \ + -p arje-echo \ + -p arje-logind-compat \ + -p arje-hostnamed-compat \ + -p arje-timedated-compat \ + -p arje-localed-compat \ + -p arje-journald-compat \ + -p arje-resolved-compat \ + -p arje-polkit-compat \ + -p arje-machined-compat \ + -p arje-systemd1-compat \ + -p arje-notify-compat \ + -p arje-timer-compat \ + -p arje-tmpfiles-compat \ + -p arje-binfmt-compat \ + -p arje-policy-provider # 1b. Build de las CLI de administración. Son `[[example]]` de sus crates # respectivos — un solo binario cada una, sin estado propio. echo "[build-initrd] cargo build --release --target $TARGET de CLIs admin" cargo build --release --target "$TARGET" \ --example brahman-status -p brahman-admin \ - --example busctl -p ente-bus \ - --example brainctl -p ente-brain + --example busctl -p arje-bus \ + --example brainctl -p arje-brain BIN_DIR="target/$TARGET/release" EX_DIR="target/$TARGET/release/examples" @@ -132,7 +132,7 @@ fi # Si quedó alguno con interpreter dinámico, el kernel paniquea. if [[ "$TARGET" == *-musl ]] && command -v file >/dev/null 2>&1; then bad=0 - for b in "$BIN_DIR/ente-zero" "$BIN_DIR/ente-echo"; do + for b in "$BIN_DIR/arje-zero" "$BIN_DIR/arje-echo"; do [ -f "$b" ] || continue if file "$b" | grep -q "dynamically linked"; then echo "[build-initrd] WARN: $b quedó DYNAMIC (esperábamos static):" >&2 @@ -152,13 +152,13 @@ trap 'rm -rf "$STAGE"' EXIT mkdir -p "$STAGE"/{bin,sbin,usr/bin,usr/sbin,etc,ente,proc,sys,dev,run,tmp,sys/fs/cgroup} # 5. Copiar binarios arje. -install -m 0755 "$BIN_DIR/ente-zero" "$STAGE/sbin/ente-zero" -for b in ente-echo ente-policy-provider \ - ente-logind-compat ente-hostnamed-compat ente-timedated-compat \ - ente-localed-compat ente-journald-compat ente-resolved-compat \ - ente-polkit-compat ente-machined-compat ente-systemd1-compat \ - ente-notify-compat ente-timer-compat ente-tmpfiles-compat \ - ente-binfmt-compat; do +install -m 0755 "$BIN_DIR/arje-zero" "$STAGE/sbin/arje-zero" +for b in arje-echo arje-policy-provider \ + arje-logind-compat arje-hostnamed-compat arje-timedated-compat \ + arje-localed-compat arje-journald-compat arje-resolved-compat \ + arje-polkit-compat arje-machined-compat arje-systemd1-compat \ + arje-notify-compat arje-timer-compat arje-tmpfiles-compat \ + arje-binfmt-compat; do install -m 0755 "$BIN_DIR/$b" "$STAGE/usr/sbin/$b" done @@ -211,14 +211,14 @@ fi install -m 0644 "$SEED" "$STAGE/ente/seed.card.json" # 8. /init wrapper. El kernel pasa control a /init; nosotros invocamos -# ente-zero como PID 1 real con su env mínimo. +# arje-zero como PID 1 real con su env mínimo. cat > "$STAGE/init" <<'EOF' #!/bin/sh -# arje /init — kernel → este script → ente-zero (PID 1 lo hereda via exec) +# arje /init — kernel → este script → arje-zero (PID 1 lo hereda via exec) export PATH=/usr/sbin:/usr/bin:/sbin:/bin -export RUST_LOG="${RUST_LOG:-ente_zero=info,brahman_handshake=info,info}" -# ente-zero monta /proc /sys /dev /sys/fs/cgroup él mismo. -exec /sbin/ente-zero +export RUST_LOG="${RUST_LOG:-arje_zero=info,brahman_handshake=info,info}" +# arje-zero monta /proc /sys /dev /sys/fs/cgroup él mismo. +exec /sbin/arje-zero EOF chmod 0755 "$STAGE/init" diff --git a/scripts/install-arje-as-init.sh b/scripts/install-arje-as-init.sh index b446634..5e772d9 100755 --- a/scripts/install-arje-as-init.sh +++ b/scripts/install-arje-as-init.sh @@ -11,7 +11,7 @@ # 2. Copia binarios a /usr/sbin/ (init/shims) y /usr/bin/ (CLIs admin) # del rootfs vivo. # 3. Copia la seed a /ente/seed.card.json (default: arje-host.card.json). -# 4. Crea menuentry "arje" en /etc/grub.d/40_custom usando init=/sbin/ente-zero +# 4. Crea menuentry "arje" en /etc/grub.d/40_custom usando init=/sbin/arje-zero # (conserva initramfs nativo → firmware, módulos kernel, root FS, # siguen funcionando exactamente igual). # 5. Ejecuta update-grub o grub-mkconfig según distro. @@ -66,13 +66,13 @@ BIN_DIR="$REPO_DIR/target/$TARGET/release" EX_DIR="$BIN_DIR/examples" echo "[install-arje] paso 2/5: instalar binarios en /usr/sbin/ y /usr/bin/" -install -m 0755 "$BIN_DIR/ente-zero" /usr/sbin/ente-zero -for b in ente-echo ente-policy-provider \ - ente-logind-compat ente-hostnamed-compat ente-timedated-compat \ - ente-localed-compat ente-journald-compat ente-resolved-compat \ - ente-polkit-compat ente-machined-compat ente-systemd1-compat \ - ente-notify-compat ente-timer-compat ente-tmpfiles-compat \ - ente-binfmt-compat; do +install -m 0755 "$BIN_DIR/arje-zero" /usr/sbin/arje-zero +for b in arje-echo arje-policy-provider \ + arje-logind-compat arje-hostnamed-compat arje-timedated-compat \ + arje-localed-compat arje-journald-compat arje-resolved-compat \ + arje-polkit-compat arje-machined-compat arje-systemd1-compat \ + arje-notify-compat arje-timer-compat arje-tmpfiles-compat \ + arje-binfmt-compat; do install -m 0755 "$BIN_DIR/$b" "/usr/sbin/$b" done for e in brahman-status busctl brainctl; do @@ -129,11 +129,11 @@ fi cat >> "$CUSTOM" <