feat: shell PATH resolution, env propagation, /etc/bshrc#233
Merged
Conversation
…bshrc Replace the hardcoded PROGRAM_REGISTRY in init_shell with dynamic PATH-based command resolution using $PATH environment variable. Both init_shell and bsh now properly search /bin:/sbin:/usr/local/cbin for executables. - Delete ProgramEntry/PROGRAM_REGISTRY (20 hardcoded entries) from init_shell - Add resolve_command() that searches $PATH via sys_access() - Pass real envp (from std::env::vars()) to child processes via execve - Add export/env builtins to init_shell for environment management - Update bsh default_path() to include /sbin and /usr/local/cbin - Create /etc/bshrc on ext2 image (ECMAScript config for bsh shell) - Fix HOME=/ to HOME=/home in kernel default environment (3 locations) Co-Authored-By: Ryan Breen <ryanbreen@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$PATH-based command resolution viaresolve_command()usingsys_access()try_execute_external()andexecute_pipeline_command()(was passing empty envp)export/envbuiltins to init_shell for environment variable managementdefault_path()to include/sbinand/usr/local/cbin(was missing both)/etc/bshrcon ext2 image — ECMAScript startup config for bsh (sets PATH, HOME, SHELL, HOSTNAME, prints welcome)HOME=/→HOME=/homein kernel default environment (fixes env_musl_test failure)Test plan
cargo build --release --features testing,external_test_bins --bin qemu-uefi)./docker/qemu/run-boot-parallel.sh 1exportandenvbuiltins work in init_shellenv_musl_testpasses (HOME=/home)/etc/bshrcon startup🤖 Generated with Claude Code