ADR 0016 los listaba entre los CONGELADOS; el usuario pidió descongelarlos al abrir el SDD 28. La
enmienda queda escrita en el propio ADR, que si no la etiqueta deja de describir el hecho.
`hammer-install.sh` → `takana-install.sh`, `hammer-live-install.sh` → `takana-live-install.sh`,
`hammer-banner.txt` → `takana-banner.txt`, `BRIEFING-hammer.md` → `BRIEFING-takana.md`.
**Lo que hacía caro esto no es el nombre del fichero.** El instalador se inyecta en el ISO como
`/usr/bin/hammer-install` y su éxito se detecta con un `grep` de `HAMMER-INSTALL-OK` desde TRES
scripts de prueba. Renombrar un solo lado los deja casando NADA — sin fallar —, que es literalmente
el modo en que `atribuir-fallos.py` quedó mudo cuando el renombre movió el target de `tracing`.
Se renombraron las dos puntas en el mismo commit (`/usr/bin/takana-install`,
`TAKANA-INSTALL-OK/FAIL`, `TAKANA_INSTALL_*`, `work/takana-install.img`, `/run/takana-install`),
se comprobó por `grep` que no quede ningún token viejo fuera del ADR, y —lo que decide— se CORRIÓ
`install-tui-test.sh`: 4/4 casos verdes.
Las tres `TAKANA_INSTALL_*` caen al nombre viejo (`${TAKANA_INSTALL_X:-${HAMMER_INSTALL_X:-}}`):
el llamador puede ser un ISO anterior al renombre. Misma convención que `TAKANA_ROOT_PW` unas
líneas más arriba en ese mismo script.
NO se tocó `/usr/sbin/hammer-recover` ni su hook de arranque —renombrarlo rompe máquinas YA
INSTALADAS, no el repo—: sobrevive intacto dentro del script renombrado, verificado por conteo
antes y después (8 ocurrencias). Tampoco `hammerd`, `hammer-edit` (su `name` está en la ruta del
store), `/var/lib/hammer`, `HAMMER_LIVE` ni los siete literales de hash.
De paso: `scripts/.hammer-banner.txt.kate-swp` era un swap de editor commiteado por error. Fuera.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RomoxEGZUhaT4pob1QSX5x
65 lines
3.6 KiB
Bash
Executable File
65 lines
3.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# iso-install-test.sh — valida el lazo COMPLETO de instalación desde el medio live (refinamiento #1):
|
|
# (1) arma un ISO instalador (iso-image.sh INSTALLER=1 AUTO_INSTALL=/dev/vda) con el payload de disco
|
|
# (kernel + GRUB MBR + /usr/bin/takana-install) bundleado;
|
|
# (2) lo bootea con un disco EN BLANCO ⇒ el /init desatendido corre takana-install y apaga;
|
|
# (3) bootea ESE disco SOLO (sin ISO, sin -kernel) ⇒ el producto instalado arranca y sirve SSH.
|
|
# Cierra el lazo "ISO live → disco instalado → bootea solo", lo que hace la distro distribuible.
|
|
#
|
|
# Uso: PRODUCT=<hash-o-prefijo> ./scripts/iso-install-test.sh
|
|
# Vars: KERNEL MEM (def 4096) KVM (def 1) DISK_MB (def 4096) INSTALL_DEADLINE (def 180) BOOT_DEADLINE (def 90)
|
|
set -euo pipefail
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"; cd "$ROOT"
|
|
KERNEL="${KERNEL:-$(ls store/*-linux/boot/bzImage 2>/dev/null | head -1)}"
|
|
MEM="${MEM:-4096}"; KVM="${KVM:-1}"; DISK_MB="${DISK_MB:-4096}"
|
|
INSTALL_DEADLINE="${INSTALL_DEADLINE:-180}"; BOOT_DEADLINE="${BOOT_DEADLINE:-90}"
|
|
WORK="$ROOT/work/iso-install-test"; ISO="$WORK/installer.iso"; TGT="$WORK/target.img"
|
|
ILOG="$WORK/install.log"; BLOG="$WORK/diskboot.log"
|
|
mkdir -p "$WORK"
|
|
|
|
if [ -n "${PRODUCT:-}" ]; then
|
|
PDIR=$(ls -d store/"${PRODUCT#b3:}"*-product-rootfs 2>/dev/null | head -1)
|
|
else
|
|
PDIR=$(ls -dt store/*-product-rootfs 2>/dev/null | head -1)
|
|
fi
|
|
[ -n "$PDIR" ] && [ -d "$PDIR" ] || { echo "no encuentro product-rootfs"; exit 1; }
|
|
[ -n "$KERNEL" ] && [ -e "$KERNEL" ] || { echo "no encuentro kernel"; exit 1; }
|
|
echo "==> product-rootfs: $PDIR"
|
|
|
|
accel=(); if [ "$KVM" = 1 ] && [ -w /dev/kvm ]; then accel=(-enable-kvm -cpu host); fi
|
|
|
|
echo "==> (1) armando ISO instalador (INSTALLER=1, AUTO_INSTALL=/dev/vda)"
|
|
ROOTFS="$PDIR" ISO="$ISO" KERNEL="$KERNEL" INSTALLER=1 AUTO_INSTALL=/dev/vda ./scripts/iso-image.sh >/dev/null
|
|
echo " ISO: $(du -h "$ISO" | cut -f1)"
|
|
|
|
echo "==> (2) boot del instalador con disco EN BLANCO ${DISK_MB}M (auto-instala y apaga)"
|
|
rm -f "$TGT"; truncate -s "${DISK_MB}M" "$TGT"
|
|
timeout "$INSTALL_DEADLINE" qemu-system-x86_64 -m "$MEM" -no-reboot -nographic "${accel[@]}" \
|
|
-drive file="$TGT",format=raw,if=virtio -cdrom "$ISO" -boot d > "$ILOG" 2>&1 || true
|
|
if ! grep -q "TAKANA-INSTALL-OK" "$ILOG"; then
|
|
echo "✗ la instalación NO terminó OK — ver $ILOG" >&2
|
|
grep -iE "TAKANA-INSTALL-FAIL|takana-install:|no apareció|error" "$ILOG" | head; exit 1
|
|
fi
|
|
echo " ✓ TAKANA-INSTALL-OK"
|
|
|
|
echo "==> (3) boot del DISCO instalado (sin ISO, sin -kernel)"
|
|
timeout "$BOOT_DEADLINE" qemu-system-x86_64 -m "$MEM" -no-reboot -nographic "${accel[@]}" \
|
|
-drive file="$TGT",format=raw,if=virtio > "$BLOG" 2>&1 || true
|
|
|
|
fail=0
|
|
check() { if grep -qiE "$1" "$BLOG"; then echo " ✓ $2"; else echo " ✗ $2" >&2; fail=1; fi; }
|
|
reject() { if grep -qiE "$1" "$BLOG"; then echo " ✗ $2 (apareció)" >&2; fail=1; else echo " ✓ $2"; fi; }
|
|
echo "==> asserts sobre el arranque del disco:"
|
|
check "GNU GRUB" "GRUB del disco (MBR→core.img del hueco post-MBR)"
|
|
check "Linux version 6\.16" "kernel cargado del disco"
|
|
check "Server listening on .* port 22" "sshd escuchando (producto instalado en servicio)"
|
|
check "hammer-recover:" "hook de auto-recover de upgrades corrió al arranque (#4b)"
|
|
reject "ARRANQUE FALLIDO|seed.card no encontrada" "arje-zero arrancó sin fallo de seed"
|
|
reject "no pude montar" "particiones dedicadas /store y /var/lib/hammer montadas"
|
|
|
|
if [ "$fail" = 0 ]; then
|
|
echo; echo "✓✓ INSTALL-FROM-LIVE VERDE: ISO live → takana-install → disco que bootea solo y sirve SSH"
|
|
else
|
|
echo; echo "✗ install-from-live FALLÓ — ver $ILOG / $BLOG" >&2; exit 1
|
|
fi
|