Skip to content

feat: add firstboot and firstcommands operator commands #34

Description

@Deadbytes101

FIRSTBOOT / FIRSTCOMMANDS COMMAND WORKSTREAM

STATUS

Target: next preview after 0.0.4-alpha.20
Scope: local operator commands only
Release state: not RC / not release

PHYSICAL EVIDENCE

Alpha.20 persistent state and SSH host identity are confirmed on hardware.

state outcome ready
state device /dev/sdb4
persistence mode persistent
persistent reused true
active fingerprint SHA256:0Nb40sNSV8XwQEJaLeVxNeLafUZ5y7frM6CAUyWvQNA
authority match PASS

COMMAND 1: firstboot

Provide a stable operator command for inspecting and deliberately reopening
first-boot configuration.

Required interface:

firstboot status
Read-only. Print current release, firstboot outcome, state readiness,
active configuration revision, hostname, and whether configuration is
complete.

sudo firstboot run
Reopen the existing RIGOS first-boot UI on the caller's terminal.
Do not delete persistent state, SSH host keys, password hashes, or prior
configuration revisions. Require an explicit confirmation before any
configuration commit.

firstboot help
Print exact usage and safety rules.

Safety contract:

  • Default invocation is read-only status.
  • No implicit reset or deletion.
  • Refuse non-interactive run mode unless an explicit test fixture is active.
  • Refuse run mode when /var/lib/rigos is not current-boot ready.
  • Never expose mining identities, password material, or private SSH keys.
  • Preserve the existing firstboot status/event diagnostics.
  • Return nonzero with a stable diagnostic when prerequisites are missing.

COMMAND 2: firstcommands

Provide a compact post-login command reference for operators.

Required output:

firstcommands

RIGOS FIRST COMMANDS

firstboot status
sudo firstboot run
rigos-utility
rigosctl machine inspect
rigosctl miner inspect
rigos-config current
cat /run/rigos/state-status.json
cat /run/rigos/ssh-hostkeys-status.json
systemctl --failed --no-pager
journalctl -b --no-pager -n 120
sudo reboot
sudo poweroff

Rules:

  • Read-only.
  • No network dependency.
  • Works over local TTY and SSH.
  • Width-safe on 40, 80, and 120 column terminals.
  • Plain text output; no whiptail dependency.
  • Include VERSION_ID and BUILD_COMMIT from /etc/rigos-release.
  • Do not print secrets or full configuration values.

INSTALLATION

Install executable entry points in the appliance image:

/usr/local/bin/firstcommands
/usr/local/sbin/firstboot

Wire executable modes through the USB image hook. Do not replace the existing
/usr/local/sbin/rigos-firstboot implementation; the new firstboot command is a
controlled operator wrapper around it.

TESTS

Add source tests that prove:

  • firstboot with no arguments is read-only.
  • firstboot status succeeds without root.
  • firstboot run requires root, an interactive TTY, and ready current-boot
    persistent state.
  • firstboot run never removes policy.json, state directories, credentials,
    SSH host keys, or configuration revisions.
  • firstcommands contains every required command.
  • firstcommands output fits 40 columns without accidental wrapping.
  • neither command emits password hashes, identity values, private keys, or
    runtime xmrig secrets.
  • image verifier requires both installed executables and correct modes.

PHYSICAL ACCEPTANCE

[ ] firstcommands renders correctly through SSH.
[ ] firstcommands renders correctly on tty1.
[ ] firstboot status reports Alpha.20-or-later source truth.
[ ] sudo firstboot run opens a usable full-size UI.
[ ] applying a changed node name persists after reboot.
[ ] password persistence remains intact.
[ ] persistent and active SSH host-key fingerprints remain identical.
[ ] no failed systemd units after reboot.

No build, flash, tag, PR, merge, or release action is implied by this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions