buninu-linux 0.7.1 → 0.7.2
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/README.md +78 -15
- package/build-uki.sh +1 -5
- package/initramfs/buninu/CHANGELOG.md +8 -0
- package/initramfs/buninu/README.md +1 -0
- package/initramfs/buninu/package.json +2 -2
- package/initramfs/usr/share/doc/buninu-linux/bunterm.md +2 -2
- package/package.json +1 -1
- package/scripts/pack-initramfs.sh +23 -0
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
+ Also has mouse click, wheel, and cursor drawing
|
|
47
47
|
+ Simplified browser works: @sanohiro/casty in chroot debian
|
|
48
48
|
+ (Use at your own risk: We haven't fully examined its code)
|
|
49
|
-
+ Playing YouTube with sound(experimental)
|
|
49
|
+
+ Playing YouTube with sound (experimental); see [Playing YouTube with sound](#playing-youtube-with-sound-experimental)
|
|
50
50
|
+ See [Commands inside `/bin`](#commands-inside-bin) for browser usage instructions
|
|
51
51
|
|
|
52
52
|
---
|
|
@@ -373,7 +373,7 @@ If `Enter` is not recognized in a particular terminal, try `Ctrl-J` or
|
|
|
373
373
|
- Be careful not to run markdown files from strangers
|
|
374
374
|
* Otherwise it can run any command on your PC
|
|
375
375
|
- `jsmdcui --cdp-maze` runs a self-solving maze game
|
|
376
|
-
* Run `bunterm` first to show its Emojis
|
|
376
|
+
* Run `bunterm 2` first to show its Emojis
|
|
377
377
|
|
|
378
378
|
### Multitasking modes
|
|
379
379
|
|
|
@@ -480,11 +480,13 @@ syntax, interactive controls, builtins, and current compatibility details.
|
|
|
480
480
|
### Showing images
|
|
481
481
|
|
|
482
482
|
The Linux text console cannot draw pictures, so first start `bunterm`, the
|
|
483
|
-
graphical terminal on the framebuffer, and run the image commands inside it
|
|
483
|
+
graphical terminal on the framebuffer, and run the image commands inside it.
|
|
484
|
+
Start it on another virtual console so tty1 keeps the `bun-repl>` prompt for
|
|
485
|
+
hardware setup (`Ctrl+Alt+F1` goes back to it):
|
|
484
486
|
|
|
485
487
|
```sh
|
|
486
|
-
# Start the graphical terminal on
|
|
487
|
-
bunterm
|
|
488
|
+
# Start the graphical terminal on VT 2 (same as bunterm /dev/tty2)
|
|
489
|
+
bunterm 2
|
|
488
490
|
|
|
489
491
|
# Show an image with the kitty graphics protocol (jsgotty --viu)
|
|
490
492
|
showimg /buninu/icon.png
|
|
@@ -497,7 +499,8 @@ buninu-help
|
|
|
497
499
|
jsmdcui --allow-url README.md
|
|
498
500
|
|
|
499
501
|
# The mouse works in bunterm; --no-mouse leaves /dev/input alone
|
|
500
|
-
|
|
502
|
+
# (VT 3, since VT 2 already has the bunterm started above)
|
|
503
|
+
bunterm 3 -e jsmdcui --allow-url README.md
|
|
501
504
|
```
|
|
502
505
|
|
|
503
506
|
`bunterm` draws with Skia (CanvasKit) and understands the kitty graphics
|
|
@@ -534,6 +537,67 @@ bun x @drxiaozhi/jspinyin
|
|
|
534
537
|
OSC 52, and `Ctrl-V` pastes it in jsmdcui or jspinyin, since jsmdcui reads
|
|
535
538
|
from `xclip` first by default.
|
|
536
539
|
|
|
540
|
+
### Playing YouTube with sound (experimental)
|
|
541
|
+
|
|
542
|
+
[jspulse](https://www.npmjs.com/package/@drxiaozhi/jspulse) is a
|
|
543
|
+
PulseAudio-compatible sound server written for Bun. It runs natively in
|
|
544
|
+
Buninu, outside any chroot, and plays through ALSA. Chromium-based programs
|
|
545
|
+
such as `casty` inside the Debian chroot connect to it over `127.0.0.1`,
|
|
546
|
+
because a chroot shares Buninu's network. Several programs can play at once.
|
|
547
|
+
|
|
548
|
+
This assumes the Debian chroot and `casty` from
|
|
549
|
+
[Commands inside /bin](#commands-inside-bin) are already set up, with the
|
|
550
|
+
chroot shell on tty2. `bun x` needs network access; see
|
|
551
|
+
[Basic configuration](#basic-configuration).
|
|
552
|
+
|
|
553
|
+
1. **Load the sound drivers.** Press `Ctrl+Alt+F1` to go to the `bun-repl>`
|
|
554
|
+
prompt on tty1 and run:
|
|
555
|
+
|
|
556
|
+
```js
|
|
557
|
+
cfg.sound
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
2. **Open a native Buninu terminal.** Still on tty1, enter the Buninu shell
|
|
561
|
+
with `start()`, then open another virtual console from that shell (see
|
|
562
|
+
[Multitasking modes](#multitasking-modes)). Run the next two steps there,
|
|
563
|
+
*not* inside the chroot:
|
|
564
|
+
|
|
565
|
+
```js
|
|
566
|
+
start()
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
```sh
|
|
570
|
+
bunterm 3
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
3. **Set the volume, then test the speakers.** Setting a volume also unmutes
|
|
574
|
+
the output, so the 3-second test tone is guaranteed to be audible. Adjust
|
|
575
|
+
the percentage afterwards if it is too quiet or too loud:
|
|
576
|
+
|
|
577
|
+
```sh
|
|
578
|
+
bun x @drxiaozhi/jspulse --volume 50
|
|
579
|
+
bun x @drxiaozhi/jspulse --play
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
4. **Start the sound server.** It keeps running in the foreground, so leave
|
|
583
|
+
this terminal as it is; `Ctrl+C` stops it:
|
|
584
|
+
|
|
585
|
+
```sh
|
|
586
|
+
bun x @drxiaozhi/jspulse --alsa
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
5. **Start casty with sound.** Press `Ctrl+Alt+F2` to return to the chroot
|
|
590
|
+
shell, point PulseAudio clients at jspulse, and start casty:
|
|
591
|
+
|
|
592
|
+
```sh
|
|
593
|
+
export PULSE_SERVER=127.0.0.1
|
|
594
|
+
cd ~/casty/bin
|
|
595
|
+
bun casty.js https://www.youtube.com
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
If there is no sound, check step 4's terminal for errors, and make sure
|
|
599
|
+
`PULSE_SERVER` was exported in the same shell that started casty.
|
|
600
|
+
|
|
537
601
|
## Commands inside /bin
|
|
538
602
|
|
|
539
603
|
| command | does | manual |
|
|
@@ -581,14 +645,14 @@ umount -R /mnt
|
|
|
581
645
|
bun x bunproot --git clone https://github.com/jjtseng93/bunproot
|
|
582
646
|
|
|
583
647
|
# Read bunproot's Git manual without ANSI formatting in jmi
|
|
584
|
-
bunterm
|
|
648
|
+
bunterm 2
|
|
585
649
|
bun x bunproot --git --readme | stripansi | jmi
|
|
586
650
|
|
|
587
651
|
|
|
588
652
|
|
|
589
653
|
# Download and enter an x64 Debian rootfs
|
|
590
654
|
# Make sure you have run this already:
|
|
591
|
-
# bunterm --font-size 13
|
|
655
|
+
# bunterm 2 --font-size 13
|
|
592
656
|
bun x bunproot --git --yes clone https://github.com/jjtseng93/js-udocker
|
|
593
657
|
cd js-udocker
|
|
594
658
|
bun udocker.js pull --platform=linux/amd64 debian:13
|
|
@@ -618,10 +682,8 @@ git clone https://github.com/jjtseng93/casty
|
|
|
618
682
|
cd casty/bin
|
|
619
683
|
# When clicking around, don’t release the mouse button immediately after pressing it, to make sure the mouse-down event is triggered
|
|
620
684
|
bun casty.js buninu.org
|
|
621
|
-
#
|
|
622
|
-
#
|
|
623
|
-
# follow the dumped instructions
|
|
624
|
-
bun x bunproot --setup.pulse
|
|
685
|
+
# For sound in casty (YouTube), start jspulse first:
|
|
686
|
+
# see "Playing YouTube with sound (experimental)" under "Using Buninu Linux"
|
|
625
687
|
|
|
626
688
|
|
|
627
689
|
# Download and enter an x64 Alpine minirootfs
|
|
@@ -668,9 +730,9 @@ tar xvf /tmp/buninu.tar -C /tmp/buninu-copy
|
|
|
668
730
|
# Add z to create a gzip-compressed archive
|
|
669
731
|
tar czvf /tmp/buninu.tar.gz README.md package.json
|
|
670
732
|
|
|
671
|
-
# On
|
|
672
|
-
bunterm
|
|
673
|
-
bunterm /dev/
|
|
733
|
+
# On another virtual console: a graphical terminal with CJK, emoji and images
|
|
734
|
+
bunterm 2
|
|
735
|
+
bunterm /dev/tty3 --font-size 13 -e bun /buninu/apps/jsmdcui/src/index.js --demo
|
|
674
736
|
```
|
|
675
737
|
|
|
676
738
|
The graphics stack behind `bunterm` — the framebuffer module, CanvasKit,
|
|
@@ -1200,6 +1262,7 @@ for the userspace session.
|
|
|
1200
1262
|
* [Using Bun Modern Shell](#using-bun-modern-shell)
|
|
1201
1263
|
* [Showing images](#showing-images)
|
|
1202
1264
|
* [Clipboard](#clipboard)
|
|
1265
|
+
* [Playing YouTube with sound (experimental)](#playing-youtube-with-sound-experimental)
|
|
1203
1266
|
- [Commands inside /bin](#commands-inside-bin)
|
|
1204
1267
|
- [Environment and dependencies](#environment-and-dependencies)
|
|
1205
1268
|
* [Build environment](#build-environment)
|
package/build-uki.sh
CHANGED
|
@@ -14,11 +14,7 @@ fi
|
|
|
14
14
|
./scripts/pack-initramfs.sh
|
|
15
15
|
|
|
16
16
|
mkdir -p build vda/EFI/BOOT
|
|
17
|
-
|
|
18
|
-
'NAME="Buninu Linux"' \
|
|
19
|
-
'ID=buninu-linux' \
|
|
20
|
-
'PRETTY_NAME="Buninu Linux 1"' \
|
|
21
|
-
'VERSION_ID=1' > build/os-release
|
|
17
|
+
# build/os-release is written by pack-initramfs.sh from package.json.
|
|
22
18
|
# Bun itself is PID 1: no native bootstrap. `-e import('/init.js')` avoids the
|
|
23
19
|
# entry-file open that would readlink /proc/self/fd/N before /proc exists;
|
|
24
20
|
# init.js mounts /proc, /sys, /dev and /tmp as its first action.
|
|
@@ -23,6 +23,7 @@ npx buninu
|
|
|
23
23
|
> (`--local`, bunmsh) has no job control yet, so use the browser terminal when
|
|
24
24
|
> you need to background a job.
|
|
25
25
|
|
|
26
|
+
- Homepage: <https://buninu.org>
|
|
26
27
|
- Source: [github.com/jjtseng93/buninu](https://github.com/jjtseng93/buninu)
|
|
27
28
|
|
|
28
29
|
- Core components:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buninu",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.17",
|
|
4
4
|
"description": "Buninu is a portable, self-bootstrapping Unix-like userspace built on Bun that runs across operating systems",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./bin/init.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/jjtseng93/buninu.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://buninu.org",
|
|
14
14
|
"bugs": {
|
|
15
15
|
"url": "https://github.com/jjtseng93/buninu/issues"
|
|
16
16
|
},
|
|
@@ -6,9 +6,9 @@ xterm-compatible terminal with anti-aliased text, CJK, colour emoji, seamless
|
|
|
6
6
|
box drawing and kitty graphics protocol images — no X11, Wayland or GPU.
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
bunterm # run /bin/sh on the console you are on
|
|
10
9
|
bunterm 2 # start a detached bunterm on /dev/tty2
|
|
11
|
-
bunterm /dev/
|
|
10
|
+
bunterm /dev/tty2 # the full virtual-console spelling also works
|
|
11
|
+
bunterm # take over the console you are on (on tty1 that hides the bun-repl)
|
|
12
12
|
bunterm -s 20 # short for --font-size 20
|
|
13
13
|
bunterm -e bun /buninu/apps/jsmdcui/src/index.js --demo
|
|
14
14
|
bunterm --no-mouse # keyboard only
|
package/package.json
CHANGED
|
@@ -27,6 +27,29 @@ cp -a --reflink=auto "$native_dir/." "$staging/"
|
|
|
27
27
|
cp README.md "$staging/usr/share/doc/buninu-linux/README.md"
|
|
28
28
|
cp -a LICENSE NOTICE.md LICENSES "$staging/usr/share/licenses/"
|
|
29
29
|
|
|
30
|
+
# os-release(5): the canonical file lives in /usr/lib and /etc/os-release links
|
|
31
|
+
# to it. build-uki.sh embeds the same file as the UKI's .osrel section.
|
|
32
|
+
version="$(sed -n 's/^ *"version": *"\([^"]*\)".*/\1/p' package.json | head -n 1)"
|
|
33
|
+
test -n "$version" || { echo "error: no version in package.json" >&2; exit 1; }
|
|
34
|
+
printf '%s\n' \
|
|
35
|
+
'NAME="Buninu Linux"' \
|
|
36
|
+
'ID=buninu-linux' \
|
|
37
|
+
"VERSION=\"$version\"" \
|
|
38
|
+
"VERSION_ID=$version" \
|
|
39
|
+
"PRETTY_NAME=\"Buninu Linux $version\"" \
|
|
40
|
+
'HOME_URL="https://buninu.org"' \
|
|
41
|
+
'BUG_REPORT_URL="https://github.com/jjtseng93/buninu-linux/issues"' \
|
|
42
|
+
'LOGO=buninu-linux' \
|
|
43
|
+
'DEFAULT_HOSTNAME=buninu' > build/os-release
|
|
44
|
+
mkdir -p "$staging/usr/lib" "$staging/etc"
|
|
45
|
+
cp build/os-release "$staging/usr/lib/os-release"
|
|
46
|
+
ln -sfn ../usr/lib/os-release "$staging/etc/os-release"
|
|
47
|
+
# LOGO names an icon-theme icon; point the standard lookup paths at the Buninu
|
|
48
|
+
# icon that /buninu already ships instead of packing a second copy.
|
|
49
|
+
mkdir -p "$staging/usr/share/icons/hicolor/512x512/apps" "$staging/usr/share/pixmaps"
|
|
50
|
+
ln -sfn ../../../../../../buninu/icon.png "$staging/usr/share/icons/hicolor/512x512/apps/buninu-linux.png"
|
|
51
|
+
ln -sfn ../../../buninu/icon.png "$staging/usr/share/pixmaps/buninu-linux.png"
|
|
52
|
+
|
|
30
53
|
# fakeroot lets cpio record the character devices without real root. Nothing
|
|
31
54
|
# has mounted devtmpfs when the kernel execs Bun as PID 1, so every device
|
|
32
55
|
# Bun's startup needs has to be in the archive itself:
|