buninu-linux 0.13.56 → 0.15.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSES/linux-firmware/LICENCE.nvidia +131 -0
- package/LICENSES/linux-firmware/LICENSE.amdgpu +51 -0
- package/LICENSES/linux-firmware/LICENSE.amdisp +31 -0
- package/LICENSES/linux-firmware/LICENSE.i915 +39 -0
- package/LICENSES/linux-firmware/LICENSE.radeon +51 -0
- package/LICENSES/linux-firmware/LICENSE.xe +39 -0
- package/LICENSES/linux-firmware/WHENCE +10280 -0
- package/NOTICE.md +64 -46
- package/README.md +410 -96
- package/README.zh.md +2034 -0
- package/build-image.sh +10 -1
- package/build-uki.sh +3 -1
- package/fetch-alpine.sh +15 -1
- package/graphics.md +31 -0
- package/index.js +28 -11
- package/initramfs/bin/buninu-browser +4 -1
- package/initramfs/bin/buninu-land +1 -1
- package/initramfs/bin/bunterm +3 -3
- package/initramfs/bin/chroot +13 -0
- package/initramfs/bin/chvt +11 -0
- package/initramfs/bin/dhclient +8 -0
- package/initramfs/bin/mount +4 -0
- package/initramfs/bin/ping +8 -0
- package/initramfs/bin/umount +6 -0
- package/initramfs/bin/xdg-open +33 -0
- package/initramfs/buninu/CHANGELOG.md +19 -0
- package/initramfs/buninu/apps/bunmsh/CHANGELOG.md +4 -0
- package/initramfs/buninu/apps/bunmsh/package.json +1 -1
- package/initramfs/buninu/apps/bunmsh/src/main.js +1 -1
- package/initramfs/buninu/apps/jsgotty/README.en.md +40 -0
- package/initramfs/buninu/apps/jsgotty/README.md +40 -0
- package/initramfs/buninu/apps/jsgotty/package-lock.json +2 -2
- package/initramfs/buninu/apps/jsgotty/package.json +1 -1
- package/initramfs/buninu/apps/jsgotty/static/index.html +1 -0
- package/initramfs/buninu/apps/jsgotty/static/js/gotty.js +82 -17
- package/initramfs/buninu/apps/jsgotty/static/js/kitty-keyboard.js +193 -0
- package/initramfs/buninu/apps/jsgotty/tests/android-alt.test.js +115 -0
- package/initramfs/buninu/apps/jsgotty/tests/arrow-modifiers.test.js +80 -0
- package/initramfs/buninu/apps/jsgotty/tests/kitty-keyboard-browser.test.js +53 -0
- package/initramfs/buninu/apps/jsgotty/tests/kitty-keyboard.test.js +102 -0
- package/initramfs/buninu/apps/jsgotty/tests/manual/README.md +20 -0
- package/initramfs/buninu/apps/jsgotty/tests/manual/keyboard-collector.cjs +55 -0
- package/initramfs/buninu/apps/jsgotty/tests/manual/keyboard-debug.js +74 -0
- package/initramfs/buninu/apps/jsgotty/tests/manual/kitty-keyboard.js +80 -0
- package/initramfs/buninu/package.json +1 -1
- package/initramfs/init.js +27 -10
- package/initramfs/lib/bunterm/clipboard.js +14 -0
- package/initramfs/lib/bunterm/commands.js +37 -0
- package/initramfs/lib/bunterm/fps.js +38 -0
- package/initramfs/lib/bunterm/images.js +9 -5
- package/initramfs/lib/bunterm/input.js +58 -15
- package/initramfs/lib/bunterm/keyboard.js +62 -0
- package/initramfs/lib/bunterm/keycodes.js +104 -0
- package/initramfs/lib/bunterm/kitty-keyboard.cjs +195 -0
- package/initramfs/lib/bunterm/raw-protocol.js +33 -0
- package/initramfs/lib/bunterm/renderer.js +90 -21
- package/initramfs/lib/bunterm/selection.js +60 -0
- package/initramfs/lib/bunterm/terminal.js +147 -12
- package/initramfs/lib/bunterm/vt-menu.js +181 -0
- package/initramfs/lib/bunterm/vt.js +27 -1
- package/initramfs/lib/canvas.js +99 -0
- package/initramfs/lib/chvt.js +31 -0
- package/initramfs/lib/dhclient.js +135 -0
- package/initramfs/lib/dhcp-start.js +85 -0
- package/initramfs/lib/dhcp-transport.js +44 -0
- package/initramfs/lib/dhcp.js +124 -0
- package/initramfs/lib/dlopen.js +58 -11
- package/initramfs/lib/fbdev.js +21 -3
- package/initramfs/lib/gpu.js +77 -0
- package/initramfs/lib/ping.js +110 -0
- package/initramfs/lib/raw-image.js +47 -0
- package/initramfs/lib/xdg-open.js +42 -0
- package/initramfs/usr/share/doc/buninu-linux/bunterm.md +86 -12
- package/initramfs/usr/share/doc/buninu-linux/chvt.md +34 -0
- package/initramfs/usr/share/doc/buninu-linux/dhclient.md +82 -0
- package/initramfs/usr/share/doc/buninu-linux/ping.md +91 -0
- package/initramfs/usr/share/doc/buninu-linux/xdg-open.md +43 -0
- package/package.json +2 -2
- package/scripts/arch.js +7 -5
- package/scripts/arch.sh +5 -5
- package/scripts/build.js +16 -3
- package/scripts/fetch-gpu.js +105 -0
- package/scripts/fetch.js +11 -1
- package/scripts/gpu-firmware.json +22 -0
- package/scripts/modules.js +5 -1
- package/scripts/npm-packages.md +17 -17
- package/test/bunterm-fps.test.js +17 -0
- package/test/bunterm-keyboard.test.js +116 -0
- package/test/bunterm-next-vt.test.js +9 -0
- package/test/bunterm-raw-protocol.test.js +19 -0
- package/test/bunterm-renderer.test.js +158 -0
- package/test/bunterm-selection.test.js +38 -0
- package/test/bunterm-vt-menu.test.js +178 -0
- package/test/chroot-bind.test.js +40 -2
- package/test/chvt.test.js +46 -0
- package/test/dhcp-start.test.js +67 -0
- package/test/dhcp.test.js +99 -0
- package/test/fbdev-sync.test.js +33 -0
- package/test/fetch-npm.test.js +1 -1
- package/test/gpu.test.js +155 -0
- package/test/image-size.test.js +17 -0
- package/test/libc.test.js +41 -0
- package/test/manual-bunterm-image-paths.js +31 -0
- package/test/mount-libc-lifetime.test.js +50 -0
- package/test/no-gpu.test.js +43 -0
- package/test/ping.test.js +80 -0
- package/test/readme-cli.test.js +29 -0
- package/test/stage-npm.test.js +11 -4
- package/test/xdg-open.test.js +55 -0
package/README.md
CHANGED
|
@@ -28,17 +28,20 @@
|
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
+
- [繁體中文](README.zh.md)
|
|
31
32
|
- [Table of contents](#contents)
|
|
33
|
+
- Terminal documentation: `bun x buninu-linux --readme` (English),
|
|
34
|
+
`bun x buninu-linux --readme-zh` or `--docs` (Traditional Chinese).
|
|
32
35
|
- .
|
|
33
36
|
- Still in the early stages
|
|
34
37
|
- [Video here](https://www.reddit.com/r/bun/comments/1wkpraj/buninu_linux_a_distro_with_bun_as_pid_1): Booted successfully on real x86-64 UEFI hardware with `--real`:
|
|
35
38
|
* Bun reaches its interactive REPL
|
|
36
39
|
* `start` starts the Buninu userspace shell
|
|
37
40
|
* `cfg.disk` + shell `mount` mounts local disks
|
|
38
|
-
* `cfg.net` loads common wired NIC and Android USB-tethering drivers
|
|
41
|
+
* `cfg.net` loads common wired NIC and Android USB-tethering drivers and automatically attempts DHCP configuration
|
|
39
42
|
* `cfg.sound` loads every packaged ALSA sound module
|
|
40
43
|
* Android phone USB tethering over RNDIS has been tested successfully, allowing Buninu Linux to access the Internet through an Android phone
|
|
41
|
-
*
|
|
44
|
+
* After a DHCP lease expires or when you need fresh network settings, run `dhclient usb0` (using your interface name). Manual configuration with `ip` remains available.
|
|
42
45
|
* The bundled `jmi` editor, jsmdcui App runtime, and local JavaScript execution also work.
|
|
43
46
|
* Multi-tasking with kernel VT or jsmdcui
|
|
44
47
|
+ See [Multitasking modes](#multitasking-modes)
|
|
@@ -117,6 +120,20 @@ bun ./index.js -fb --real --export
|
|
|
117
120
|
This fetches the pinned Alpine/Bun/npm inputs, selects the physical-hardware
|
|
118
121
|
modules, builds `vda.img`, and exports `buninu-linux-<version>.img`.
|
|
119
122
|
|
|
123
|
+
For a smaller image, add `--no-gpu` to either build command:
|
|
124
|
+
|
|
125
|
+
```sh
|
|
126
|
+
bun x buninu-linux -fb --real --no-gpu --export
|
|
127
|
+
# From a source checkout:
|
|
128
|
+
bun ./index.js -fb --real --no-gpu --export
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The reference x86-64 `--real` builds produce a **128 MiB** image with
|
|
132
|
+
`--no-gpu`, versus **320 MiB** with the default GPU modules and firmware.
|
|
133
|
+
This omits the optional GPU bundle while retaining the framebuffer/bunterm
|
|
134
|
+
software display path. Image size is calculated from the packaged contents
|
|
135
|
+
and may change with later versions.
|
|
136
|
+
|
|
120
137
|
#### Write the image to a USB drive
|
|
121
138
|
|
|
122
139
|
The recommended method is **Ventoy**: install it on the USB drive once using
|
|
@@ -197,7 +214,7 @@ display and USB keyboard with a welcome ending like this:
|
|
|
197
214
|
Welcome to Buninu Linux!
|
|
198
215
|
Bun 1.4.2 is now PID 1
|
|
199
216
|
Type start() to run buninu --local
|
|
200
|
-
Configuration getters: cfg.all, cfg.disk, cfg.net, cfg.power, cfg.sound
|
|
217
|
+
Configuration getters: cfg.all, cfg.disk, cfg.net, cfg.power, cfg.sound, cfg.gpu
|
|
201
218
|
|
|
202
219
|
bun-repl>
|
|
203
220
|
```
|
|
@@ -227,8 +244,7 @@ It supports Chinese text, emoji and the browser's terminal graphics. Use
|
|
|
227
244
|
`Ctrl+Alt+F1` to return to the original console and `Ctrl+Alt+F2` to return
|
|
228
245
|
to this terminal.
|
|
229
246
|
|
|
230
|
-
|
|
231
|
-
described under [Basic configuration](#basic-configuration). Run `poweroff` for a synced
|
|
247
|
+
Run `poweroff` for a synced
|
|
232
248
|
shutdown. After editing the initramfs, `bun ./index.js -b --real --export` rebuilds the
|
|
233
249
|
image; `-h` lists all flags.
|
|
234
250
|
|
|
@@ -327,9 +343,8 @@ toolchain (including `binutils-aarch64-linux-gnu` for aarch64), or set
|
|
|
327
343
|
|
|
328
344
|
`start()` in the serial REPL, then `bunterm 2` opens bunterm on VT 2 in the
|
|
329
345
|
QEMU window and returns to the serial shell; type into the window. The
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
detached (see [Multiple virtual consoles with bunterm](#multiple-virtual-consoles-with-bunterm)). The
|
|
346
|
+
bare `bunterm` also defaults to VT 2, leaving VT 1 available for hardware
|
|
347
|
+
setup. Using a VT other than the active one starts it detached (see [Multiple virtual consoles with bunterm](#multiple-virtual-consoles-with-bunterm)). The
|
|
333
348
|
firmware sets up ramfb at 800×600, and `init.js` loads `simpledrm` so it
|
|
334
349
|
becomes `/dev/fb0` (see [graphics.md](graphics.md#trying-it)).
|
|
335
350
|
* `--export` writes `buninu-linux-<version>-aarch64.img`.
|
|
@@ -384,9 +399,16 @@ cfg.power
|
|
|
384
399
|
cfg.sound
|
|
385
400
|
```
|
|
386
401
|
|
|
387
|
-
`cfg.net` loads the packaged wired-network and Android USB-tethering drivers
|
|
388
|
-
interfaces and MAC addresses
|
|
389
|
-
|
|
402
|
+
`cfg.net` loads the packaged wired-network and Android USB-tethering drivers,
|
|
403
|
+
prints detected interfaces and MAC addresses, and automatically attempts DHCP
|
|
404
|
+
configuration. If it succeeds, no additional DHCP command is needed.
|
|
405
|
+
|
|
406
|
+
After a lease expires or when you need to obtain network settings again,
|
|
407
|
+
enter the Buninu shell with `start()` and run `dhclient usb0` (replace `usb0`
|
|
408
|
+
with your interface name). It configures the interface once and exits;
|
|
409
|
+
there is no automatic renewal.
|
|
410
|
+
|
|
411
|
+
For a manually configured static address, use:
|
|
390
412
|
|
|
391
413
|
```sh
|
|
392
414
|
ip link set eth0 up
|
|
@@ -408,6 +430,120 @@ mount -fv /dev/sda1 /mnt
|
|
|
408
430
|
|
|
409
431
|
Run `poweroff` for a synced shutdown.
|
|
410
432
|
|
|
433
|
+
### Using bunterm
|
|
434
|
+
|
|
435
|
+
Click the FPS button on the right of the bunterm menu title to toggle a cyan counter at the top-right of the terminal. It reports newly presented Kitty image frames per second (such as Casty/Land output), sampled once per second; mouse/menu redraws are excluded. Static images and text-only sessions show 0 FPS. The setting is local to this bunterm session and defaults off.
|
|
436
|
+
|
|
437
|
+
Native bunterm advertises its preferred raw pixel format from the framebuffer bitfields: BGRA or RGBA for supported 32-bit layouts, otherwise PNG. Updated Casty, buninu-browser and Land negotiate this automatically over shared-file Kitty transport; BGRA uses the private format `f=1111970369`, RGBA uses standard `f=32`. Other terminals and jsgotty retain their existing protocol.
|
|
438
|
+
|
|
439
|
+
To inspect the current picture path in Casty, press `Ctrl-E`, type `kitty`,
|
|
440
|
+
and press Enter. In Land, click **@** instead to open the command line.
|
|
441
|
+
For example, `Kitty: file · format=bgra` reports shared-file raw frames;
|
|
442
|
+
`rgba` is also raw, while PNG/JPEG indicate encoded images. Raw is negotiated
|
|
443
|
+
automatically with supported local peers; no extra launch flag is needed.
|
|
444
|
+
The bunterm FPS counter measures presented images, not a client's rendering FPS.
|
|
445
|
+
|
|
446
|
+
`bunterm` is the graphical terminal on the Linux framebuffer. It displays CJK
|
|
447
|
+
text, colour emoji and Kitty graphics without starting X11 or Wayland. On the
|
|
448
|
+
real-hardware image, enter the shell with `start()` at the `bun-repl>` prompt,
|
|
449
|
+
then run:
|
|
450
|
+
|
|
451
|
+
```sh
|
|
452
|
+
bunterm # open a new VT after the last session; first is tty2
|
|
453
|
+
bunterm 3 -s 16 # another session, with a 16 px font (default: 13)
|
|
454
|
+
# Alternatively, start a specific application on an unused VT:
|
|
455
|
+
bunterm 4 -e jsmdcui --allow-url README.md
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
To open a web URL or an existing local file in a new browser terminal:
|
|
459
|
+
|
|
460
|
+
```sh
|
|
461
|
+
xdg-open https://buninu.org
|
|
462
|
+
xdg-open "./page with spaces.html"
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
`xdg-open` runs `bunterm -e buninu-browser URL` on a new VT. HTTP/HTTPS URLs
|
|
466
|
+
and `about:` URLs open directly; local paths and `file://` URLs are resolved to existing regular
|
|
467
|
+
files and encoded as absolute file URLs. Directories and other URL schemes
|
|
468
|
+
are not supported. Run `xdg-open --help` for usage.
|
|
469
|
+
|
|
470
|
+
Use `Ctrl+Alt+F1` to return to the initial console, `Ctrl+Alt+F2` to return to
|
|
471
|
+
VT 2, or `Alt+Left` / `Alt+Right` to switch VTs. From a shell, `chvt 1` and
|
|
472
|
+
`chvt 2` do the same. Switching preserves the running sessions; exiting a
|
|
473
|
+
session's shell or application ends that bunterm.
|
|
474
|
+
|
|
475
|
+
Click the screen's top-left **2×2 pixels** to open its menu:
|
|
476
|
+
|
|
477
|
+
| Control | Usage |
|
|
478
|
+
| --- | --- |
|
|
479
|
+
| 🔤 Font − / + | Resize the current session's text and terminal grid. The size is centred between the buttons. |
|
|
480
|
+
| 📋 Copy | Left-drag to select terminal text, then copy it to the shared xclip clipboard. Selection is available only when the application has not enabled mouse reporting. |
|
|
481
|
+
| 📥 Paste | Paste from xclip. Applications that enable bracketed paste receive its delimiters; other applications receive plain text. |
|
|
482
|
+
| Command input | Click the light input field or press Tab. Type `font 16`, `font +`, `font -`, `copy`, `paste`, `vt 2` or `help`, then press Enter. These are local bunterm commands. |
|
|
483
|
+
| VT list | Switch to an existing bunterm or the initial tty. The active VT is marked `(current)`. |
|
|
484
|
+
| + New bunterm | Start bunterm on the tty after the highest listed number, using the current font size. |
|
|
485
|
+
|
|
486
|
+
Press Esc to close the menu. Font changes last for the current session.
|
|
487
|
+
The mouse wheel scrolls terminal history when the application does not request
|
|
488
|
+
mouse events. `--no-mouse` disables mouse input and the menu;
|
|
489
|
+
`--no-clipboard` disables both menu clipboard actions and OSC 52.
|
|
490
|
+
See [Clipboard](#clipboard) for sharing text between applications.
|
|
491
|
+
|
|
492
|
+
**Kitty keyboard:** applications can negotiate flags **1, 2 and 8**, using the
|
|
493
|
+
same encoder as jsgotty, to distinguish Ctrl/Alt/Shift/Super combinations and
|
|
494
|
+
request press, repeat and release events. No launch flag is needed. Ordinary
|
|
495
|
+
applications retain the console's translated input; the original keyboard mode is restored
|
|
496
|
+
when the application disables Kitty or bunterm exits. VT-switching shortcuts stay
|
|
497
|
+
reserved. Dead-key/Compose sequences are not yet implemented in Kitty mode.
|
|
498
|
+
Use `bunterm --help` for full options and keyboard details.
|
|
499
|
+
|
|
500
|
+
### Using Bun Modern Shell
|
|
501
|
+
|
|
502
|
+
bunmsh is the dependency-free, mksh-inspired shell bundled with Buninu. Its
|
|
503
|
+
main features are:
|
|
504
|
+
|
|
505
|
+
- Lines beginning with `Bun.*` run as JavaScript; returned values are printed
|
|
506
|
+
and promises are awaited automatically. Use `Bun.e;` or `Bun.e,` for
|
|
507
|
+
arbitrary JavaScript.
|
|
508
|
+
- Lightweight cwd tabs keep several working directories ready. In bunmsh,
|
|
509
|
+
`Ctrl-T` creates or cycles right through tabs, while `Alt-T` cycles left.
|
|
510
|
+
* Also useful cmds: `tab n`, `tab c`(Alt-C)
|
|
511
|
+
- Shell variables and JavaScript share a live variable table by `$.`, and `Bun.sha`
|
|
512
|
+
can retain JavaScript values across commands and cwd tabs.
|
|
513
|
+
- Saved history, Bash/Fish history import, completions, and ghost suggestions
|
|
514
|
+
are available interactively.
|
|
515
|
+
- `serve [directory]` starts a browsable HTTP file server. Together with
|
|
516
|
+
Android USB tethering, it provides a simple way to transfer files between
|
|
517
|
+
Buninu Linux and the connected phone.
|
|
518
|
+
- Cross-platform builtins and PATH-fallback commands.
|
|
519
|
+
- `Ctrl-U` removes and saves the text before the cursor; press it again at the
|
|
520
|
+
beginning of the line to restore it. `Ctrl-K` independently toggles the text
|
|
521
|
+
after the cursor when at the end of the line.
|
|
522
|
+
- Unquoted pathname patterns use `Bun.Glob` and follow directory symbolic
|
|
523
|
+
links used as intermediate path components, as traditional shells do. This
|
|
524
|
+
matters for sysfs, where class entries are normally links. For example:
|
|
525
|
+
|
|
526
|
+
```sh
|
|
527
|
+
ls /sys/class/net/*/device
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
For a readable process overview, run:
|
|
531
|
+
|
|
532
|
+
```sh
|
|
533
|
+
pspac
|
|
534
|
+
|
|
535
|
+
# Kernel threads show as [name]; filter them out to see only userspace
|
|
536
|
+
pspac | grep -v '\[[a-z]'
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
`pspac` shows the real `PID COMMAND` process table and highlights each command
|
|
540
|
+
line as shell syntax with micro's Monokai colours. Leading directories are
|
|
541
|
+
dimmed so the program name stands out. Use `pspa` for the same table as plain
|
|
542
|
+
text.
|
|
543
|
+
|
|
544
|
+
See the [bunmsh repository](https://github.com/jjtseng93/bunmsh) for its full
|
|
545
|
+
syntax, interactive controls, builtins, and current compatibility details.
|
|
546
|
+
|
|
411
547
|
### Editor quick start
|
|
412
548
|
|
|
413
549
|
The bundled `jmi` terminal editor works without a network connection:
|
|
@@ -451,7 +587,7 @@ If `Enter` is not recognized in a particular terminal, try `Ctrl-J` or
|
|
|
451
587
|
|
|
452
588
|
Run a separate `bunterm` on each Linux virtual console. A numeric positional
|
|
453
589
|
argument is a short form of the corresponding device, so `bunterm 2` means
|
|
454
|
-
`bunterm /dev/tty2
|
|
590
|
+
`bunterm /dev/tty2`. Omitting the argument opens a new VT after the last known session (tty2 initially):
|
|
455
591
|
|
|
456
592
|
```sh
|
|
457
593
|
bunterm 2
|
|
@@ -500,53 +636,6 @@ terminal panes, it creates a new editor tab instead of wrapping back to the
|
|
|
500
636
|
first terminal tab. In every other case it performs the normal next-tab cycle.
|
|
501
637
|
Use `Esc` only when you actually want to close the current terminal pane.
|
|
502
638
|
|
|
503
|
-
### Using Bun Modern Shell
|
|
504
|
-
|
|
505
|
-
bunmsh is the dependency-free, mksh-inspired shell bundled with Buninu. Its
|
|
506
|
-
main features are:
|
|
507
|
-
|
|
508
|
-
- Lines beginning with `Bun.*` run as JavaScript; returned values are printed
|
|
509
|
-
and promises are awaited automatically. Use `Bun.e;` or `Bun.e,` for
|
|
510
|
-
arbitrary JavaScript.
|
|
511
|
-
- Lightweight cwd tabs keep several working directories ready. In bunmsh,
|
|
512
|
-
`Ctrl-T` creates or cycles right through tabs, while `Alt-T` cycles left.
|
|
513
|
-
* Also useful cmds: `tab n`, `tab c`(Alt-C)
|
|
514
|
-
- Shell variables and JavaScript share a live variable table by `$.`, and `Bun.sha`
|
|
515
|
-
can retain JavaScript values across commands and cwd tabs.
|
|
516
|
-
- Saved history, Bash/Fish history import, completions, and ghost suggestions
|
|
517
|
-
are available interactively.
|
|
518
|
-
- `serve [directory]` starts a browsable HTTP file server. Together with
|
|
519
|
-
Android USB tethering, it provides a simple way to transfer files between
|
|
520
|
-
Buninu Linux and the connected phone.
|
|
521
|
-
- Cross-platform builtins and PATH-fallback commands.
|
|
522
|
-
- `Ctrl-U` removes and saves the text before the cursor; press it again at the
|
|
523
|
-
beginning of the line to restore it. `Ctrl-K` independently toggles the text
|
|
524
|
-
after the cursor when at the end of the line.
|
|
525
|
-
- Unquoted pathname patterns use `Bun.Glob` and follow directory symbolic
|
|
526
|
-
links used as intermediate path components, as traditional shells do. This
|
|
527
|
-
matters for sysfs, where class entries are normally links. For example:
|
|
528
|
-
|
|
529
|
-
```sh
|
|
530
|
-
ls /sys/class/net/*/device
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
For a readable process overview, run:
|
|
534
|
-
|
|
535
|
-
```sh
|
|
536
|
-
pspac
|
|
537
|
-
|
|
538
|
-
# Kernel threads show as [name]; filter them out to see only userspace
|
|
539
|
-
pspac | grep -v '\[[a-z]'
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
`pspac` shows the real `PID COMMAND` process table and highlights each command
|
|
543
|
-
line as shell syntax with micro's Monokai colours. Leading directories are
|
|
544
|
-
dimmed so the program name stands out. Use `pspa` for the same table as plain
|
|
545
|
-
text.
|
|
546
|
-
|
|
547
|
-
See the [bunmsh repository](https://github.com/jjtseng93/bunmsh) for its full
|
|
548
|
-
syntax, interactive controls, builtins, and current compatibility details.
|
|
549
|
-
|
|
550
639
|
### Showing images
|
|
551
640
|
|
|
552
641
|
The Linux text console cannot draw pictures, so first start `bunterm`, the
|
|
@@ -591,7 +680,20 @@ aarch64 guest also needs a QEMU display; see
|
|
|
591
680
|
passes every copy and paste to Buninu's `xclip -selection clipboard`. For
|
|
592
681
|
now that clipboard is a file, `$HOME/.xclip.clipboard`, read and written in
|
|
593
682
|
the ramdisk, so all bunterm sessions share it and it is gone after a reboot.
|
|
594
|
-
|
|
683
|
+
Left-drag selects text only when the application has not enabled mouse reporting.
|
|
684
|
+
Click the top-left **2×2 pixels** for **Copy / Paste**, **font − / +**, the VT
|
|
685
|
+
list and a local command field (`font 16`, `copy`, `paste`, `vt 2`, `help`).
|
|
686
|
+
Paste uses bracketed paste when the application requests it.
|
|
687
|
+
`bunterm --no-clipboard` disables both OSC 52 and menu clipboard actions.
|
|
688
|
+
|
|
689
|
+
See [Using bunterm](#using-bunterm) for the menu and Kitty keyboard support.
|
|
690
|
+
|
|
691
|
+
In `buninu-browser`, a website's Copy button can write text through
|
|
692
|
+
`navigator.clipboard.writeText()` after a user click or key press on HTTPS
|
|
693
|
+
or localhost. The browser controller prefers `xclip -selection clipboard`,
|
|
694
|
+
so copied text reaches the same clipboard used by bunterm and jsmdcui.
|
|
695
|
+
If no clipboard provider is available, the operation reports failure.
|
|
696
|
+
This is separate from selecting text and copying it with Casty's shortcuts.
|
|
595
697
|
|
|
596
698
|
For Chinese input, run the pinyin input method
|
|
597
699
|
[jspinyin](https://www.npmjs.com/package/@drxiaozhi/jspinyin) in a bunterm
|
|
@@ -607,6 +709,11 @@ jspinyin
|
|
|
607
709
|
OSC 52, and `Ctrl-V` pastes it in jsmdcui or jspinyin, since jsmdcui reads
|
|
608
710
|
from `xclip` first by default.
|
|
609
711
|
|
|
712
|
+
jspinyin also has **Clear / Restore** buttons. Clear saves the current result
|
|
713
|
+
before emptying it; Restore appends that saved text to the end of the result.
|
|
714
|
+
Restoring keeps the saved text, so repeated clicks can append it repeatedly.
|
|
715
|
+
The input panel's help link explains candidate selection and other controls.
|
|
716
|
+
|
|
610
717
|
### Playing YouTube with sound (experimental)
|
|
611
718
|
|
|
612
719
|
[jspulse](https://github.com/jjtseng93/jspulse), now a built-in, is a
|
|
@@ -640,23 +747,47 @@ chroot shell on tty2. `bun x` needs network access; see
|
|
|
640
747
|
bunterm 3
|
|
641
748
|
```
|
|
642
749
|
|
|
643
|
-
3. **
|
|
644
|
-
|
|
645
|
-
|
|
750
|
+
3. **Identify the sound card, set its volume, then test playback.** First
|
|
751
|
+
list the ALSA cards and their mixer controls:
|
|
752
|
+
|
|
753
|
+
```sh
|
|
754
|
+
jspulse --audio-info
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
For built-in speakers or headphones plugged into the computer's audio
|
|
758
|
+
jack, choose the **onboard analog audio** card. In the example with
|
|
759
|
+
card 0 **HDA Intel HDMI**, card 1 **HDA Intel PCH**, and card 2
|
|
760
|
+
**HDA NVIDIA**, try **card 1 (HDA Intel PCH)** first. Controls named
|
|
761
|
+
`Speaker Playback`, `Headphone Playback`, `PCM Playback`, or
|
|
762
|
+
`Master Playback` are useful clues for this output.
|
|
763
|
+
|
|
764
|
+
Choose an **HDMI/DisplayPort** card instead when you want sound from a
|
|
765
|
+
monitor or TV connected through that GPU. Intel HDMI and NVIDIA audio
|
|
766
|
+
do not normally feed the computer's analog headphone jack. A USB headset
|
|
767
|
+
or USB sound card should use its own USB audio card.
|
|
768
|
+
|
|
769
|
+
Card numbers vary by machine; replace `1` below with the card connected
|
|
770
|
+
to your intended output, then use the test tone to check it.
|
|
646
771
|
|
|
647
772
|
```sh
|
|
648
|
-
jspulse --volume 50
|
|
649
|
-
jspulse --play
|
|
773
|
+
jspulse --card 1 --volume 50
|
|
774
|
+
jspulse --card 1 --play
|
|
650
775
|
```
|
|
651
776
|
|
|
652
|
-
|
|
653
|
-
|
|
777
|
+
Setting a supported playback volume also unmutes its corresponding switch.
|
|
778
|
+
HDMI cards may have no hardware playback volume control; in that case skip
|
|
779
|
+
`--volume` and adjust the connected monitor/TV volume. This does not by
|
|
780
|
+
itself mean HDMI playback is unavailable. The test tone checks the selected
|
|
781
|
+
output; adjust the volume as needed.
|
|
782
|
+
|
|
783
|
+
4. **Start the sound server on the same card.** It keeps running in the
|
|
784
|
+
foreground, so leave this terminal as it is; `Ctrl+C` stops it:
|
|
654
785
|
|
|
655
786
|
```sh
|
|
656
|
-
jspulse --alsa
|
|
657
|
-
|
|
787
|
+
jspulse --alsa --card 1
|
|
788
|
+
|
|
658
789
|
# or start in the background
|
|
659
|
-
jspulse --alsa &
|
|
790
|
+
jspulse --alsa --card 1 &
|
|
660
791
|
```
|
|
661
792
|
|
|
662
793
|
5. **Start casty with sound.** Press `Ctrl+Alt+F2` to return to the chroot
|
|
@@ -683,6 +814,45 @@ chroot shell on tty2. `bun x` needs network access; see
|
|
|
683
814
|
If there is no sound, check step 4's terminal for errors, and make sure
|
|
684
815
|
`PULSE_SERVER` was exported in the same shell that started casty.
|
|
685
816
|
|
|
817
|
+
### Data and persistence
|
|
818
|
+
|
|
819
|
+
Buninu Linux runs from an in-memory initramfs. Changes to the default home
|
|
820
|
+
directory (`/buninu`), system configuration, and packages installed during a
|
|
821
|
+
session disappear after reboot unless saved to a mounted disk. `/tmp` is also
|
|
822
|
+
temporary. The boot image does not automatically save these changes back to
|
|
823
|
+
itself, and creating a directory under `/mnt` alone does not make it persistent.
|
|
824
|
+
|
|
825
|
+
To keep files, load storage drivers at the initial `bun-repl>` prompt, then
|
|
826
|
+
enter the shell:
|
|
827
|
+
|
|
828
|
+
```js
|
|
829
|
+
cfg.disk
|
|
830
|
+
start()
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
Mount an existing data partition (replace `/dev/sda1` with your partition),
|
|
834
|
+
then save or copy files into it:
|
|
835
|
+
|
|
836
|
+
```sh
|
|
837
|
+
mount /dev/sda1 /mnt/data --mkdir
|
|
838
|
+
mkdir -p /mnt/data/work
|
|
839
|
+
cp /buninu/notes.md /mnt/data/work/notes.md
|
|
840
|
+
cd /mnt/data/work
|
|
841
|
+
```
|
|
842
|
+
|
|
843
|
+
The copy example assumes you have already created `/buninu/notes.md`. Files
|
|
844
|
+
written under `/mnt/data` while the partition is mounted remain on that disk.
|
|
845
|
+
After reboot, mount the same partition again to access them. This does not
|
|
846
|
+
automatically restore your home directory, installed packages, or system settings.
|
|
847
|
+
|
|
848
|
+
Before unplugging the disk, close programs using it, leave its directories,
|
|
849
|
+
and unmount it successfully:
|
|
850
|
+
|
|
851
|
+
```sh
|
|
852
|
+
cd /
|
|
853
|
+
umount /mnt/data
|
|
854
|
+
```
|
|
855
|
+
|
|
686
856
|
## Commands inside /bin
|
|
687
857
|
|
|
688
858
|
| command | does | manual |
|
|
@@ -695,8 +865,12 @@ If there is no sound, check step 4's terminal for errors, and make sure
|
|
|
695
865
|
| `mount` | `mount(2)` with type detection, `-o` parsing, `LABEL=`/`UUID=`, bind/move/remount; loads required filesystem and disk modules | `mount --help` → `/usr/share/doc/buninu-linux/mount.md` |
|
|
696
866
|
| `umount` | `umount2(2)` with `-l`, `-f`, `-R` | `umount --help` |
|
|
697
867
|
| `ip` | iproute2 grammar over `SIOC*` ioctls and `/proc/net`: `link`, `addr`, `route`, `neigh` | `ip --help` |
|
|
868
|
+
| `dhclient` | Reacquire DHCPv4 settings after expiry or when needed (`dhclient usb0`), then exit; also supports release | `dhclient --help` |
|
|
869
|
+
| `ping` | IPv4 ICMP / IPv6 ICMPv6 echo via Bun FFI; count, interval, timeout, deadline, payload size, TTL and source selection | `ping --help` |
|
|
698
870
|
| `ps` | composable process fields from `/proc`; also exports its snapshot and single-row formatter for other commands | `ps --help` |
|
|
699
871
|
| `top` | periodically refreshes the process snapshot and rows supplied by `ps` | `top --help` |
|
|
872
|
+
| `xdg-open` | open HTTP/HTTPS, `about:`, or an existing local file in buninu-browser on a new bunterm VT | `xdg-open --help` |
|
|
873
|
+
| `chvt` | Switch Linux VTs (`chvt 1` / `chvt 2`), including switching away from and back to bunterm | `chvt --help` |
|
|
700
874
|
| `poweroff` | sync pending writes and power off through the Linux reboot system call | `poweroff --help` |
|
|
701
875
|
| `reboot` | sync pending writes and restart through the shared Linux reboot logic | `reboot --help` |
|
|
702
876
|
| `tar` | create, extract, or list tar archives with gzip and zstd compression through `Bun.Archive` | `tar --help` |
|
|
@@ -717,6 +891,14 @@ above, implemented as Bun scripts or thin launchers for bundled packages.
|
|
|
717
891
|
For Debian/Alpine rootfs and Chromium examples, see
|
|
718
892
|
[Optional chroot and native binaries](#optional-chroot-and-native-binaries).
|
|
719
893
|
|
|
894
|
+
`ping -c 4 127.0.0.1` checks IPv4 connectivity; `ping -6 -c 4 ::1` checks
|
|
895
|
+
IPv6. `ping -c 10 -i 0.2 -W 1 HOST` adjusts count, interval and reply timeout.
|
|
896
|
+
The command uses ICMP sockets directly, with a raw-socket fallback when needed.
|
|
897
|
+
It supports Linux glibc/musl and native Android bionic through the shared libc
|
|
898
|
+
loader; `BUNINU_LIBC` remains an explicit override. Run
|
|
899
|
+
`bun test test/ping.test.js test/libc.test.js` to compare against the installed
|
|
900
|
+
system ping. See `ping --help` for permission requirements and supported flags.
|
|
901
|
+
|
|
720
902
|
### Buninu Browser (early-stage, experimental)
|
|
721
903
|
|
|
722
904
|
`buninu-browser` is still in an early stage. Websites may render incorrectly
|
|
@@ -739,6 +921,17 @@ REPL, then run `jspulse --alsa` in another terminal or use `jspulse --alsa &` to
|
|
|
739
921
|
buninu-browser about:audio
|
|
740
922
|
```
|
|
741
923
|
|
|
924
|
+
For a trusted test website with a self-signed HTTPS certificate, disable
|
|
925
|
+
certificate verification for that invocation only:
|
|
926
|
+
|
|
927
|
+
```sh
|
|
928
|
+
env NODE_TLS_REJECT_UNAUTHORIZED=0 buninu-browser https://localhost:8443
|
|
929
|
+
```
|
|
930
|
+
|
|
931
|
+
This also disables verification for other requests made by that process and
|
|
932
|
+
its inherited child processes. Avoid exporting it globally; verification
|
|
933
|
+
remains enabled when this override is absent.
|
|
934
|
+
|
|
742
935
|
### Buninu Land (early-stage, experimental)
|
|
743
936
|
|
|
744
937
|
Run `buninu-land` inside `bunterm` (or another Kitty-graphics terminal) to
|
|
@@ -749,6 +942,49 @@ requires no npm download.
|
|
|
749
942
|
buninu-land
|
|
750
943
|
```
|
|
751
944
|
|
|
945
|
+
The launcher enables Casty's `--no-shortcuts`: page keys go to Land and its
|
|
946
|
+
clients instead of triggering Casty shortcuts. To quit the frontend, click
|
|
947
|
+
**@** at the left of the address bar, type `q`, and press Enter. Clicking the
|
|
948
|
+
address itself edits it; the bar displays the actual Wayland socket path.
|
|
949
|
+
|
|
950
|
+
With the bundled Casty inside bunterm or a Kitty-keyboard-capable jsgotty,
|
|
951
|
+
Super combinations and key releases are forwarded automatically:
|
|
952
|
+
|
|
953
|
+
| Shortcut | Action |
|
|
954
|
+
| --- | --- |
|
|
955
|
+
| Super+Arrow | Focus a window in that direction |
|
|
956
|
+
| Super+W / Super+Q | Ask the focused window to close |
|
|
957
|
+
| Super+F | Toggle fullscreen |
|
|
958
|
+
| Super+T | Toggle floating/tiling |
|
|
959
|
+
| Super+Alt+F | Toggle maximization on Land's single output |
|
|
960
|
+
| Super+Shift+Arrow | Swap with a tiled window in that direction |
|
|
961
|
+
| Alt+Tab / Alt+Shift+Tab | Cycle forward/backward through windows |
|
|
962
|
+
| Super+1–9 | Switch workspace |
|
|
963
|
+
| Super+Shift+1–9 | Move the focused window to that workspace and follow it |
|
|
964
|
+
| Super+- / Super+= | Shrink/grow horizontally; add Shift for vertically |
|
|
965
|
+
|
|
966
|
+
Resize increments are 100 logical pixels; add Alt for 25 or Ctrl for 300.
|
|
967
|
+
Tiled windows change the split ratio. These are the implemented window actions,
|
|
968
|
+
not the complete Omarchy desktop. Legacy terminals cannot reliably send Super;
|
|
969
|
+
Ctrl+Alt combinations now pass through to clients rather than acting as aliases.
|
|
970
|
+
|
|
971
|
+
**Client GPU acceleration:** first run `cfg.gpu` in the initial REPL before
|
|
972
|
+
opening bunterm (see [Optional client GPU acceleration](#optional-client-gpu-acceleration-cfggpu)).
|
|
973
|
+
Then run Land in bunterm with the render node for the GPU you want to advertise:
|
|
974
|
+
|
|
975
|
+
```sh
|
|
976
|
+
buninu-land -- --gpu=/dev/dri/renderD128
|
|
977
|
+
```
|
|
978
|
+
|
|
979
|
+
Replace that example node with the actual one; numbering can change at boot.
|
|
980
|
+
The client environment still needs working Mesa drivers and access to the same
|
|
981
|
+
render node. Clients in a chroot also need access to Land's Wayland socket.
|
|
982
|
+
The preset enables linear DMA-BUF import, deferred capture and 2 ms polling.
|
|
983
|
+
Bare `--gpu` enables the preset without selecting a DRM device. Land itself
|
|
984
|
+
still composites in software; only client rendering can use the GPU.
|
|
985
|
+
Driver support is limited: the tested Intel path worked, but the tested Nouveau
|
|
986
|
+
path produced blank/corrupt images. This does not guarantee NVIDIA support.
|
|
987
|
+
|
|
752
988
|
The socket directory defaults to `$TMPDIR`, or the system temporary directory
|
|
753
989
|
if `TMPDIR` is unset; an explicitly set `XDG_RUNTIME_DIR` takes precedence.
|
|
754
990
|
No environment setup is needed to launch the compositor.
|
|
@@ -1108,7 +1344,7 @@ firmware console and waits; press any key to return to the firmware interface.
|
|
|
1108
1344
|
|
|
1109
1345
|
`build-image.sh` is shared with [Section 2](#2-buninu-linux-bun-as-pid-1) — see [Disk layout](#disk-layout).
|
|
1110
1346
|
|
|
1111
|
-
### 2. Buninu Linux
|
|
1347
|
+
### 2. Buninu Linux: Bun as PID 1
|
|
1112
1348
|
|
|
1113
1349
|
An unsigned x64 Unified Kernel Image assembled from official Alpine packages,
|
|
1114
1350
|
with Bun as the init process, replaces the hello-world application:
|
|
@@ -1179,7 +1415,7 @@ initramfs/ init.js, commands, userspace: the same for every archi
|
|
|
1179
1415
|
native/<arch>/ musl and the GCC runtime (committed); bun and modules (fetched)
|
|
1180
1416
|
```
|
|
1181
1417
|
|
|
1182
|
-
The `--real` inputs are Alpine v3.24 `linux-lts-6.18.
|
|
1418
|
+
The `--real` inputs are Alpine v3.24 `linux-lts-6.18.58-r0`, musl `1.2.6-r2`,
|
|
1183
1419
|
`systemd-efistub-260.2-r0`, `libstdc++`/`libgcc` `15.2.0-r5`, and Bun 1.4.2
|
|
1184
1420
|
`linux-x64-musl-baseline`. The aarch64 guest uses the same versions from
|
|
1185
1421
|
Alpine's aarch64 repository and Bun's `linux-aarch64-musl`. There is no BusyBox
|
|
@@ -1193,15 +1429,11 @@ tampered with is fetched again and has to pass the same hash before a script
|
|
|
1193
1429
|
extracts from it. Bumping a version changes both the file name and the hash, so
|
|
1194
1430
|
it always refetches.
|
|
1195
1431
|
|
|
1196
|
-
The five application packages are pinned
|
|
1197
|
-
`scripts/npm-packages.md
|
|
1198
|
-
|
|
1199
|
-
`@drxiaozhi/jspinyin@0.1.1`. These were npm's `latest` versions when checked
|
|
1200
|
-
on 2026-10-11, with buninu-browser updated on 2026-10-12, and
|
|
1201
|
-
casty 1.3.7 and buninu-land 0.1.3 verified on 2026-10-16;
|
|
1202
|
-
fetch never resolves `latest` or a version range at runtime.
|
|
1432
|
+
The five application packages and their exact versions are pinned in
|
|
1433
|
+
[`scripts/npm-packages.md`](scripts/npm-packages.md), the authoritative list
|
|
1434
|
+
for this image. Fetch never resolves `latest` or a version range at runtime.
|
|
1203
1435
|
Each registry tarball was checked against its published SHA-512 integrity
|
|
1204
|
-
before its SHA-256 was recorded in
|
|
1436
|
+
before its SHA-256 was recorded in that shared pins file.
|
|
1205
1437
|
|
|
1206
1438
|
The manifest uses fixed YAML-compatible blocks: a double-quoted
|
|
1207
1439
|
`"package@version":` header, followed by two ` - ` lines containing the
|
|
@@ -1330,7 +1562,9 @@ LBA 2048..262110 ESP, FAT32 "EFIBOOT", type GUID C12A7328-F81F-11D2-BA4B-00A0C
|
|
|
1330
1562
|
LBA 262111.. backup GPT
|
|
1331
1563
|
```
|
|
1332
1564
|
|
|
1333
|
-
128 MiB sparse,
|
|
1565
|
+
At least 128 MiB sparse, growing automatically with the EFI payload (64 MiB
|
|
1566
|
+
increments, with room for FAT metadata and free space), 1 MiB-aligned, with
|
|
1567
|
+
34 sectors reserved at the end for the
|
|
1334
1568
|
backup GPT. `EFI/BOOT/BOOTX64.EFI` and `EFI/BOOT/BOOTAA64.EFI` are the
|
|
1335
1569
|
architecture-specific removable-media fallback paths, so matching firmware
|
|
1336
1570
|
runs the one present in the image without any NVRAM boot entry.
|
|
@@ -1343,7 +1577,7 @@ The physical boot chain is firmware → the UKI stub → its embedded
|
|
|
1343
1577
|
and, with the currently pinned kernel, embeds this complete command line:
|
|
1344
1578
|
|
|
1345
1579
|
```text
|
|
1346
|
-
console=ttyS0,115200 console=tty0 REAL_MACHINE=1 panic=0 PATH=/bin KERNEL_RELEASE=6.18.
|
|
1580
|
+
console=ttyS0,115200 console=tty0 REAL_MACHINE=1 panic=0 PATH=/bin KERNEL_RELEASE=6.18.58-0-lts rdinit=/bin/bun -- -e import('/init.js')
|
|
1347
1581
|
```
|
|
1348
1582
|
|
|
1349
1583
|
Serial kernel logging is retained, while the final console makes
|
|
@@ -1367,7 +1601,7 @@ the same way). Build without `--real`; this selects Alpine `linux-virt`, omits t
|
|
|
1367
1601
|
module set, and puts `ttyS0` last so serial stdio owns `/dev/console`:
|
|
1368
1602
|
|
|
1369
1603
|
```text
|
|
1370
|
-
console=tty0 console=ttyS0,115200 panic=0 PATH=/bin KERNEL_RELEASE=6.18.
|
|
1604
|
+
console=tty0 console=ttyS0,115200 panic=0 PATH=/bin KERNEL_RELEASE=6.18.58-0-virt rdinit=/bin/bun -- -e import('/init.js')
|
|
1371
1605
|
```
|
|
1372
1606
|
|
|
1373
1607
|
Build and boot it with:
|
|
@@ -1484,7 +1718,7 @@ The default `--real` image embeds this kernel command line (shown for the
|
|
|
1484
1718
|
currently pinned LTS release):
|
|
1485
1719
|
|
|
1486
1720
|
```text
|
|
1487
|
-
console=ttyS0,115200 console=tty0 REAL_MACHINE=1 panic=0 PATH=/bin KERNEL_RELEASE=6.18.
|
|
1721
|
+
console=ttyS0,115200 console=tty0 REAL_MACHINE=1 panic=0 PATH=/bin KERNEL_RELEASE=6.18.58-0-lts rdinit=/bin/bun -- -e import('/init.js')
|
|
1488
1722
|
```
|
|
1489
1723
|
|
|
1490
1724
|
The physical display (`tty0`) is the final console and therefore owns PID 1's
|
|
@@ -1563,24 +1797,39 @@ custom `libinit.so` is needed.
|
|
|
1563
1797
|
On a `--real` boot, init starts `/etc/resolv.conf` with `1.1.1.1` and
|
|
1564
1798
|
`8.8.8.8`; these are initial public resolvers until the user replaces them
|
|
1565
1799
|
with DNS appropriate for the local network. Hardware networking remains down
|
|
1566
|
-
until `cfg.net` loads the packaged drivers and
|
|
1567
|
-
route.
|
|
1800
|
+
until `cfg.net` loads the packaged drivers and attempts DHCP configuration.
|
|
1801
|
+
Manual address and route configuration with `ip` remains available.
|
|
1802
|
+
|
|
1803
|
+
`cfg.net` starts DHCP in the background for every detected non-loopback interface.
|
|
1804
|
+
It returns immediately; failures and acquisition timeouts are logged without
|
|
1805
|
+
interrupting init. Each client exits after configuring its lease; no renewal process stays running.
|
|
1806
|
+
Repeated `cfg.net` calls do not launch duplicate active clients. Route metrics
|
|
1807
|
+
start at 100; only the first interface updates DNS, leaving the init fallback
|
|
1808
|
+
resolver available if it cannot acquire a lease.
|
|
1809
|
+
|
|
1810
|
+
After a lease expires or when network settings need to be obtained again,
|
|
1811
|
+
run `dhclient usb0` (or `dhclient eth0`, depending on the interface name).
|
|
1812
|
+
This is not an extra step after successful automatic configuration by `cfg.net`.
|
|
1813
|
+
`dhclient` exits after configuration; `-timeout 20` limits acquisition to 20
|
|
1814
|
+
seconds. Leases do not renew automatically. For manual static configuration,
|
|
1815
|
+
see [Basic configuration](#basic-configuration).
|
|
1568
1816
|
|
|
1569
1817
|
On a `--real` image the REPL also offers the getter-based `cfg` namespace:
|
|
1570
|
-
`cfg.net`, `cfg.disk`, `cfg.power`, `cfg.sound` and `cfg.all` run as soon as the property is read, without
|
|
1818
|
+
`cfg.net`, `cfg.disk`, `cfg.power`, `cfg.sound`, `cfg.gpu` and `cfg.all` run as soon as the property is read, without
|
|
1571
1819
|
parentheses. `cfg.net` loads every packaged network module (including PHY and bus support),
|
|
1572
1820
|
then reads the `modalias` of every PCI and USB network device, matches it
|
|
1573
1821
|
against the `pci:`/`usb:` lines
|
|
1574
1822
|
`fetch-alpine.sh` kept in `modules.alias` and lists the interfaces. `cfg.disk`
|
|
1575
1823
|
loads the packaged SATA/PATA/SCSI, NVMe/VMD and USB storage stacks so
|
|
1576
1824
|
their disks and partitions appear in `/dev`, then lists `/sys/class/block`. `cfg.all`
|
|
1577
|
-
|
|
1825
|
+
attempts every packaged module **except GPU modules** and recursively loads its
|
|
1578
1826
|
declared dependencies. `--real` ships Intel `e1000`/`e1000e`/`igb`/`igc`,
|
|
1579
1827
|
Realtek `r8169`, Atheros `alx`, Broadcom `tg3`, common USB dongles, and
|
|
1580
1828
|
`rndis_host`/`cdc_ether`/`cdc_ncm`/`cdc_eem`/`cdc_subset`/`zaurus` for Android
|
|
1581
1829
|
USB tethering. `cfg.net` unconditionally attempts all of these packaged
|
|
1582
1830
|
network modules. `cfg.sound` likewise unconditionally attempts every packaged
|
|
1583
1831
|
module below `kernel/sound/`, then lists `/dev/snd`; it does no hardware probe.
|
|
1832
|
+
|
|
1584
1833
|
The packaged sound set covers QEMU ES1371/HDA and common PC HDA/HDMI and USB
|
|
1585
1834
|
audio where the selected kernel flavor provides them. `cfg.power` loads the ACPI
|
|
1586
1835
|
`battery`, `ac`, `button` and `thermal` modules through `/lib/modprobe.js`
|
|
@@ -1594,6 +1843,68 @@ reports nothing registered). Nothing loads them at boot. PID 1 also installs
|
|
|
1594
1843
|
the current process environment preserved, while overriding `PATH` and `HOME`
|
|
1595
1844
|
for the userspace session.
|
|
1596
1845
|
|
|
1846
|
+
### Optional client GPU acceleration (`cfg.gpu`)
|
|
1847
|
+
|
|
1848
|
+
To omit only the added GPU module requests and firmware when building:
|
|
1849
|
+
|
|
1850
|
+
```sh
|
|
1851
|
+
bun index.js -b --real --no-gpu
|
|
1852
|
+
```
|
|
1853
|
+
|
|
1854
|
+
The original simpledrm/fbcon/bunterm path, sound/network/storage modules, and
|
|
1855
|
+
any dependencies they require are retained. The setting applies to fetch/build
|
|
1856
|
+
and is forwarded into Docker. For direct shell scripts use
|
|
1857
|
+
`env BUNINU_NO_GPU=1 REAL_MACHINE=1 LINUX_FLAVOR=lts ./build-uki.sh`.
|
|
1858
|
+
Switching this option invalidates the module/firmware cache; omit the option
|
|
1859
|
+
(and unset `BUNINU_NO_GPU`) to restore the default GPU packaging. Cached APK
|
|
1860
|
+
downloads are retained but excluded from the image. This does not disable GPU
|
|
1861
|
+
support already compiled into the selected kernel.
|
|
1862
|
+
|
|
1863
|
+
|
|
1864
|
+
GPU drivers are packaged but are **not loaded by boot, `start()`, `cfg.all`, or
|
|
1865
|
+
`cfgMod`**. The existing simpledrm/framebuffer and software-rendered bunterm path
|
|
1866
|
+
stays the default. At the PID 1 REPL, before opening bunterm/fbdev, explicitly read:
|
|
1867
|
+
|
|
1868
|
+
```js
|
|
1869
|
+
cfg.gpu
|
|
1870
|
+
```
|
|
1871
|
+
|
|
1872
|
+
This is a one-shot PCI/virtio hardware probe, not a daemon. It matches available
|
|
1873
|
+
drivers, loads their module dependencies, and lists `/dev/dri/renderD*` and
|
|
1874
|
+
`/dev/fb*`. Individual driver failures are reported without stopping init. A
|
|
1875
|
+
missing render node is not reported as successful acceleration: inspect kernel
|
|
1876
|
+
firmware/driver messages; if probing is asynchronous, read `cfg.gpu` again later.
|
|
1877
|
+
If a process already holds an fd or mmap of `/dev/fb*`, it refuses to load GPU
|
|
1878
|
+
drivers. Exit that framebuffer client first; after GPU handoff, reopen it to
|
|
1879
|
+
discover the new framebuffer, resolution and pixel format. `fb0` is not guaranteed.
|
|
1880
|
+
|
|
1881
|
+
The x86_64 LTS module set includes Intel `i915`/`xe`, AMD `amdgpu`/legacy `radeon`,
|
|
1882
|
+
NVIDIA **Nouveau**, and VMware `vmwgfx`; both architectures request `virtio_gpu`.
|
|
1883
|
+
Modules absent from a selected Alpine kernel are skipped with a build-time note.
|
|
1884
|
+
The five pinned Alpine `linux-firmware-{i915,xe,amdgpu,radeon,nvidia}` packages are
|
|
1885
|
+
included when PC GPU modules are present (about 151 MB of downloads). Firmware
|
|
1886
|
+
symlinks and directory aliases are preserved, and the kernel reads their `.zst`
|
|
1887
|
+
files directly. Firmware pins live in `scripts/gpu-firmware.json`; licenses and
|
|
1888
|
+
WHENCE are under `LICENSES/linux-firmware/`. Rebuild existing images to include
|
|
1889
|
+
the new modules and firmware; the build detects older fetch caches.
|
|
1890
|
+
|
|
1891
|
+
Render nodes are set to `root:0`, mode `0660`, for this system's root clients.
|
|
1892
|
+
For non-root clients, set a numeric supplementary group before reading the getter:
|
|
1893
|
+
|
|
1894
|
+
```js
|
|
1895
|
+
process.env.BUNINU_RENDER_GID = "107" // use the actual client render group ID
|
|
1896
|
+
cfg.gpu
|
|
1897
|
+
```
|
|
1898
|
+
|
|
1899
|
+
The client must run with that numeric group and, inside a chroot/proot, see the
|
|
1900
|
+
real `/dev/dri` nodes and relevant `/sys`. Mesa, Vulkan loader/ICD and their
|
|
1901
|
+
dependencies belong in the **client's** environment; this change does not install
|
|
1902
|
+
them or accelerate CanvasKit/Land itself. A render node alone does not prove
|
|
1903
|
+
hardware rendering: verify `vulkaninfo`/the browser's renderer and visible output.
|
|
1904
|
+
QEMU additionally needs an accelerated host GPU backend (VirGL/Venus); a plain
|
|
1905
|
+
2D virtio GPU is not 3D acceleration. This does not include NVIDIA's proprietary
|
|
1906
|
+
driver, Android KGSL, or board-specific ARM GPU/DT/firmware enablement.
|
|
1907
|
+
|
|
1597
1908
|
## Contents
|
|
1598
1909
|
|
|
1599
1910
|
- [Quick start](#quick-start)
|
|
@@ -1609,16 +1920,18 @@ for the userspace session.
|
|
|
1609
1920
|
+ [Testing on a Linux host in Docker](#testing-on-a-linux-host-in-docker)
|
|
1610
1921
|
- [Using Buninu Linux](#using-buninu-linux)
|
|
1611
1922
|
* [Basic configuration](#basic-configuration)
|
|
1923
|
+
* [Using bunterm](#using-bunterm)
|
|
1924
|
+
* [Using Bun Modern Shell](#using-bun-modern-shell)
|
|
1612
1925
|
* [Editor quick start](#editor-quick-start)
|
|
1613
1926
|
+ [jsmdcui](#jsmdcui)
|
|
1614
1927
|
* [Multitasking modes](#multitasking-modes)
|
|
1615
1928
|
+ [Multiple virtual consoles with bunterm](#multiple-virtual-consoles-with-bunterm)
|
|
1616
1929
|
+ [Panes, terminals, and tabs with jsmdcui](#panes-terminals-and-tabs-with-jsmdcui)
|
|
1617
1930
|
- [Pane and tab controls](#pane-and-tab-controls)
|
|
1618
|
-
* [Using Bun Modern Shell](#using-bun-modern-shell)
|
|
1619
1931
|
* [Showing images](#showing-images)
|
|
1620
1932
|
* [Clipboard](#clipboard)
|
|
1621
1933
|
* [Playing YouTube with sound (experimental)](#playing-youtube-with-sound-experimental)
|
|
1934
|
+
* [Data and persistence](#data-and-persistence)
|
|
1622
1935
|
- [Commands inside /bin](#commands-inside-bin)
|
|
1623
1936
|
* [Buninu Browser (early-stage, experimental)](#buninu-browser-early-stage-experimental)
|
|
1624
1937
|
* [Buninu Land (early-stage, experimental)](#buninu-land-early-stage-experimental)
|
|
@@ -1637,7 +1950,7 @@ for the userspace session.
|
|
|
1637
1950
|
* [Old build from a source checkout](#old-build-from-a-source-checkout)
|
|
1638
1951
|
- [Implementation details](#implementation-details)
|
|
1639
1952
|
* [1. Hello world](#1-hello-world)
|
|
1640
|
-
* [2. Buninu Linux
|
|
1953
|
+
* [2. Buninu Linux: Bun as PID 1](#2-buninu-linux-bun-as-pid-1)
|
|
1641
1954
|
+ [Build flags](#build-flags)
|
|
1642
1955
|
+ [Build pipeline](#build-pipeline)
|
|
1643
1956
|
- [Pipeline inputs and outputs](#pipeline-inputs-and-outputs)
|
|
@@ -1650,13 +1963,14 @@ for the userspace session.
|
|
|
1650
1963
|
+ [Command implementation](#command-implementation)
|
|
1651
1964
|
+ [Reaching JavaScript with nothing mounted](#reaching-javascript-with-nothing-mounted)
|
|
1652
1965
|
+ [What init.js does](#what-initjs-does)
|
|
1966
|
+
* [Optional client GPU acceleration (`cfg.gpu`)](#optional-client-gpu-acceleration-cfggpu)
|
|
1653
1967
|
- [Authorship](#authorship)
|
|
1654
1968
|
- [License](#license)
|
|
1655
1969
|
* [Bundled component licenses](#bundled-component-licenses)
|
|
1656
1970
|
|
|
1657
1971
|
## Authorship
|
|
1658
1972
|
|
|
1659
|
-
Buninu Linux is written and maintained by Dr. John
|
|
1973
|
+
Buninu Linux is written and maintained by Dr. John, the author of
|
|
1660
1974
|
[Buninu](https://github.com/jjtseng93/buninu), whose userspace it runs. The
|
|
1661
1975
|
kernel, the C library, the GCC runtime, the UEFI stub and Bun itself are the
|
|
1662
1976
|
work of their respective projects; [NOTICE.md](NOTICE.md) names each one with
|
|
@@ -1696,12 +2010,12 @@ when redistributing the image.
|
|
|
1696
2010
|
| Linux kernels and networking, storage, xHCI, USB and HID modules | GPL-2.0-only with the Linux syscall note | image only |
|
|
1697
2011
|
| systemd EFI stub | LGPL-2.1-or-later | image only |
|
|
1698
2012
|
| Bun | MIT, plus the licenses of what it statically links | image only |
|
|
1699
|
-
| buninu-browser
|
|
1700
|
-
| buninu-land
|
|
2013
|
+
| buninu-browser | MIT for its own code; bundled components have their own licenses | npm download → image |
|
|
2014
|
+
| buninu-land | MIT for its own code; bundled components retain their own licenses and notices | npm download → image |
|
|
1701
2015
|
| wasmpeg / FFmpeg (`@wasmpeg/cpu` 1.0.1, bundled in buninu-browser) | LGPL-2.1-or-later, plus component notices; source archive and rebuild documentation retained | browser package → image |
|
|
1702
|
-
| `@drxiaozhi/casty`
|
|
1703
|
-
| `@drxiaozhi/jspulse`
|
|
1704
|
-
| `@drxiaozhi/jspinyin`
|
|
2016
|
+
| `@drxiaozhi/casty` | MIT | npm download → image |
|
|
2017
|
+
| `@drxiaozhi/jspulse` | LGPL-2.1-or-later, plus component notices | npm download → image |
|
|
2018
|
+
| `@drxiaozhi/jspinyin` | MIT; hanzipinyin material under the Unlicense | npm download → image |
|
|
1705
2019
|
| CanvasKit 0.41.1 (`initramfs/lib/canvaskit/`, Skia compiled to WebAssembly) | BSD-3-Clause (`LICENSES/BSD-3-Clause-Skia.txt`) | committed |
|
|
1706
2020
|
| xterm.js 6.0.0 headless core and unicode-graphemes addon (`initramfs/lib/xterm/`); box-drawing shape tables in `initramfs/lib/bunterm/glyphs.js` | MIT (`LICENSES/MIT-xterm.js.txt`) | committed |
|
|
1707
2021
|
| DejaVu Sans Mono (`initramfs/usr/share/fonts/DejaVuSansMono*.ttf`) | Bitstream Vera (`LICENSES/Bitstream-Vera.txt`) | committed |
|