Updates
This commit is contained in:
@@ -32,7 +32,7 @@ It is intentionally **not** a full Node `process` object. Think of it as the “
|
||||
The following are set on `ctx` before the kernel starts (unless noted as overwritten later):
|
||||
|
||||
- **`bareOsCtxApiVersion`** — String semver for the documented **`ctx`** contract (e.g. **`1.10.0`**). Bump in [`bare-os-ctx-api.js`](../packages/bare-os-booter/lib/bare-os-ctx-api.js) when you make breaking changes to stable fields.
|
||||
- **`bareOsRuntimeCaps`** — **Frozen** snapshot from [`bare-os-runtime-caps.js`](../packages/bare-os-booter/lib/bare-os-runtime-caps.js): **`ctxApiVersion`**, simulated **pipeline** limits, **`pseudoFsPaths`**, and **`features`** (including **`jobControl`**, **`shellHereString`**, **`bootReadyPseudoFs`**, **`vfsChown`**, **`auditLog`**, **`initdRequiresWants`**, **`seederRpcExtended`**, **`bareCtxModules`**, **`bareDriveBundles`**, …).
|
||||
- **`bareOsRuntimeCaps`** — **Frozen** snapshot from [`bare-os-runtime-caps.js`](../packages/bare-os-booter/lib/bare-os-runtime-caps.js): **`ctxApiVersion`**, simulated **pipeline** limits, **`pseudoFsPaths`**, and **`features`** (including **`jobControl`**, **`shellHereString`**, **`bootReadyPseudoFs`**, **`bootEventSubscribe`**, **`kernelEventSubscribe`**, **`keyBrokerHandleSketch`**, **`vfsChown`**, **`auditLog`**, **`initdRequiresWants`**, **`seederRpcExtended`**, **`bareCtxModules`**, **`bareDriveBundles`**, …).
|
||||
- **`bareOsPublishBootReady(patch)`** — Kernel-only: merge **`patch`** into the session boot-ready state exposed as **`/run/bare-os/boot.json`** and **`/run/bare-os/ready`**. The booter pre-seeds **`imageDigest`**, **`pearChannel`**, **`pearRelease`** from host env when set (see **`BARE_OS_IMAGE_DIGEST`**, **`BARE_OS_PEAR_CHANNEL`**, **`BARE_OS_PEAR_RELEASE`**, **`PEAR_CHANNEL`**).
|
||||
- **`bareOsSessionStats`** — Mutable **`{ execLineCount, pipelineBytesTotal }`** mirrored in **`/proc/bare_os_session_stats`**.
|
||||
- **`bareOsBootStartedMs`** — Epoch milliseconds when the booter started building the session (used for synthetic **`/proc/uptime`**).
|
||||
@@ -68,6 +68,8 @@ The following are set on `ctx` before the kernel starts (unless noted as overwri
|
||||
- **`runBinCommand(argv)`** — Runs a command with the **same** resolution rules as the interactive shell (used by **`time`**, **`xargs`**, and similar)
|
||||
- **`registerKernelShutdownHook(fn)`** — Register an async or sync function to run when the REPL session ends, **before** **`stopBareInitd`** and initd **disposers**. Pair with **`registerBareInitdDisposer(fn)`** in [`bare-initd.js`](../packages/bare-os-booter/lib/bare-initd.js) when you need teardown **after** shutdown hooks but still inside **`stopBareInitd`** (intervals, sync cleanup).
|
||||
- **`bareOsSubscribeBootEvent(fn)`** / **`bareOsEmitBootEvent(ev)`** — Subscribe to or emit structured boot lifecycle events (same shape as **`BARE_OS_BOOT_TRACE=ndjson`** records). Phase records carry **`lifecycleSchemaVersion: 3`** alongside **`telemetrySchemaVersion`** where applicable (see [kernel extensions](../docs/reference/kernel-extensions.md)).
|
||||
- **`bareOsSubscribeKernelEvent(fn)`** / **`bareOsEmitKernelEvent(ev)`** — Namespaced kernel event bus (e.g. **`topic: 'boot.phase'`**, **`bootStage`**); also mirrored to diagnostics subscribers with **`source: 'kernel'`**.
|
||||
- **`bareOsAcquireKeyHandle(hint?)`** — Key-broker sketch returning an **opaque** handle string (no raw key material in guest).
|
||||
- **`bareOsSubscribeHdmsLifecycle(fn)`** — After HDMS **`activate`** / before **`deactivate`**, run callbacks with **`{ kind, labels? }`**.
|
||||
- **`bareOsAwaitInitdUnits(names, timeoutMs)`** — Resolves when all listed initd units are **`active`** (polls **`getBareServiceRuntime`**); returns **`false`** on timeout.
|
||||
- **`bareOsGetResourceStatus()`** — Returns a plain object snapshot (pipeline limits, exec depth, IPC **`stats()`**, session counters, swarm peer count)—mirrors **`/proc/bare_os_resources`**. Session may include **`execLineWallMsTotal`**.
|
||||
@@ -102,7 +104,7 @@ After [`createKernelReplSession`](../packages/bare-os-booter/lib/repl-session.js
|
||||
- **`ctx.vfs.readFile(path, opts?)`** and **`ctx.vfs.writeFile(path, buf, opts?)`** accept **`signal`/`timeoutMs`** in **`opts`** (writeFile merges with **`executable`**).
|
||||
- **`ctx.console`** is session-scoped.
|
||||
|
||||
**`/run/bare-os/boot.json`** (via **`bareOsPublishBootReady`**) may include **`booterPhases`**: booter milestones (**`vfs`**, **`ctx`**, **`repl`**, **`initd`**, **`kernel_invoke`**) in addition to kernel **`phases`** from the stock [`kernel/init.js`](../kernel/init.js).
|
||||
**`/run/bare-os/boot.json`** (via **`bareOsPublishBootReady`**) may include **`booterPhases`**: booter milestones (**`vfs`**, **`ctx`**, **`repl`**, **`initd`**, **`kernel_invoke`**) in addition to kernel **`phases`** from the stock [`kernel/init.js`](../kernel/init.js). **`subsystems.kernel.bootPhases`** lists **`{ label, bootStage }`** for each completed kernel phase, and **`subsystems.kernel.programProc`** may include **`schema: 2`**, **`programVersion: 2`**, **`bootDryRun`**.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user