97 lines
3.3 KiB
Markdown
97 lines
3.3 KiB
Markdown
|
|
# Anaconda log capture — virtio-9p host-share
|
||
|
|
|
||
|
|
**Agent 6 of 9-agent wave, 2026-05-05.**
|
||
|
|
|
||
|
|
## Why current setup is silent
|
||
|
|
|
||
|
|
v0.5.30 wired:
|
||
|
|
|
||
|
|
```
|
||
|
|
-chardev file,id=anaclog,path=$ANACONDA_LOG
|
||
|
|
-device virtio-serial-pci,id=vs1
|
||
|
|
-device virtserialport,chardev=anaclog,bus=vs1.0,name=org.fedoraproject.anaconda.log.0
|
||
|
|
```
|
||
|
|
|
||
|
|
Anaconda is supposed to autodetect this port and stream logs. Result:
|
||
|
|
`test/anaconda-vm-*.log` files are 0 bytes despite multiple full
|
||
|
|
installs.
|
||
|
|
|
||
|
|
**Root cause:** Anaconda's `setupVirtio()` (anaconda_logging.py:315)
|
||
|
|
doesn't write to the virtio port directly — it adds a forward rule to
|
||
|
|
`/etc/rsyslog.conf` then calls `restart_service("rsyslog")`. No
|
||
|
|
`inst.virtiolog` boot arg is required (`--virtiolog` defaults to the
|
||
|
|
right port via `argument_parsing.py:512`).
|
||
|
|
|
||
|
|
The veilor live ISO almost certainly **lacks `rsyslog`** (minimal
|
||
|
|
Fedora ks), so the forward rule lands in a file no daemon reads.
|
||
|
|
`restart_service` is a no-op. The QEMU side opens the port and
|
||
|
|
creates the 0-byte file but nothing ever writes to it.
|
||
|
|
|
||
|
|
Even with rsyslog present, only `LOG_LOCAL1`-tagged messages would
|
||
|
|
flow; the rich content lives in `/tmp/anaconda.log`,
|
||
|
|
`/tmp/program.log`, `/tmp/storage.log`, `/tmp/packaging.log` which
|
||
|
|
never traverse syslog.
|
||
|
|
|
||
|
|
## Fix — Option C (virtio-9p host-share + post-install copy)
|
||
|
|
|
||
|
|
### `test/run-vm.sh`
|
||
|
|
|
||
|
|
Add `-virtfs` 9p export of `test/test-runs/<timestamp>/` tagged
|
||
|
|
`hostlogs`. Keep existing virtio-serial as belt-and-braces fallback.
|
||
|
|
|
||
|
|
```bash
|
||
|
|
TS=$(date +%Y%m%d-%H%M%S)
|
||
|
|
HOSTLOGS_DIR="$TEST_DIR/test-runs/$TS"
|
||
|
|
mkdir -p "$HOSTLOGS_DIR"
|
||
|
|
HOSTSHARE_ARGS=(
|
||
|
|
-virtfs "local,path=$HOSTLOGS_DIR,mount_tag=hostlogs,security_model=mapped-xattr,id=hostshare"
|
||
|
|
)
|
||
|
|
echo " Logs : $HOSTLOGS_DIR"
|
||
|
|
```
|
||
|
|
|
||
|
|
Append `"${HOSTSHARE_ARGS[@]}" \` to the `exec qemu-system-x86_64`
|
||
|
|
block.
|
||
|
|
|
||
|
|
### `overlay/usr/local/bin/veilor-installer`
|
||
|
|
|
||
|
|
In `run_install()`, install an `EXIT` trap calling `_dump_logs_to_host`
|
||
|
|
that mounts the 9p share at `/mnt/hostlogs` and copies:
|
||
|
|
|
||
|
|
- `/tmp/{anaconda,program,storage,packaging,dnf,dnf.librepo,anaconda-cmdline}.log`
|
||
|
|
- `/var/log/veilor-installer.log`
|
||
|
|
- generated kickstart at `/run/install/veilor-generated.ks`
|
||
|
|
- `dmesg` output
|
||
|
|
- `journalctl -b` output
|
||
|
|
|
||
|
|
Runs on success, failure, and `^C`. Auto-no-ops on real hardware
|
||
|
|
where 9p isn't loaded.
|
||
|
|
|
||
|
|
```bash
|
||
|
|
_dump_logs_to_host() {
|
||
|
|
if mount -t 9p -o trans=virtio,version=9p2000.L hostlogs /mnt/hostlogs 2>/dev/null; then
|
||
|
|
cp -a /tmp/{anaconda,program,storage,packaging,dnf,dnf.librepo,anaconda-cmdline}.log \
|
||
|
|
/var/log/veilor-installer.log \
|
||
|
|
/run/install/veilor-generated.ks \
|
||
|
|
/mnt/hostlogs/ 2>/dev/null || true
|
||
|
|
dmesg > /mnt/hostlogs/dmesg.log 2>/dev/null || true
|
||
|
|
journalctl -b > /mnt/hostlogs/journal.log 2>/dev/null || true
|
||
|
|
umount /mnt/hostlogs 2>/dev/null || true
|
||
|
|
fi
|
||
|
|
}
|
||
|
|
trap _dump_logs_to_host EXIT
|
||
|
|
```
|
||
|
|
|
||
|
|
## Why options A/B/D were rejected
|
||
|
|
|
||
|
|
- **A** (grub kernel arg surgery — `inst.virtiolog`) and **D** (host
|
||
|
|
rsyslog TCP listener with `inst.syslog=10.0.2.2:5140`) both still
|
||
|
|
rely on rsyslog being present in the live ISO.
|
||
|
|
- **B** (anaconda --syslog at CLI) — same dependency.
|
||
|
|
- **C** captures complete file-level fidelity regardless. virtio-9p is
|
||
|
|
in the kernel; mount is two lines; copies the actual files.
|
||
|
|
|
||
|
|
## Files modified
|
||
|
|
|
||
|
|
- `test/run-vm.sh`
|
||
|
|
- `overlay/usr/local/bin/veilor-installer`
|