buninu-linux 0.5.1 → 0.7.0

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.
Files changed (41) hide show
  1. package/Dockerfile +23 -0
  2. package/NOTICE.md +111 -63
  3. package/README.md +280 -60
  4. package/build-image.sh +9 -5
  5. package/build-uki.sh +44 -28
  6. package/fetch-alpine.sh +43 -35
  7. package/fetch-bun.sh +14 -21
  8. package/index.js +150 -35
  9. package/initramfs/bin/buninu-linux-help +12 -0
  10. package/initramfs/bin/bunterm +64 -5
  11. package/initramfs/bin/chroot +4 -1
  12. package/initramfs/bin/ip +3 -2
  13. package/initramfs/bin/ps +3 -0
  14. package/initramfs/bin/tar +9 -0
  15. package/initramfs/init.js +79 -41
  16. package/initramfs/lib/bunterm/images.js +17 -2
  17. package/initramfs/lib/bunterm/terminal.js +25 -9
  18. package/initramfs/lib/bunterm/vt.js +91 -0
  19. package/initramfs/lib/dlopen.js +4 -0
  20. package/initramfs/lib/fbdev.js +33 -10
  21. package/initramfs/usr/share/doc/buninu-linux/bunterm.md +25 -7
  22. package/initramfs/usr/share/doc/buninu-linux/fbdev.md +1 -1
  23. package/initramfs/usr/share/doc/buninu-linux/tar.md +2 -0
  24. package/initramfs/usr/share/licenses/README.md +4 -0
  25. package/native/aarch64/lib/ld-musl-aarch64.so.1 +0 -0
  26. package/native/aarch64/lib/libc.musl-aarch64.so.1 +0 -0
  27. package/native/aarch64/lib/libgcc_s.so.1 +0 -0
  28. package/native/aarch64/lib/libstdc++.so.6 +0 -0
  29. package/package.json +2 -2
  30. package/run-qemu.sh +61 -12
  31. package/scripts/arch.sh +113 -0
  32. package/scripts/fetch.sh +5 -3
  33. package/scripts/pack-initramfs.sh +22 -4
  34. package/test/host/Dockerfile +13 -0
  35. package/test/host/boot-test.exp +70 -0
  36. package/test/host/host-test.sh +49 -0
  37. package/test/host/in-container.sh +58 -0
  38. /package/{initramfs → native/x86_64}/lib/ld-musl-x86_64.so.1 +0 -0
  39. /package/{initramfs → native/x86_64}/lib/libc.musl-x86_64.so.1 +0 -0
  40. /package/{initramfs → native/x86_64}/lib/libgcc_s.so.1 +0 -0
  41. /package/{initramfs → native/x86_64}/lib/libstdc++.so.6 +0 -0
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env bash
2
+ # Runs inside the container host-test.sh starts: an ordinary Debian 13 machine
3
+ # of the chosen CPU. Clones the committed HEAD of the checkout mounted at
4
+ # /repo, builds each guest with the host toolchain (no --docker), boots it
5
+ # through boot-test.exp, and checks that the builds leave git status clean.
6
+ set -euo pipefail
7
+
8
+ here=$(cd "$(dirname "$0")" && pwd)
9
+ guests=${GUESTS:-x86_64 aarch64}
10
+ kvm=no
11
+ if [ -r /dev/kvm ] && [ -w /dev/kvm ]; then kvm=yes; fi
12
+ echo "### host: $(uname -sm), node $(node --version), /dev/kvm: $kvm"
13
+
14
+ git config --global --add safe.directory '*'
15
+ git clone --quiet /repo /work
16
+ echo "### testing $(git -C /work log -1 --format='%h %s')"
17
+ # /cache is the host's downloads/, read-only; every file in it is still
18
+ # checked against its pinned SHA-256, and anything missing is fetched.
19
+ mkdir -p /work/downloads
20
+ cp -R /cache/. /work/downloads/
21
+ cd /work
22
+
23
+ strip_ansi() { sed 's/\x1b\[[0-9;?]*[a-zA-Z]//g' | tr -d '\r'; }
24
+
25
+ status=0
26
+ for guest in $guests; do
27
+ echo "### $guest: fetch + build ${BUILD_FLAGS:-}"
28
+ log=/tmp/build-$guest.log
29
+ # BUILD_FLAGS is split on purpose: it holds flags such as --linux-lts.
30
+ if node ./index.js -fb --arch "$guest" ${BUILD_FLAGS:-} > "$log" 2>&1; then
31
+ grep -E '^==>|^Fetched|^Built|^Packed|^note' "$log" || true
32
+ else
33
+ echo "### FAIL: $guest build; last lines:"
34
+ tail -n 30 "$log"
35
+ status=1
36
+ continue
37
+ fi
38
+
39
+ echo "### $guest: boot"
40
+ log=/tmp/boot-$guest.log
41
+ if expect "$here/boot-test.exp" /work "$guest" "${BOOT_TIMEOUT:-900}" > "$log" 2>&1; then
42
+ strip_ansi < "$log" | grep -a -E '^run-qemu.sh:|^network: eth0|^fetch example|^### ' || true
43
+ else
44
+ strip_ansi < "$log" | grep -a -E '^run-qemu.sh:|^### ok' || true
45
+ echo "### FAIL: $guest boot; last lines:"
46
+ strip_ansi < "$log" | tail -n 40
47
+ status=1
48
+ fi
49
+ done
50
+
51
+ echo "### git status after the builds (should be empty):"
52
+ if [ -n "$(git status --porcelain)" ]; then
53
+ git status --short
54
+ status=1
55
+ fi
56
+
57
+ if [ "$status" = 0 ]; then echo "### PASS"; else echo "### FAIL"; fi
58
+ exit "$status"
File without changes
File without changes