Skip to content

examples/lvglterm: Let the shell be named something other than nsh. - #3709

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
Fishwaldo:upstream-lvglterm-shell
Aug 8, 2026
Merged

examples/lvglterm: Let the shell be named something other than nsh.#3709
xiaoxiang781216 merged 1 commit into
apache:masterfrom
Fishwaldo:upstream-lvglterm-shell

Conversation

@Fishwaldo

Copy link
Copy Markdown
Contributor

Summary

  • examples/lvglterm spawned "nsh" by a name compiled in. On a system
    that installs NSH under a different name it finds nothing: the terminal
    comes up, takes keystrokes, and has no shell behind it.
  • A kernel build where NSH is the system's init is exactly that case. The
    program is /system/bin/init and no nsh exists at all.
  • The name is now CONFIG_EXAMPLES_LVGLTERM_SHELL, defaulting to "nsh",
    so existing configurations are unchanged. A bare name is looked up on
    PATH as before, and a path is taken as given.
  • No related issue filed.

Impact

  • Is new feature added? Is existing feature changed? CHANGED,
    additively. One new Kconfig string with the previous hardcoded value as
    its default.
  • Impact on user? NO unless they want the new behaviour. The default
    reproduces the old string exactly.
  • Impact on build? NO.
  • Impact on hardware? NO.
  • Impact on documentation? NO, beyond the Kconfig help text included.
  • Impact on security? NO. The name comes from build-time configuration,
    not from input, and is passed to the same posix_spawn() as before.
  • Impact on compatibility? NO. Default-identical.
  • Build-mode dependence? NO. The defect is reachable in any build where
    NSH is installed under another name; a kernel build with NSH as init is
    simply the common way to arrive there.

Testing

I confirm that changes are verified on local setup and works as intended:

  • Build Host: macOS 26.5.1, arm64 (Apple Silicon), xPack riscv-none-elf-gcc
    15.2.0
  • Target: RISC-V, ESWIN EIC7700X EVB (downstream board port, not yet
    upstream), kernel build with NSH as init at /system/bin/init, LVGL on
    an HDMI framebuffer with a USB keyboard

Testing logs before change: the terminal starts and accepts keystrokes, but
the spawn finds no such program:

[CPU2] romfs_open: ERROR: Failed to find directory directory entry for 'nsh': -2

After the change, with CONFIG_EXAMPLES_LVGLTERM_SHELL set to
"/system/bin/init", the shell spawns and its prompt appears in the
terminal widget.

Being straight about the evidence on that last point: the terminal renders
into the framebuffer rather than to the serial console, so the result was
confirmed visually on the monitor and there is no console capture to paste.
The board it was confirmed on also carried two local fixes to LVGL's NuttX
driver glue for kernel builds, which are third-party files fetched at build
time and are not part of this PR. Neither is needed for the change here to
be correct: it replaces one compiled-in string with a configurable one whose
default is that same string.

PR verification Self-Check

  • This PR introduces only one functional change.
  • I have updated all required description fields above.
  • My PR adheres to Contributing Guidelines and Documentation.
  • My PR is still work in progress (not ready for review).
  • My PR is ready for review and can be safely merged into a codebase.

Claude (claude-opus-5) assisted with diagnosing this and with authoring the
code comment and this PR description. The commit carries an Assisted-by: tag
per CONTRIBUTING.md §1.5.

The terminal spawned "nsh" by a name compiled in, which finds nothing
on a system that installs NSH under another name, as a kernel build
does when NSH is the system's init: the program is /system/bin/init
and no "nsh" exists at all.  The terminal came up,
took keystrokes, and had no shell behind it.

The name is now configurable and still defaults to "nsh", so a bare
name is looked up on PATH as before and a path is taken as given.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
@xiaoxiang781216
xiaoxiang781216 merged commit 30a028d into apache:master Aug 8, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants