Skip to content

Make the JNode installer invokable from a shell (not a boot-time Main-Class) #615

Closed

Description

@LSantha

Summary

Rework the JNode installer so it can be invoked interactively from an already-running shell (full boot) instead of (or in addition to) being launched as a boot-time Main-Class. This removes three independent blockers that currently make the installer unusable and aligns the installer with the parts that already work (grub hda0 + cp).

Current design and why it fails

The installer (distr/src/install/) is a boot-time plugin: org.jnode.install.Main → CommandLineInstaller → AbstractInstaller runs GrubInstallerAction + CopyFilesAction, all driven by reading System.in.

Blocker 1 — no console input at boot time. System.in is only initialized by a CommandShell (shell/src/shell/org/jnode/shell/CommandShell.java:226). A boot-time Main-Class never starts a shell, so System.in is empty and the prompt step (getDevice(null) → BufferedReader.readLine) cannot get user input.

Blocker 2 — boot-time reflection invoke crashes the JIT (see #614): mainMethod.invoke(...) at core/src/core/org/jnode/boot/Main.java:95 trips X86RegisterPool.reset → Error: Register(s) in use. So even before the input problem, the installer never starts.

Blocker 3 — GrubInstallerAction.execute() NPEs on every run. The jgrub field (distr/src/install/org/jnode/install/action/GrubInstallerAction.java:40) is never assigned; getInput() creates a local JGrub jgrub (line 50) that shadows the field, so execute() at line 62 calls jgrub.install() on null.

Also: all/conf/install-plugin-list.xml (installer boot plugin set) references a renamed plugin (org.apache.jakarta.commons.net, no longer exists — it is org.apache.commons.net) and is not wired into the build (initjar glob is *plugin-list.xml, the file is *_disabled.xml), and the "JNode Install" GRUB entry is commented out.

Proposal

  1. Add a shell command (e.g. install) in the distr/ project that drives the installer actions from inside an existing shell:
    • Runs GrubInstallerAction / CopyFilesAction (or reuses the shared AbstractInstaller logic) with System.in already bound, and
    • avoids the boot-time reflection-compile path entirely (the command is invoked by the shell’s normal command dispatch, not Main.java reflection of an initjar Main-Class).
  2. Or, minimally: turn the installer into a documented shell recipe built on working primitives — grub <device> (JGrubInstallCommand) to install GRUB, then cp /devices/sg0/jnode32.gz /devices/sg0/full.jgz <target> for the file copy.
  3. Fix the jgrub field-shadowing NPE (assign this.jgrub = jgrub).
  4. Clean up the boot plugin list: refresh plugin IDs (drop org.apache.jakarta.commons.net), prune transitive deps, and wire it into the build so the install CD entry works again.

Scope

Reference

Triage Addendum (auto, 2026-11-21)

  • Area / Kind: area/build + area/shell; kind/feature
  • Blast radius: L5 system (install CD boot menu/ISO packaging plus installer disk writes; QEMU boot proof required)
  • Expected scope: Re-enable the disabled "JNode Install" entries in all/conf/x86/menu-cdrom.lst and menu-cdrom-64.lst (and menu.lst); confirm all/conf/install-plugin-list.xml -> install.jgz initjar wiring in all/build.xml; verify the shell path already present in distr/ (InstallCommand with install alias, this.jgrub = jgrub, org.apache.commons.net). No ASM, no public API, no regression of the boot-time Main path. ~20-60 lines, mostly config.
  • Test path: sh build.sh cd-x86-lite (plus cd-x86_64-lite), boot the ISO in QEMU with a scratch target disk, run install from the shell, confirm GRUB install and file copy.
  • Merge signal: human-review (feature, L5 boot path, disk-write installer)
  • Gaps: Non-blocking: acceptance matrix (32/64-bit, IDE/SCSI target) and whether the install CD entry should boot org.jnode.install.Main or a shell prompt are unspecified; the descriptor currently keeps Main-Class.
  • Full report: ## Triage comment below.

✅ Ticket Runner Status

Field Value
Phase DONE
Turn 0/7
Retries 0/3
PR #984
Review in progress no
Started 2026-11-21T22:32:31.758Z

Activity

  1. added
    kind/feature
    area/builder
    on Aug 17, 2026
  2. LSantha commented on Nov 21, 2026

    @LSantha
    OwnerAuthor

    /run

  3. LSantha commented on Nov 21, 2026

    @LSantha
    OwnerAuthor

    /oc triage issue #615

    Triage run ONLY. Load the jnode-triage-issue skill and obey it. Output is exactly one ## Triage comment plus kind/area label edits. FORBIDDEN in this run: git checkout -b, git push, gh pr create, any branch, any PR.

  4. added
    area/build
    area/shell
    and removed
    area/builder
    on Nov 21, 2026
  5. LSantha commented on Nov 21, 2026

    @LSantha
    OwnerAuthor

    Triage

    • Area: area/build (primary: menu-cdrom*.lst, install-plugin-list.xml, build wiring) + area/shell (InstallCommand alias); area/builder removed - no builder/src involvement
    • Kind: kind/feature
    • Repro: spec pointer - Proposal items 1-4 (shell install command, GrubInstallerAction NPE, plugin-list refresh, install CD menu); blockers JFAT/IDE multi-sector writes to IDE disk deadlock after first sector(s) (cp, grub stage2 copy hang) #613/VM Level1A compiler: 'Register(s) in use' Error at X86RegisterPool.reset during boot-time Main invocation #614 are closed
    • Blast radius: L5 system (install CD menu/ISO packaging plus installer disk writes; QEMU boot proof required)
    • Expected scope: Re-enable "JNode Install" in all/conf/x86/menu-cdrom.lst and menu-cdrom-64.lst (and menu.lst), confirm install-plugin-list.xml -> install.jgz initjar wiring in all/build.xml; shell command/alias and this.jgrub NPE fix already present in distr/; no ASM, public API, or boot-time Main regression; ~20-60 lines, mostly config
    • Test path: sh build.sh cd-x86-lite (plus cd-x86_64-lite), QEMU boot with a scratch target disk, run install, confirm GRUB install and file copy
    • Merge signal: human-review (feature, L5 boot path, disk-write installer)
    • Gaps: non-blocking: acceptance matrix (32/64-bit, IDE/SCSI target) and install-CD launch mode (Main vs shell prompt) unspecified
    • Suggested next: fix
    • Split proposal: none - focused; remaining delta is boot-menu wiring plus boot verification
    • Labels applied: kind/feature (kept); area/build and area/shell added; area/builder removed (no builder/src involvement)

    github run

  6. LSantha commented on Nov 21, 2026

    @LSantha
    OwnerAuthor

    /oc Please proceed with this task.

  7. LSantha commented on Nov 21, 2026

    @LSantha
    OwnerAuthor

    Created PR #984

    github run

  8. added
    agent/done
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/donearea/buildarea/shellkind/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions