Files
brahman/scripts/uninstall-arje.sh
T
sergio 3339fb009c fix(arje): saneo ente-→arje- en scripts y seeds de boot
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 <noreply@anthropic.com>
2026-05-22 00:40:34 +00:00

46 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# uninstall-arje.sh — revierte lo que install-arje-as-init.sh hizo.
#
# - Borra /usr/sbin/arje-* y /usr/bin/{brahman-status,busctl,brainctl}.
# - Borra el bloque ARJE-MENUENTRY de /etc/grub.d/40_custom.
# - Regenera grub.cfg.
# - NO toca /ente/seed.card.json (querés conservar customización).
# - NO toca /sbin/init ni systemd.
set -euo pipefail
if [ "$(id -u)" -ne 0 ]; then
echo "[uninstall-arje] hace falta root" >&2
exit 1
fi
echo "[uninstall-arje] removiendo binarios"
rm -f /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
rm -f "/usr/sbin/$b"
done
for e in brahman-status busctl brainctl; do
rm -f "/usr/bin/$e"
done
echo "[uninstall-arje] limpiando menuentry de /etc/grub.d/40_custom"
CUSTOM=/etc/grub.d/40_custom
if [ -f "$CUSTOM" ] && grep -q "BEGIN ARJE-MENUENTRY" "$CUSTOM"; then
awk '/BEGIN ARJE-MENUENTRY/{f=1} /END ARJE-MENUENTRY/{f=0; next} !f' "$CUSTOM" \
> "$CUSTOM.tmp" && mv "$CUSTOM.tmp" "$CUSTOM"
chmod 0755 "$CUSTOM"
fi
if command -v update-grub >/dev/null 2>&1; then
update-grub
elif command -v grub-mkconfig >/dev/null 2>&1; then
grub-mkconfig -o /boot/grub/grub.cfg
fi
echo "[uninstall-arje] hecho. /ente/seed.card.json conservado (borralo a mano si querés)."