Files
bare-operating-system/packages/bare-os-booter
2026-04-03 19:54:49 -04:00
..
2026-04-03 19:54:49 -04:00
2026-04-03 01:37:34 -04:00
2026-04-03 19:54:49 -04:00
2026-04-03 19:54:49 -04:00
2026-04-03 04:01:24 -04:00
2026-04-03 17:36:57 -04:00
2026-04-03 16:29:27 -04:00
2026-04-03 02:49:18 -04:00
2026-04-03 19:54:49 -04:00
2026-04-03 16:29:27 -04:00
2026-04-03 16:29:27 -04:00
2026-04-03 16:29:27 -04:00

bare-os-booter

Pear / Bare application that boots from the network only: joins the same Hyperswarm topic as the seeder, reads MBR block 0 from peers, opens the system Hyperdrive (and a personal namespaced drive), replicates, then runs /boot/init.js with a rich ctx (VFS, shell, identity, HDMS, initd services).

There is no local seed fallback — a running seeder (or another peer with the image) must be reachable within BARE_OS_BOOT_TIMEOUT_MS.

Run

# repo root (links node_modules for Pear)
npm run os:booter

Or:

cd packages/bare-os-booter
node index.js

Major subsystems (lib/)

Module Role
index.js Swarm, SwarmDisk, boot timeout, executeKernel, ctx assembly
swarm-disk.js Peer mux, MBR/read RPC, replication hooks
kernel-runner.js runKernelFromSource, runBinCommand, resolveBinInPath (PATH on system drive)
vfs.js Two-drive routing; mkdir/rmdir (.bareos_empty), chmod, symlink, …
shell.js Tokenize, pipelines, redirections, builtins (unset, readonly, umask, command, type, …), execShellLine
identity-session.js / identity-account.js Guest vs unlocked user, /.bare/account, vault
hdms-manager.js Extra Hyperdrives, mounts under /mnt, Autopass pair/invite
bare-initd.js Service registry, startBareInitd, stopBareInitd, kernel-logger
bare-cron.js ~/.crontab, minute scheduler, ctx.execLine jobs
repl-session.js Fish-style TTY line editor, synced console, cleanup → stopBareInitd
boot-splash.js TTY boot progress UI
fish-readline.js History, completion helpers
cli-readline.js, resolve-stdio.js, debug-repl.js Stdio and debug tooling
paths.js Pear-safe package root and Corestore path

Environment

Variable Meaning
BARE_OS_HOST_DATA Base directory for host state (default ~/.bare-os)
BARE_OS_BOOT_STORE Corestore directory (default ~/.bare-os/corestore/booter)
BARE_OS_LOCAL_SEED Overrides defaultLocalSeedCorestorePath (booter does not local-boot)
BARE_OS_BOOT_TIMEOUT_MS Total time to find peers + load kernel (default 60000)
BARE_OS_NO_SPLASH Disable TTY splash
BARE_OS_SKIP_REPL Non-interactive kernel (readLine → null)
BARE_OS_FISH Set 0 to disable fish-style editor
HYPERSWARM_BOOTSTRAP Optional comma-separated bootstrap nodes (HDMS / replication)

Tests

npm test -w bare-os-booter
  • brittle-bare test.identity.js — crypto account codec (Bare)
  • brittle-node test.js — Hyperdrive, VFS, shell, kernel runner, cron matchers, etc.

Pear staging

pear.stage includes hoisted ../../node_modules. Run scripts/ensure-pear-node-modules.mjs from the repo root before pear run so the app package sees symlinked deps (see root README).

See also