Skip to content

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

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.MainCommandLineInstallerAbstractInstaller 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.resetError: 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/builderbuilder/ — BootImageBuilder, JNasm, plugin descriptor tools.kind/featureNew feature or enhancement request.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions