kernel — system image sources
Files in this directory are read from disk by the seeder (or copied into packages/bare-os-seeder/kernel/ for Pear) and written into the system Hyperdrive with no temporary directory on the host.
Staging map (seeder)
| Source | Drive path |
|---|---|
init.js |
/boot/init.js |
bin/<name> |
/bin/<name> |
etc/... |
/etc/... |
share/man/... |
/share/man/... |
| Any other file | /<relative path> |
Contents
init.js— Kernel entry: must defineasync function start(ctx). Boot order:/etc/os-release→/etc/motd→ optional/etc/bare-os/rc.profile.<profile>(profile fromBARE_OS_BOOT_PROFILEor first line of/etc/bare-os/profile; the booter mirrors the resolved name inctx.env.BARE_OS_BOOT_PROFILE_RESOLVEDand/run/bare-os/boot_profile) →/etc/bare-os/rc→/etc/bare-os/rc.d/*(sorted; only names starting with a digit, plus skips dotfiles,*~,README*,*.md) → optional/etc/bare-os/rc.local→/etc/bare-os/kernel.d/*(same rules asrc.d) → banner → whenBARE_OS_SKIP_REPL, optional onboot lines fromBARE_OS_ONBOOT(newline-separated) or/etc/bare-os/onboot(file order) →readLine/execLineloop (boot snippet errors are logged, not fatal). Custom kernels may callctx.registerKernelShutdownHook(fn)before initd disposers; usectx.bareOsRuntimeCapsfor limits, pseudo paths, andfeatures(developer-guide/02-the-context-object.md).bin/— Tier-1 utilities built by bare-os-coreutils. Each file isruntime.js+ optionallib/*-engine.js(sed,awk) orlib/man-render.js(man) +async function run(ctx, argv)(no ESMimportinsrc/).share/man/man.json— Merged manual database for/bin/man(built bybare-os-coreutils; see handbook ch.10).etc/os-release— Static OS metadata (NAME,VERSION, …).etc/motd— Optional message printed afteros-release(distributors can customize).etc/bare-os/banneror/etc/issue— If present on the system drive, the default kernel prints one of these instead of the built-in session hint (unlessBARE_OS_SKIP_REPLshortens the banner). SetBARE_OS_BOOT_TRACE=1ortruefor[boot] phase: Nmslines on stderr, orjsonfor{"phase":"…","ms":n}per phase.etc/bare-os/rc— Optional boot snippet: oneexecLineper non-comment line (trusted).etc/bare-os/rc.d/— Optional extra snippets (basename must start with a digit), same line rules, run afterrcin filename order. Human-oriented notes live in.README(a dotfile so legacyinit.jsnever executes it).
Editing workflow
- Change sources under
kernel/orpackages/bare-os-coreutils/src/. - Run
npm run build -w bare-os-coreutilsto refreshkernel/bin/*. - Run seeder again to re-stage the drive (or use a fresh Corestore for a clean image).
Pear bundles use the vendored tree under packages/bare-os-seeder/kernel/; keep it in sync by running the same build before pear stage. npm test runs scripts/verify-kernel-seeder-parity.mjs (after bare-os-coreutils build) so the two trees match byte-for-byte.