Updates
This commit is contained in:
+8
-6
@@ -350,8 +350,10 @@ Pear-safe path resolution (same idea as Holepunch [pear-rti](https://github.com/
|
||||
- **`applyLogin({ publicKey, secretKey })`** — set session from an already-decoded keypair.
|
||||
- **`applyLogout({ save? })`** — optional **`save`** runs encrypted vault snapshot first (see `identity-session.js`).
|
||||
- **`saveVault()`** — encrypt personal-drive files into `/.bare/vault/` (skips `/.bare`, `bin`, `boot`, history paths).
|
||||
- **`registerKernelShutdownHook(fn)`** — register async/sync teardown before **`stopBareInitd`** when the REPL session cleans up.
|
||||
- After **`createKernelReplSession`**: wires **`readLine`**, **`console`**, **`execLine`**, **`suspendReplForSubprocess`** / **`resumeReplAfterSubprocess`**, then **`await startBareInitd(ctx)`** (services such as kernel log mirroring).
|
||||
- Sets `disk.os` with stub `searchLocal` ([]) and `execRpc` (`''`).
|
||||
- `runKernelFromSource(b4a.toString(initSource), ctx)`.
|
||||
- `try { await runKernelFromSource(...) } finally { await session.cleanup() }` — cleanup runs **`runKernelShutdownHooks`**, **`stopBareInitd`**, fish TTY teardown.
|
||||
|
||||
**`boot-splash.js`** — TTY splash (disabled when `stdout` is not a TTY or `BARE_OS_NO_SPLASH=1`): full-screen clear, Braille spinner, elapsed boot timer, progress bar vs `BARE_OS_BOOT_TIMEOUT_MS` (default 60s), rotating title color, status lines. `prepareForKernel()` clears again and shows the cursor before the fish shell.
|
||||
|
||||
@@ -429,8 +431,8 @@ Pear-safe path resolution (same idea as Holepunch [pear-rti](https://github.com/
|
||||
### 12.7 [packages/bare-os-booter/lib/shell.js](packages/bare-os-booter/lib/shell.js)
|
||||
|
||||
- **`defaultShellAliases`** — includes `ll`, `la`, `l`, `..`, `...` as the baseline merged from **`~/.barerc`**.
|
||||
- **`tokenize` / `expandWord` / `parsePipeline`** — POSIX-ish words, `'...'`, `"..."`, `\`, `|`, `>`, `>>`, `<`; `$VAR` and `${VAR}`; pipelines split on `|`.
|
||||
- **`execShellLine(ctx, line)`** — per-simple-command: leading `NAME=value` assignments (blocked for `ctx.shellReadonlyVars`), redirections, builtins `alias`, `unalias`, `cd`, `export`, `unset`, `readonly`, `umask`, `:`, `command`, `type`, `login`, `logout`, `exit`, else `runBinCommand`. `command -v`/`-V` and `type` use **`resolveBinInPath`**. `login`/`logout` call the same `ctx.applyRegister` / `ctx.applyUnlock` / `ctx.applyLogout` hooks as `/bin/login` and `/bin/logout`. Captures `console.log` for pipes and file redirection; `>` / `>>` target paths via `ctx.vfs.writeFile` (personal tree). Returns `'exit'` when the `exit` builtin runs.
|
||||
- **`tokenize` / `expandWord` / `parsePipeline`** — POSIX-ish words, `'...'`, `"..."`, `\`, `|`, `||`, `&&`, `;`, `>`, `>>`, `<`; `$VAR` and `${VAR}`; pipelines split on `|`; **`;`** splits lists; **`&&`** / **`||`** short-circuit using **`ctx.exitCode`** (left-associative).
|
||||
- **`execShellLine(ctx, line)`** — semicolon-separated lists, then per segment AND-OR chains of pipelines; leading `NAME=value` assignments (blocked for `ctx.shellReadonlyVars`), redirections, builtins `alias`, `unalias`, `cd`, `export`, `unset`, `readonly`, `umask`, `:`, `command`, `type`, `login`, `logout`, `exit`, else `runBinCommand`. `command -v`/`-V` and `type` use **`resolveBinInPath`**. `login`/`logout` call the same `ctx.applyRegister` / `ctx.applyUnlock` / `ctx.applyLogout` hooks as `/bin/login` and `/bin/logout`. Captures `console.log` for pipes and file redirection; `>` / `>>` target paths via `ctx.vfs.writeFile` (personal tree). Returns `'exit'` when the `exit` builtin runs. Lone **`&`** (job control) is rejected with a clear error.
|
||||
|
||||
### 12.8 [packages/bare-os-booter/lib/identity-account.js](packages/bare-os-booter/lib/identity-account.js)
|
||||
|
||||
@@ -511,9 +513,9 @@ sequenceDiagram
|
||||
| Area | Status |
|
||||
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -------------------------------------------------------------- |
|
||||
| **VFS** | Two-drive unified paths; `$HOME` → personal Hyperdrive; writable mounts under `/mnt` when HDMS allows. **`mkdir`/`rmdir`**, **`chmod`** (octal + symbolic subset), **`symlink`/`readlink`**, **`stat`/`lstat`**, **`rm`** recursive. Empty dirs use **`.bareos_empty`** (same idea as `git-fs-adapter`). |
|
||||
| **Shell** | Pipelines `\|`, redirects `>`/`>>`/`<`, quoting, `$VAR`/`${VAR}`, builtins: **`alias`**, **`unalias`**, **`cd`**, **`export`**, **`unset`**, **`readonly`**, **`umask`**, **`:`**, **`command`**, **`type`**, **`login`**, **`logout`**, **`exit`**. No \*\*`&&`/` | | `**, job control, functions, or full POSIX **`sh`\*\* grammar. |
|
||||
| **Ownership** | Display and permission checks use **`UID`/`GID`** and mode bits; **`chown`/`chgrp`** are stubs (no multi-user ownership changes). |
|
||||
| **Utilities** | Tier-1 JS **`/bin`** (see §12.10): includes **`man`**, **`sed`**, **`awk`**, **`cp`**, **`mv`**, **`find`**, **`cksum`**, etc. Large **`sed`/`awk`** are not byte-identical to GNU on all inputs. **`xargs`**, **`getconf`**, **`mkfifo`** are stubs. **`test`** sets **`ctx.exitCode`**; the shell does not branch on it for **`&&`**. Online help: **`/share/man/man.json`** and **`man`**. |
|
||||
| **Shell** | Pipelines `\|`, list separator **`;`**, short-circuit **`&&`** / **`||`**, redirects `>`/`>>`/`<`, quoting, `$VAR`/`${VAR}`, builtins: **`alias`**, **`unalias`**, **`cd`**, **`export`**, **`unset`**, **`readonly`**, **`umask`**, **`:`**, **`command`**, **`type`**, **`login`**, **`logout`**, **`exit`**. Branching uses **`ctx.exitCode`**. No job control, functions, or full POSIX **`sh`** grammar. |
|
||||
| **Ownership** | Display and permission checks use **`UID`/`GID`** and mode bits; **`chown`/`chgrp`** are stubs (no multi-user ownership changes). |
|
||||
| **Utilities** | Tier-1 JS **`/bin`** (see §12.10): includes **`man`**, **`sed`**, **`awk`**, **`cp`**, **`mv`**, **`find`**, **`cksum`**, **`getconf`** (fixed variable table + **`-a`**), **`xargs`** (bounded; **`ctx.runBinCommand`**; **`-0`**, **`-n`**), etc. Large **`sed`/`awk`** are not byte-identical to GNU on all inputs. **`mkfifo`** is a stub. Online help: **`/share/man/man.json`** and **`man`**. |
|
||||
|
||||
**Handbook:** [handbook/09-posix-utilities-shell-and-vfs.md](handbook/09-posix-utilities-shell-and-vfs.md) — narrative catalog, engine notes, and Issue 7 alignment. **Manual pages:** [handbook/10-manpages-and-online-help.md](handbook/10-manpages-and-online-help.md).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user