Files
brahman/scripts/uninstall-arje.sh
T
sergio ca5dd04176 feat(arje): reemplaza systemd en máquina real con coexistencia GRUB
Flujo seguro de adopción: arje se instala como entrada GRUB
alternativa, no toca systemd ni /sbin/init. Booteás arje cuando
querés, volvés a systemd si rompe (rollback instantáneo desde el
menú).

Artefactos nuevos:

- scripts/install-arje-as-init.sh: instala binarios musl-static a
  /usr/sbin/ y /usr/bin/, copia seed a /ente/seed.card.json, agrega
  menuentry "arje" a /etc/grub.d/40_custom usando init=/sbin/ente-zero
  con kernel + initrd nativos. NO cambia GRUB_DEFAULT. Idempotente
  (regenera el bloque ARJE-MENUENTRY si existe).

- scripts/uninstall-arje.sh: revierte binarios + menuentry. Conserva
  /ente/seed.card.json por si la editaste.

- seeds/arje-host.card.json: seed para máquina real con 15 cards:
  tmpfiles + mount-fstab + swap-on + dbus-system + 11 compat shims +
  dhcpcd + sshd + agetty. Validada.

- docs/arje-replace-systemd.md: filosofía vs systemd ("no acapara
  porque no genera, sólo arranca lo declarado"), lista exhaustiva de
  servicios systemd que NO deben migrarse (ModemManager, snapd, cups,
  unattended-upgrades, etc.), tabla diferencial de UX vs systemd
  (systemctl restart → kill PID, systemctl enable → editar seed),
  checklist pre-primer-boot, instrucciones de rollback y cómo hacer
  arje default sólo cuando estés seguro.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 20:01:12 +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/ente-* 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/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
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)."