buninu-linux 0.2.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.
- package/LICENSE +21 -0
- package/LICENSES/Bun-LICENSE.md +84 -0
- package/LICENSES/GCC-Runtime-Library-Exception-3.1.txt +73 -0
- package/LICENSES/GPL-2.0.txt +338 -0
- package/LICENSES/GPL-3.0.txt +674 -0
- package/LICENSES/LGPL-2.1.txt +501 -0
- package/LICENSES/Linux-syscall-note.txt +25 -0
- package/LICENSES/musl-COPYRIGHT.txt +193 -0
- package/NOTICE.md +184 -0
- package/README.md +537 -0
- package/build-image.sh +44 -0
- package/build-uki.sh +75 -0
- package/fetch-alpine.sh +80 -0
- package/fetch-bun.sh +41 -0
- package/fetch-plus-build.sh +11 -0
- package/hello/build-hello.sh +14 -0
- package/hello/hello.c +50 -0
- package/index.js +235 -0
- package/initramfs/bin/sh +3 -0
- package/initramfs/buninu/.bashrc +11 -0
- package/initramfs/buninu/ARCHITECTURE.md +452 -0
- package/initramfs/buninu/CHANGELOG.md +580 -0
- package/initramfs/buninu/LICENSE +21 -0
- package/initramfs/buninu/README.md +1161 -0
- package/initramfs/buninu/apps/bun/make-bunBin.sh +99 -0
- package/initramfs/buninu/apps/bunmsh/CHANGELOG.md +493 -0
- package/initramfs/buninu/apps/bunmsh/LICENSE +21 -0
- package/initramfs/buninu/apps/bunmsh/LICENSE-MICRO +58 -0
- package/initramfs/buninu/apps/bunmsh/LICENSE-MKSH +295 -0
- package/initramfs/buninu/apps/bunmsh/PORTING.md +192 -0
- package/initramfs/buninu/apps/bunmsh/README.md +1042 -0
- package/initramfs/buninu/apps/bunmsh/bunmsh +7 -0
- package/initramfs/buninu/apps/bunmsh/bunshell.md +61 -0
- package/initramfs/buninu/apps/bunmsh/help/README.md +2237 -0
- package/initramfs/buninu/apps/bunmsh/help/alias.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/basename.md +38 -0
- package/initramfs/buninu/apps/bunmsh/help/builtin.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/bun.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/bunmsh.md +47 -0
- package/initramfs/buninu/apps/bunmsh/help/cat.md +31 -0
- package/initramfs/buninu/apps/bunmsh/help/catfancy.md +35 -0
- package/initramfs/buninu/apps/bunmsh/help/cd.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/chmod.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/clear.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/colon.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/command.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/cp.md +28 -0
- package/initramfs/buninu/apps/bunmsh/help/curl.md +181 -0
- package/initramfs/buninu/apps/bunmsh/help/cut.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/date.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/dirname.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/echo.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/env.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/eval.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/exec.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/exit.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/export.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/false.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/find.md +33 -0
- package/initramfs/buninu/apps/bunmsh/help/getopts.md +28 -0
- package/initramfs/buninu/apps/bunmsh/help/grep.md +34 -0
- package/initramfs/buninu/apps/bunmsh/help/head.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/kill.md +43 -0
- package/initramfs/buninu/apps/bunmsh/help/ln.md +28 -0
- package/initramfs/buninu/apps/bunmsh/help/ls.md +37 -0
- package/initramfs/buninu/apps/bunmsh/help/lsbun.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/lsfancy.md +37 -0
- package/initramfs/buninu/apps/bunmsh/help/md5sum.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/mkdir.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/mktemp.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/mv.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/print.md +30 -0
- package/initramfs/buninu/apps/bunmsh/help/printf.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/pspa.md +38 -0
- package/initramfs/buninu/apps/bunmsh/help/pspac.md +57 -0
- package/initramfs/buninu/apps/bunmsh/help/pwd.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/read.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/readonly.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/realpath.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/rm.md +33 -0
- package/initramfs/buninu/apps/bunmsh/help/rmdir.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/sed.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/seq.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/serve.md +50 -0
- package/initramfs/buninu/apps/bunmsh/help/set.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/sha256sum.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/shift.md +23 -0
- package/initramfs/buninu/apps/bunmsh/help/sleep.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/sort.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/source.md +23 -0
- package/initramfs/buninu/apps/bunmsh/help/tab.md +30 -0
- package/initramfs/buninu/apps/bunmsh/help/tac.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/tail.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/tee.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/test.md +30 -0
- package/initramfs/buninu/apps/bunmsh/help/time.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/touch.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/tr.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/true.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/type.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/umask.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/unalias.md +28 -0
- package/initramfs/buninu/apps/bunmsh/help/uname.md +31 -0
- package/initramfs/buninu/apps/bunmsh/help/unset.md +28 -0
- package/initramfs/buninu/apps/bunmsh/help/wc.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/whence.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/which.md +41 -0
- package/initramfs/buninu/apps/bunmsh/help/yes.md +23 -0
- package/initramfs/buninu/apps/bunmsh/index.js +7 -0
- package/initramfs/buninu/apps/bunmsh/package.json +30 -0
- package/initramfs/buninu/apps/bunmsh/serve.js +468 -0
- package/initramfs/buninu/apps/bunmsh/single-exe/README.md +402 -0
- package/initramfs/buninu/apps/bunmsh/single-exe/assetsHelper.js +371 -0
- package/initramfs/buninu/apps/bunmsh/single-exe/assetsLoader.mjs +85 -0
- package/initramfs/buninu/apps/bunmsh/single-exe/assetsPacker.js +218 -0
- package/initramfs/buninu/apps/bunmsh/single-exe/compiled.js +527 -0
- package/initramfs/buninu/apps/bunmsh/single-exe/entry.mjs +17 -0
- package/initramfs/buninu/apps/bunmsh/src/cat-fancy.js +117 -0
- package/initramfs/buninu/apps/bunmsh/src/cat-operands.js +31 -0
- package/initramfs/buninu/apps/bunmsh/src/completion.js +363 -0
- package/initramfs/buninu/apps/bunmsh/src/curl.js +1191 -0
- package/initramfs/buninu/apps/bunmsh/src/environment.js +61 -0
- package/initramfs/buninu/apps/bunmsh/src/fancy-ls.js +186 -0
- package/initramfs/buninu/apps/bunmsh/src/find.js +119 -0
- package/initramfs/buninu/apps/bunmsh/src/history.js +198 -0
- package/initramfs/buninu/apps/bunmsh/src/main.js +850 -0
- package/initramfs/buninu/apps/bunmsh/src/mouse.js +103 -0
- package/initramfs/buninu/apps/bunmsh/src/shell.js +3932 -0
- package/initramfs/buninu/apps/bunmsh/test/catfancy.test.js +102 -0
- package/initramfs/buninu/apps/bunmsh/test/curl.test.js +335 -0
- package/initramfs/buninu/apps/bunmsh/test/reference-source.sh +1 -0
- package/initramfs/buninu/apps/bunmsh/test/reference.test.js +817 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/README.md +3 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/bad.json +1 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.json +1 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.json5 +1 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.jsonc +2 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.jsonl +2 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.ndjson +1 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.toml +3 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.ts +15 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.xml +1 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.yaml +3 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.yml +1 -0
- package/initramfs/buninu/apps/bunmsh/test/serve.test.js +241 -0
- package/initramfs/buninu/apps/bunmsh/test/shell.test.js +2092 -0
- package/initramfs/buninu/apps/bunmsh/test/shell1.test.js +1087 -0
- package/initramfs/buninu/apps/bunmsh/test/shell2.test.js +457 -0
- package/initramfs/buninu/apps/bunmsh/test/shell3.test.js +741 -0
- package/initramfs/buninu/apps/bunmsh/test/t.sh +12 -0
- package/initramfs/buninu/apps/bunx/bunx.js +172 -0
- package/initramfs/buninu/apps/cmdlist +48 -0
- package/initramfs/buninu/apps/jsgotty/LICENSE +23 -0
- package/initramfs/buninu/apps/jsgotty/LICENSES/Apache-2.0-zmodem.js.txt +201 -0
- package/initramfs/buninu/apps/jsgotty/NOTICE +21 -0
- package/initramfs/buninu/apps/jsgotty/README.en.md +294 -0
- package/initramfs/buninu/apps/jsgotty/README.md +296 -0
- package/initramfs/buninu/apps/jsgotty/client.mjs +700 -0
- package/initramfs/buninu/apps/jsgotty/env.sh +2 -0
- package/initramfs/buninu/apps/jsgotty/gotty.js +3334 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/.package-lock.json +35 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/LICENSE.md +9 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/README.md +319 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/common.gypi +20 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/except.gypi +25 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/index.js +12 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/napi-inl.h +6607 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/napi.h +3201 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/node_addon_api.gyp +32 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/node_api.gyp +9 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/noexcept.gypi +26 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/nothing.c +0 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/package-support.json +21 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/package.json +480 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/tools/README.md +73 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/tools/check-napi.js +99 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/tools/clang-format.js +71 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/tools/conversion.js +301 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/tools/eslint-format.js +79 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/LICENSE +20 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/README.md +548 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/browser.js +8 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/index.js +22 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/buffer-util.js +131 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/constants.js +19 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/event-target.js +292 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/extension.js +203 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/limiter.js +55 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/receiver.js +760 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/sender.js +607 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/stream.js +161 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/subprotocol.js +62 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/validation.js +152 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/websocket-server.js +562 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/websocket.js +1407 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/package.json +70 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/wrapper.mjs +21 -0
- package/initramfs/buninu/apps/jsgotty/package-lock.json +46 -0
- package/initramfs/buninu/apps/jsgotty/package.json +19 -0
- package/initramfs/buninu/apps/jsgotty/patches/windowsPtyAgent.js +326 -0
- package/initramfs/buninu/apps/jsgotty/patches/windowsTerminal.js +204 -0
- package/initramfs/buninu/apps/jsgotty/rz.js +199 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/README.md +384 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/assetsHelper.js +371 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/assetsLoader.mjs +85 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/assetsPacker.js +218 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/compiled.js +498 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/entry.mjs +23 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/packAssets.sh +7 -0
- package/initramfs/buninu/apps/jsgotty/static/css/index.css +13 -0
- package/initramfs/buninu/apps/jsgotty/static/css/kitty.css +61 -0
- package/initramfs/buninu/apps/jsgotty/static/css/xterm.css +218 -0
- package/initramfs/buninu/apps/jsgotty/static/css/xterm_customize.css +35 -0
- package/initramfs/buninu/apps/jsgotty/static/favicon.ico +0 -0
- package/initramfs/buninu/apps/jsgotty/static/help.md +125 -0
- package/initramfs/buninu/apps/jsgotty/static/icon.svg +66 -0
- package/initramfs/buninu/apps/jsgotty/static/icon_192.png +0 -0
- package/initramfs/buninu/apps/jsgotty/static/index.html +164 -0
- package/initramfs/buninu/apps/jsgotty/static/js/gotty.js +31537 -0
- package/initramfs/buninu/apps/jsgotty/static/js/gotty.js.LICENSE.txt +7 -0
- package/initramfs/buninu/apps/jsgotty/static/js/gotty.js.map +1 -0
- package/initramfs/buninu/apps/jsgotty/static/js/gotty.licenses.txt +650 -0
- package/initramfs/buninu/apps/jsgotty/static/js/kitty.js +1101 -0
- package/initramfs/buninu/apps/jsgotty/static/js/windows_bridge.js +194 -0
- package/initramfs/buninu/apps/jsgotty/static/js/xterm-addon-unicode11.js +2 -0
- package/initramfs/buninu/apps/jsgotty/static/js/zmodem.js +1 -0
- package/initramfs/buninu/apps/jsgotty/static/manifest.json +15 -0
- package/initramfs/buninu/apps/jsgotty/sz.js +273 -0
- package/initramfs/buninu/apps/jsgotty/tests/kitty-order.test.js +58 -0
- package/initramfs/buninu/apps/jsgotty/tests/websocket-origin.test.js +54 -0
- package/initramfs/buninu/apps/jsgotty/viu.mjs +422 -0
- package/initramfs/buninu/apps/jsgotty/wgotty +62 -0
- package/initramfs/buninu/apps/jsgotty/windows-bridge-node.js +60 -0
- package/initramfs/buninu/apps/jsgotty/zmodem-node.js +262 -0
- package/initramfs/buninu/apps/jsmdcui/CHANGELOG.md +1118 -0
- package/initramfs/buninu/apps/jsmdcui/LICENSE +22 -0
- package/initramfs/buninu/apps/jsmdcui/README.md +1283 -0
- package/initramfs/buninu/apps/jsmdcui/cdp-maze.js +141 -0
- package/initramfs/buninu/apps/jsmdcui/clean.sh +9 -0
- package/initramfs/buninu/apps/jsmdcui/demos/basic.jpg +0 -0
- package/initramfs/buninu/apps/jsmdcui/demos/chinese.md +32 -0
- package/initramfs/buninu/apps/jsmdcui/demos/event.md +170 -0
- package/initramfs/buninu/apps/jsmdcui/demos/good.jpg +0 -0
- package/initramfs/buninu/apps/jsmdcui/demos/image-processor.md +366 -0
- package/initramfs/buninu/apps/jsmdcui/demos/image-processor.zh-TW.md +366 -0
- package/initramfs/buninu/apps/jsmdcui/demos/img-change.md +73 -0
- package/initramfs/buninu/apps/jsmdcui/demos/imgtool-zh.md +298 -0
- package/initramfs/buninu/apps/jsmdcui/demos/imgtool.md +298 -0
- package/initramfs/buninu/apps/jsmdcui/demos/maze.md +149 -0
- package/initramfs/buninu/apps/jsmdcui/demos/reactive.md +40 -0
- package/initramfs/buninu/apps/jsmdcui/demos/reader.md +513 -0
- package/initramfs/buninu/apps/jsmdcui/demos/select.md +63 -0
- package/initramfs/buninu/apps/jsmdcui/demos/todo-zh.md +190 -0
- package/initramfs/buninu/apps/jsmdcui/demos/todo.md +191 -0
- package/initramfs/buninu/apps/jsmdcui/edit +9 -0
- package/initramfs/buninu/apps/jsmdcui/jsmdcui.sh +16 -0
- package/initramfs/buninu/apps/jsmdcui/llm-maze.txt +94 -0
- package/initramfs/buninu/apps/jsmdcui/package.json +29 -0
- package/initramfs/buninu/apps/jsmdcui/project_structure.txt +35 -0
- package/initramfs/buninu/apps/jsmdcui/runmd.mjs +1140 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/atom-dark.micro +33 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/bubblegum.micro +31 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/cmc-16.micro +47 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/cmc-tc.micro +43 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/darcula.micro +34 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/default.micro +1 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/dracula-tc.micro +49 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/dukedark-tc.micro +38 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/dukelight-tc.micro +38 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/dukeubuntu-tc.micro +38 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/geany.micro +29 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/gotham.micro +29 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/gruvbox-tc.micro +29 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/gruvbox.micro +26 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/material-tc.micro +36 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/monokai-dark.micro +28 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/monokai.micro +34 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/one-dark.micro +39 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/railscast.micro +37 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/simple.micro +33 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/solarized-tc.micro +31 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/solarized.micro +30 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/sunny-day.micro +29 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/twilight.micro +40 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/zenburn.micro +30 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/actions.md +161 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/cdp.md +130 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/colors.md +421 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/commands.md +161 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/copypaste.md +149 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/defaultkeys.md +148 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/help.md +1283 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/keybindings.md +355 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/linter.md +90 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/options.md +709 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/plugins.md +544 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/tutorial.md +112 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/jsplugins/cdp/cdp-server.js +1263 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/jsplugins/cdp/cdp.js +203 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/jsplugins/chapter/chapter.js +111 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/jsplugins/diff/diff.js +46 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/jsplugins/example/example.js +117 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/jsplugins/linter/linter.js +281 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/plugins/autoclose/autoclose.lua +75 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/plugins/ftoptions/ftoptions.lua +17 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/plugins/literate/README.md +5 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/plugins/literate/literate.lua +55 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/plugins/status/help/status.md +21 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/plugins/status/status.lua +62 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/LICENSE +22 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/PowerShell.yaml +128 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/README.md +63 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/ada.yaml +43 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/apacheconf.yaml +59 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/arduino.yaml +101 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/asciidoc.yaml +51 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/asm.yaml +123 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/ats.yaml +99 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/awk.yaml +44 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/b.yaml +87 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/bat.yaml +57 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/c.yaml +60 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/caddyfile.yaml +23 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/cake.yaml +7 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/clojure.yaml +38 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/cmake.yaml +42 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/coffeescript.yaml +56 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/colortest.yaml +19 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/conky.yaml +17 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/cpp.yaml +91 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/crontab.yaml +36 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/crystal.yaml +72 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/csharp.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/css.yaml +44 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/csx.yaml +8 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/cuda.yaml +68 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/cython.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/d.yaml +121 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/dart.yaml +46 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/default.yaml +10 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/dockerfile.yaml +36 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/dot.yaml +29 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/elixir.yaml +30 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/elm.yaml +38 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/erb.yaml +42 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/erlang.yaml +45 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/fish.yaml +48 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/forth.yaml +34 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/fortran.yaml +64 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/freebsd-kernel.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/fsharp.yaml +48 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gdscript.yaml +61 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gemini.yaml +19 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gentoo-ebuild.yaml +48 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gentoo-etc-portage.yaml +23 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/git-commit.yaml +35 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/git-config.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/git-rebase-todo.yaml +19 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gleam.yaml +69 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/glsl.yaml +26 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gnuplot.yaml +15 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/go.yaml +62 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/godoc.yaml +17 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/golo.yaml +73 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gomod.yaml +31 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/graphql.yaml +47 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/groff.yaml +30 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/groovy.yaml +111 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/haml.yaml +16 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/hare.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/haskell.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/hc.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/html.yaml +70 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/html4.yaml +25 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/html5.yaml +25 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/ini.yaml +23 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/inputrc.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/java.yaml +37 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/javascript.yaml +124 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/jinja2.yaml +19 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/json.yaml +39 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/jsonnet.yaml +92 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/julia.yaml +57 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/justfile.yaml +40 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/keymap.yaml +27 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/kickstart.yaml +16 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/kotlin.yaml +66 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/kvlang.yaml +67 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/ledger.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/lfe.yaml +17 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/lilypond.yaml +26 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/lisp.yaml +17 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/log.yaml +92 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/lua.yaml +111 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/mail.yaml +25 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/makefile.yaml +38 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/man.yaml +12 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/markdown.yaml +65 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/mc.yaml +23 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/meson.yaml +51 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/micro.yaml +34 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/mpdconf.yaml +13 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/msbuild.yaml +6 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/nanorc.yaml +16 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/nftables.yaml +30 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/nginx.yaml +22 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/nim.yaml +27 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/nix.yaml +32 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/nu.yaml +114 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/objc.yaml +60 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/ocaml.yaml +43 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/octave.yaml +83 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/odin.yaml +64 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/pascal.yaml +45 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/patch.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/peg.yaml +16 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/perl.yaml +58 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/php.yaml +60 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/pkg-config.yaml +12 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/po.yaml +12 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/pony.yaml +37 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/pov.yaml +21 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/privoxy-action.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/privoxy-config.yaml +10 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/privoxy-filter.yaml +12 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/proto.yaml +40 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/prql.yaml +84 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/puppet.yaml +22 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/python2.yaml +60 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/python3.yaml +80 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/r.yaml +32 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/raku.yaml +42 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/reST.yaml +18 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/renpy.yaml +15 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/rpmspec.yaml +43 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/ruby.yaml +73 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/rust.yaml +78 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/sage.yaml +60 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/scad.yaml +53 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/scala.yaml +33 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/sed.yaml +13 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/sh.yaml +69 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/sls.yaml +15 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/smalltalk.yaml +55 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/solidity.yaml +41 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/sql.yaml +35 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/stata.yaml +67 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/svelte.yaml +27 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/swift.yaml +103 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/systemd.yaml +16 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/tcl.yaml +18 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/terraform.yaml +87 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/tex.yaml +32 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/toml.yaml +56 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/twig.yaml +55 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/typescript.yaml +49 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/v.yaml +80 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/vala.yaml +26 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/verilog.yaml +60 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/vhdl.yaml +37 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/vi.yaml +31 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/vue.yaml +64 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/xml.yaml +37 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/xresources.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/yaml.yaml +34 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/yum.yaml +12 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/zig.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/zscript.yaml +72 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/zsh.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/README.md +396 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/assetsHelper.js +371 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/assetsLoader.mjs +85 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/assetsPacker.js +218 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/compiled.js +498 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/entry.mjs +17 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/packAssets.sh +7 -0
- package/initramfs/buninu/apps/jsmdcui/src/MDCUI_DEFAULT_EDIT +0 -0
- package/initramfs/buninu/apps/jsmdcui/src/buffer/backup.js +165 -0
- package/initramfs/buninu/apps/jsmdcui/src/buffer/buffer.js +126 -0
- package/initramfs/buninu/apps/jsmdcui/src/buffer/fixed3-codec.js +140 -0
- package/initramfs/buninu/apps/jsmdcui/src/buffer/loc.js +38 -0
- package/initramfs/buninu/apps/jsmdcui/src/buffer/message.js +29 -0
- package/initramfs/buninu/apps/jsmdcui/src/build-args.js +40 -0
- package/initramfs/buninu/apps/jsmdcui/src/config/clean.js +172 -0
- package/initramfs/buninu/apps/jsmdcui/src/config/colorscheme.js +99 -0
- package/initramfs/buninu/apps/jsmdcui/src/config/config.js +125 -0
- package/initramfs/buninu/apps/jsmdcui/src/config/defaults.js +109 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/fence-events.mjs +144 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/heading-ids.mjs +1568 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/id-collision.mjs +111 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/identity.mjs +26 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/kitty-debug.mjs +25 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/kitty-images.mjs +280 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/kitty-mode.mjs +6 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/rerender-queue.mjs +66 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/rpc.mjs +1554 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/server.mjs +128 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/table-render.mjs +286 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/table-row-edit.mjs +226 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/task-checkbox.mjs +60 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/template-components.mjs +253 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/text-block-resize.mjs +177 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/tui-links.mjs +560 -0
- package/initramfs/buninu/apps/jsmdcui/src/display/ansi-style.js +60 -0
- package/initramfs/buninu/apps/jsmdcui/src/highlight/highlighter.js +243 -0
- package/initramfs/buninu/apps/jsmdcui/src/highlight/parser.js +225 -0
- package/initramfs/buninu/apps/jsmdcui/src/index.js +9586 -0
- package/initramfs/buninu/apps/jsmdcui/src/lua/engine.js +68 -0
- package/initramfs/buninu/apps/jsmdcui/src/platform/archive.js +50 -0
- package/initramfs/buninu/apps/jsmdcui/src/platform/clipboard.js +278 -0
- package/initramfs/buninu/apps/jsmdcui/src/platform/commands.js +221 -0
- package/initramfs/buninu/apps/jsmdcui/src/platform/terminal.js +5 -0
- package/initramfs/buninu/apps/jsmdcui/src/plugins/js-bridge.js +3377 -0
- package/initramfs/buninu/apps/jsmdcui/src/plugins/manager.js +674 -0
- package/initramfs/buninu/apps/jsmdcui/src/runtime/encodings.js +10 -0
- package/initramfs/buninu/apps/jsmdcui/src/runtime/registry.js +134 -0
- package/initramfs/buninu/apps/jsmdcui/src/screen/cell-buffer.js +81 -0
- package/initramfs/buninu/apps/jsmdcui/src/screen/events.js +263 -0
- package/initramfs/buninu/apps/jsmdcui/src/screen/screen.js +249 -0
- package/initramfs/buninu/apps/jsmdcui/src/screen/vt100.js +571 -0
- package/initramfs/buninu/apps/jsmdcui/src/shell/shell.js +70 -0
- package/initramfs/buninu/apps/jsmdcui/testapp.md +78 -0
- package/initramfs/buninu/apps/jsmdcui/tests/assets-helper.test.js +150 -0
- package/initramfs/buninu/apps/jsmdcui/tests/backup.test.js +158 -0
- package/initramfs/buninu/apps/jsmdcui/tests/cat-markdown.test.js +139 -0
- package/initramfs/buninu/apps/jsmdcui/tests/cdp-security.test.js +32 -0
- package/initramfs/buninu/apps/jsmdcui/tests/cdp-websocket-test.html +46 -0
- package/initramfs/buninu/apps/jsmdcui/tests/cmphex3b64.js +95 -0
- package/initramfs/buninu/apps/jsmdcui/tests/compiled-runtime.test.js +139 -0
- package/initramfs/buninu/apps/jsmdcui/tests/config-settings.test.js +52 -0
- package/initramfs/buninu/apps/jsmdcui/tests/demo.test.js +448 -0
- package/initramfs/buninu/apps/jsmdcui/tests/docs-sync.test.js +14 -0
- package/initramfs/buninu/apps/jsmdcui/tests/fence-events.test.js +1293 -0
- package/initramfs/buninu/apps/jsmdcui/tests/heading-ids.test.js +559 -0
- package/initramfs/buninu/apps/jsmdcui/tests/heading-list-selector.test.js +2393 -0
- package/initramfs/buninu/apps/jsmdcui/tests/id-collision.test.js +514 -0
- package/initramfs/buninu/apps/jsmdcui/tests/jmigt.js +16 -0
- package/initramfs/buninu/apps/jsmdcui/tests/js-plugin-prompts.test.js +110 -0
- package/initramfs/buninu/apps/jsmdcui/tests/key-event.md +10 -0
- package/initramfs/buninu/apps/jsmdcui/tests/kitty-demo.md +184 -0
- package/initramfs/buninu/apps/jsmdcui/tests/kitty-images.test.js +288 -0
- package/initramfs/buninu/apps/jsmdcui/tests/kitty-mode.test.js +14 -0
- package/initramfs/buninu/apps/jsmdcui/tests/platform-commands.test.js +18 -0
- package/initramfs/buninu/apps/jsmdcui/tests/platform-terminal.test.js +8 -0
- package/initramfs/buninu/apps/jsmdcui/tests/pty-demo.js +492 -0
- package/initramfs/buninu/apps/jsmdcui/tests/rerender-queue.test.js +130 -0
- package/initramfs/buninu/apps/jsmdcui/tests/table-render.test.js +150 -0
- package/initramfs/buninu/apps/jsmdcui/tests/table-row-edit.test.js +138 -0
- package/initramfs/buninu/apps/jsmdcui/tests/task-checkbox.test.js +33 -0
- package/initramfs/buninu/apps/jsmdcui/tests/template-components.test.js +422 -0
- package/initramfs/buninu/apps/jsmdcui/tests/text-block-resize.test.js +222 -0
- package/initramfs/buninu/apps/jsmdcui/tests/textarea.md +8 -0
- package/initramfs/buninu/apps/jsmdcui/tests/tui-links.test.js +298 -0
- package/initramfs/buninu/apps/jsmdcui/tests/wui-responsive-images.test.js +60 -0
- package/initramfs/buninu/apps/jsmdcui/tests/wui.test.js +108 -0
- package/initramfs/buninu/apps/jsmdcui/tests/wv-client.js +96 -0
- package/initramfs/buninu/apps/jsmdcui/tui +7 -0
- package/initramfs/buninu/apps/jsmdcui/wui +9 -0
- package/initramfs/buninu/apps/musl-la/LICENSES/GPL-3.0.txt +674 -0
- package/initramfs/buninu/apps/musl-la/LICENSES/gcc_runtime_exception.txt +73 -0
- package/initramfs/buninu/apps/musl-la/LICENSE_musl.txt +193 -0
- package/initramfs/buninu/apps/musl-la/NOTICE +41 -0
- package/initramfs/buninu/apps/musl-la/ld-musl-aarch64.so.1 +0 -0
- package/initramfs/buninu/apps/musl-la/libgcc_s.so.1 +0 -0
- package/initramfs/buninu/apps/musl-la/libstdc++.so.6 +0 -0
- package/initramfs/buninu/apps/musl-la/musl-la.sh +36 -0
- package/initramfs/buninu/apps/native-bridge/native-bridge.js +199 -0
- package/initramfs/buninu/apps/native-bridge/package.json +8 -0
- package/initramfs/buninu/apps/tts/tts.js +214 -0
- package/initramfs/buninu/apps/xclip/xclip.js +121 -0
- package/initramfs/buninu/apps/xdg-open/xdg-open.js +151 -0
- package/initramfs/buninu/bin/bun.bat +37 -0
- package/initramfs/buninu/bin/bun.sh +57 -0
- package/initramfs/buninu/bin/buninu-help.bat +4 -0
- package/initramfs/buninu/bin/buninu-help.sh +7 -0
- package/initramfs/buninu/bin/bunmsh.bat +3 -0
- package/initramfs/buninu/bin/bunmsh.sh +5 -0
- package/initramfs/buninu/bin/bunx.bat +3 -0
- package/initramfs/buninu/bin/glow.bat +3 -0
- package/initramfs/buninu/bin/glow.sh +5 -0
- package/initramfs/buninu/bin/init.js +779 -0
- package/initramfs/buninu/bin/install.js +570 -0
- package/initramfs/buninu/bin/jmi.bat +3 -0
- package/initramfs/buninu/bin/jmi.sh +5 -0
- package/initramfs/buninu/bin/jsgotty.bat +3 -0
- package/initramfs/buninu/bin/jsgotty.sh +5 -0
- package/initramfs/buninu/bin/jsmdcui.bat +11 -0
- package/initramfs/buninu/bin/libsh-loader.c +135 -0
- package/initramfs/buninu/bin/libsh-loader.so +0 -0
- package/initramfs/buninu/bin/multicall.sh +103 -0
- package/initramfs/buninu/bin/native-bridge.bat +3 -0
- package/initramfs/buninu/bin/rz.bat +3 -0
- package/initramfs/buninu/bin/rz.sh +5 -0
- package/initramfs/buninu/bin/shc.js +5 -0
- package/initramfs/buninu/bin/showimg.bat +3 -0
- package/initramfs/buninu/bin/showimg.sh +5 -0
- package/initramfs/buninu/bin/switch_to_android.sh +9 -0
- package/initramfs/buninu/bin/switch_to_linux.sh +7 -0
- package/initramfs/buninu/bin/sz.bat +3 -0
- package/initramfs/buninu/bin/sz.sh +5 -0
- package/initramfs/buninu/bin/tts.bat +3 -0
- package/initramfs/buninu/bin/xclip.bat +3 -0
- package/initramfs/buninu/bin/xdg-open.bat +3 -0
- package/initramfs/buninu/demo-server.js +64 -0
- package/initramfs/buninu/icon.png +0 -0
- package/initramfs/buninu/package.json +59 -0
- package/initramfs/etc/resolv.conf +1 -0
- package/initramfs/init.js +339 -0
- package/initramfs/lib/ld-musl-x86_64.so.1 +0 -0
- package/initramfs/lib/libc.musl-x86_64.so.1 +0 -0
- package/initramfs/lib/libgcc_s.so.1 +0 -0
- package/initramfs/lib/libstdc++.so.6 +0 -0
- package/initramfs/usr/bin/env +7 -0
- package/package.json +42 -0
- package/run-qemu.sh +44 -0
- package/scripts/fetch.sh +26 -0
- package/scripts/pack-initramfs.sh +41 -0
- package/test/build-init-bootstrap.sh +23 -0
- package/test/init-bootstrap.c +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
# Buninu Linux
|
|
2
|
+
- Buninu Linux is a Linux distribution running Bun as PID 1 with the Buninu userspace.
|
|
3
|
+
- The entire userland is based on Bun
|
|
4
|
+
- It boots an unsigned UEFI UKI (Unified Kernel Image), a single `.EFI` file inside vda.img with these components
|
|
5
|
+
* a prebuilt kernel from Alpine
|
|
6
|
+
* a prebuilt systemd EFI stub from Alpine
|
|
7
|
+
* initramfs JavaScript components:
|
|
8
|
+
* `/init.js` and other modules
|
|
9
|
+
* initramfs Native components:
|
|
10
|
+
* Official `bun-linux-x64-musl` and its dependencies
|
|
11
|
+
+ ld-musl-x86_64.so.1
|
|
12
|
+
+ libc.musl-x86_64.so.1 (intentional copy)
|
|
13
|
+
+ libgcc_s.so.1
|
|
14
|
+
+ libstdc++.so.6
|
|
15
|
+
- The kernel runs `bun` as PID 1
|
|
16
|
+
* Everything an init would normally do — mounting filesystems, loading modules, configuring the network, reaping children
|
|
17
|
+
* happens in JavaScript through `bun:ffi`
|
|
18
|
+
* There is no BusyBox and no C bootstrap.
|
|
19
|
+
|
|
20
|
+
- Souce: [github.com/jjtseng93/buninu-linux](https://github.com/jjtseng93/buninu-linux)
|
|
21
|
+
- Buninu userspace source: [github.com/jjtseng93/buninu](https://github.com/jjtseng93/buninu)
|
|
22
|
+
+ **BUNinu Is Not Unix** 🐮
|
|
23
|
+
+ **幫你牛** 🐂 ・ **Bunに入魂** 🔥
|
|
24
|
+
- <img src="https://raw.githubusercontent.com/jjtseng93/buninu/main/icon.png" width="256">
|
|
25
|
+
- Still in the early stages
|
|
26
|
+
* Built & tested on Android Termux QEMU (PRoot+Native)
|
|
27
|
+
* Booted successfully on real x86-64 UEFI hardware with `--real`: Bun reached
|
|
28
|
+
its interactive REPL on the local display and keyboard. Physical networking
|
|
29
|
+
is not implemented yet, but the bundled `jmi` editor and local JavaScript
|
|
30
|
+
execution work.
|
|
31
|
+
* Built & booted in a cloud VM provided by ChatGPT Work mode, running Ubuntu 24.04.3 LTS on x86-64 with QEMU 8.2.2, TCG, and OVMF. Bun 1.4.2 was verified running as PID 1, and the Buninu userspace and bunmsh started successfully.
|
|
32
|
+
|
|
33
|
+
- The hello-world EFI application in Section 1 is the starting point that the UKI replaces
|
|
34
|
+
- It still builds, and it is the quickest way to check whether the disk image and firmware path work at all.
|
|
35
|
+
|
|
36
|
+
## Quick start
|
|
37
|
+
|
|
38
|
+
- Two shells are involved, sharing one checkout:
|
|
39
|
+
* Build tools in Debian 13 PRoot,
|
|
40
|
+
* QEMU in native Termux.
|
|
41
|
+
- Clone into the Termux home
|
|
42
|
+
* proot-distro exposes that directory inside the guest at the same absolute path
|
|
43
|
+
* So both shells work on the same files
|
|
44
|
+
* (`~` differs between them, the full path does not)
|
|
45
|
+
|
|
46
|
+
### Steps
|
|
47
|
+
#### in native Termux
|
|
48
|
+
- pkg install qemu-system-x86-64
|
|
49
|
+
- git clone https://github.com/jjtseng93/buninu-linux.git ~/buninu-linux
|
|
50
|
+
|
|
51
|
+
#### in PRoot (Debian 13)
|
|
52
|
+
- apt install binutils-mingw-w64-x86-64 cpio curl dosfstools fakeroot mtools parted unzip
|
|
53
|
+
- cd /data/data/com.termux/files/home/buninu-linux
|
|
54
|
+
- bun ./index.js -fb
|
|
55
|
+
* fetch ~80 MB from Alpine/Bun & build vda.img
|
|
56
|
+
|
|
57
|
+
#### back in native Termux
|
|
58
|
+
- cd ~/buninu-linux
|
|
59
|
+
- bun ./index.js -r
|
|
60
|
+
* boot it
|
|
61
|
+
|
|
62
|
+
`index.js` runs under bun or node. A successful boot ends like this, with a
|
|
63
|
+
REPL on the serial console:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
Run /bin/bun as init process
|
|
67
|
+
init.js: Bun runtime entered JavaScript
|
|
68
|
+
init.js: loading physical musl libc for FFI
|
|
69
|
+
init.js: mounted /proc, /sys, /dev, /tmp
|
|
70
|
+
network: lo 127.0.0.1/8
|
|
71
|
+
network: eth0 10.0.2.15/24 via 10.0.2.2
|
|
72
|
+
fetch example.com: HTTP 200, text/html
|
|
73
|
+
|
|
74
|
+
Welcome to Buninu Linux!
|
|
75
|
+
Bun 1.4.2 is now PID 1
|
|
76
|
+
|
|
77
|
+
Type start() to run buninu --local
|
|
78
|
+
bun-repl>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Ctrl-C stops QEMU. After editing `initramfs/init.js`, `bun ./index.js -b` in
|
|
82
|
+
PRoot rebuilds the image; `-h` lists the flags. Section 0 explains each
|
|
83
|
+
dependency, Section 2 the build and how PID 1 works.
|
|
84
|
+
|
|
85
|
+
## 0. Install dependencies
|
|
86
|
+
|
|
87
|
+
- Building Buninu Linux (Section 2) — needs no compiler:
|
|
88
|
+
- Bun ships as a prebuilt binary and the UKI is assembled with `objcopy`.
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
apt install binutils-mingw-w64-x86-64 cpio curl dosfstools fakeroot mtools parted unzip
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- A C toolchain is only needed for:
|
|
95
|
+
* The hello world .EFI (Section 1)
|
|
96
|
+
+ `hello/hello.c`
|
|
97
|
+
* The retired bootstrap in `test/build-init-bootstrap.sh`
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
apt install clang lld
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The baseline is the stock Debian 13 (trixie) OCI image, which is also what this
|
|
104
|
+
PRoot is; a dependency is anything that image does not already have.
|
|
105
|
+
`debian:13` and `debian:13-slim` carry the same 78 packages and identical
|
|
106
|
+
binaries in every `PATH` directory — slim only drops docs, man pages and
|
|
107
|
+
locales — so `debian:13-slim` is the better starting point at 105 MB against
|
|
108
|
+
149 MB, and the list below is the same either way.
|
|
109
|
+
|
|
110
|
+
The base image already provides `bash`, GNU `tar`, `gzip`, `sha256sum`,
|
|
111
|
+
`mknod`, `find`, `sort`, `mkdir`, `mktemp`, `cp`, `rm`, `chmod`, `truncate`,
|
|
112
|
+
`dd`, `printf`, `awk` and `dirname`, all used by these scripts as they are.
|
|
113
|
+
Everything else has to be added. For Section 2:
|
|
114
|
+
|
|
115
|
+
* **`binutils-mingw-w64-x86-64`** — `x86_64-w64-mingw32-objcopy` appends the
|
|
116
|
+
`.osrel`, `.cmdline`, `.linux` and `.initrd` sections to the EFI stub, and
|
|
117
|
+
`x86_64-w64-mingw32-objdump` reads `ImageBase` back out of it. Both need a
|
|
118
|
+
PE-aware binutils: the ELF `objcopy` cannot write these sections, and
|
|
119
|
+
`llvm-objcopy` rejects `--change-section-vma`.
|
|
120
|
+
* **`cpio`** — writes `build/initramfs.cpio.gz`. The scripts pass
|
|
121
|
+
`--owner=0:0 --reproducible`, so it has to be GNU cpio rather than a busybox
|
|
122
|
+
applet.
|
|
123
|
+
* **`curl`** — fetches the Alpine `.apk` packages and the Bun release zip.
|
|
124
|
+
* **`dosfstools`** — `mkfs.fat` formats the ESP, and its `-h` hidden-sector
|
|
125
|
+
count has to match the sector the partition starts at.
|
|
126
|
+
* **`fakeroot`** — lets `mknod` and `cpio` record root-owned character devices
|
|
127
|
+
in the archive without real root, which PRoot cannot grant.
|
|
128
|
+
* **`mtools`** — `mmd` and `mcopy` create `/EFI/BOOT` inside the FAT image and
|
|
129
|
+
copy the UKI in, without a mount or a loop device.
|
|
130
|
+
* **`parted`** — writes the protective MBR, the primary and backup GPT, and the
|
|
131
|
+
ESP partition entry with its type GUID.
|
|
132
|
+
* **`unzip`** — extracts the `bun` binary from the release zip.
|
|
133
|
+
|
|
134
|
+
To boot, from native Termux rather than PRoot:
|
|
135
|
+
|
|
136
|
+
* **`qemu-system-x86_64`** — not an `apt` dependency: `pkg install
|
|
137
|
+
qemu-system-x86-64` provides it together with the OVMF firmware at
|
|
138
|
+
`$PREFIX/share/qemu/edk2-x86_64-code.fd`.
|
|
139
|
+
* **`bun`** (or `node`) — runs `index.js`; needed in both shells. Install bun
|
|
140
|
+
from <https://bun.sh>, or `pkg install nodejs` / `apt install nodejs`. Under
|
|
141
|
+
bun, `--readme` renders the Markdown; under node it is printed as-is.
|
|
142
|
+
|
|
143
|
+
For Section 1 and the retired bootstrap only:
|
|
144
|
+
|
|
145
|
+
* **`clang`** *(Section 1 only)* — compiles `hello/hello.c` to a PE32+ object
|
|
146
|
+
(`--target=x86_64-pc-win32-coff`) and, in `test/build-init-bootstrap.sh`, the
|
|
147
|
+
freestanding x86-64 `/init`. Nothing in the Bun path compiles anything.
|
|
148
|
+
Resolves to `clang-19` on trixie.
|
|
149
|
+
* **`lld`** *(Section 1 only)* — `lld-link` links `hello/hello.obj` into an EFI
|
|
150
|
+
application (`/subsystem:efi_application`), and the same package backs
|
|
151
|
+
`clang -fuse-ld=lld` for the bootstrap. Resolves to `lld-19`.
|
|
152
|
+
|
|
153
|
+
`parted`, `dosfstools` and `mtools` back `build-image.sh`, which both sections
|
|
154
|
+
use.
|
|
155
|
+
|
|
156
|
+
## 1. Hello world
|
|
157
|
+
|
|
158
|
+
- `hello/hello.c` is a freestanding PE32+ EFI application installed at the
|
|
159
|
+
removable media fallback path `EFI/BOOT/BOOTX64.EFI`.
|
|
160
|
+
- It's a smoke test rather than the complete Buninu Linux
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
./hello/build-hello.sh # in PRoot
|
|
164
|
+
./build-image.sh # in PRoot
|
|
165
|
+
bun ./index.js -r # in native Termux
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
It writes `Hello world from x64 UEFI!` to the UEFI console. The included OVMF
|
|
169
|
+
firmware exposes that console over COM1 and `run-qemu.sh` attaches COM1 to the
|
|
170
|
+
current terminal, so the message is visible without a graphical display. The
|
|
171
|
+
application waits after printing; press any key to return to the OVMF
|
|
172
|
+
interface, then Ctrl-C to stop QEMU.
|
|
173
|
+
|
|
174
|
+
`build-image.sh` is shared with Section 2 — see [Disk layout](#disk-layout).
|
|
175
|
+
|
|
176
|
+
## 2. Buninu Linux – Bun as PID 1
|
|
177
|
+
|
|
178
|
+
An unsigned x64 Unified Kernel Image assembled from official Alpine packages,
|
|
179
|
+
with Bun as the init process, replaces the hello-world application:
|
|
180
|
+
|
|
181
|
+
```sh
|
|
182
|
+
bun ./index.js -fb # in PRoot
|
|
183
|
+
bun ./index.js -r # in native Termux
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
`index.js` is the single entry point (`npm run build` / `npm run pack` /
|
|
187
|
+
`npm start` call it too). It has three stage flags that combine in any order
|
|
188
|
+
and always run as fetch → build → run:
|
|
189
|
+
|
|
190
|
+
| flag | runs | use it when |
|
|
191
|
+
| --- | --- | --- |
|
|
192
|
+
| `-f`, `--fetch` | `fetch-alpine.sh`, `fetch-bun.sh` | first clone, or after bumping a pinned version |
|
|
193
|
+
| `-b`, `--build` | `build-uki.sh`, `build-image.sh` | after editing `initramfs/init.js` or the kernel command line |
|
|
194
|
+
| `-r`, `--run` | `run-qemu.sh` | to boot what is there |
|
|
195
|
+
|
|
196
|
+
`--linux-lts` selects Alpine's general-purpose LTS kernel. `--real` implies
|
|
197
|
+
`--linux-lts` and builds for physical hardware: it makes `tty0` the primary
|
|
198
|
+
console and includes the xHCI/USB HID modules needed by a typical USB keyboard.
|
|
199
|
+
|
|
200
|
+
`-fbr` is the whole pipeline, `-br` is the edit-and-boot loop, and anything
|
|
201
|
+
after `--` is handed to `qemu-system-x86_64` verbatim (`-r -- -m 1G`). Before
|
|
202
|
+
starting, it checks that every tool the chosen stages need is on `PATH` and
|
|
203
|
+
lists what is missing instead of failing halfway; fetch and build want the
|
|
204
|
+
PRoot toolchain from Section 0, run wants Termux's QEMU. The shell scripts are
|
|
205
|
+
what actually does the work and each still runs on its own.
|
|
206
|
+
|
|
207
|
+
```text
|
|
208
|
+
index.js entry point: -f / -b / -r / --linux-lts / --real
|
|
209
|
+
fetch-alpine.sh [fetch] kernel, EFI stub, musl, network/input modules
|
|
210
|
+
fetch-bun.sh [fetch] Bun, libstdc++, libgcc
|
|
211
|
+
build-uki.sh [build] UKI; calls scripts/pack-initramfs.sh
|
|
212
|
+
build-image.sh [build] GPT disk image; shared with Section 1
|
|
213
|
+
run-qemu.sh [run]
|
|
214
|
+
fetch-plus-build.sh shell-only -fb
|
|
215
|
+
scripts/fetch.sh hash-checked download helper, sourced by fetch-*.sh
|
|
216
|
+
scripts/pack-initramfs.sh cpio archive with the device nodes
|
|
217
|
+
hello/ Section 1: hello.c and build-hello.sh
|
|
218
|
+
test/ the retired C bootstrap and its build script
|
|
219
|
+
initramfs/ init.js and the committed libraries; rest fetched
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
The pinned inputs are Alpine v3.24 `linux-virt-6.18.52-r0`, musl `1.2.6-r2`,
|
|
223
|
+
`systemd-efistub-260.2-r0`, `libstdc++`/`libgcc` `15.2.0-r5`, and Bun 1.4.2
|
|
224
|
+
`linux-x64-musl-baseline` — about 80 MB in total. No BusyBox, and no userland
|
|
225
|
+
beyond Bun itself.
|
|
226
|
+
|
|
227
|
+
Every step is idempotent and `-f` re-downloads nothing: `scripts/fetch.sh`
|
|
228
|
+
treats each pinned SHA-256 as the cache key, so a file already in `downloads/`
|
|
229
|
+
with the right hash is used as-is, and anything missing, truncated, stale or
|
|
230
|
+
tampered with is fetched again and has to pass the same hash before a script
|
|
231
|
+
extracts from it. Bumping a version changes both the file name and the hash, so
|
|
232
|
+
it always refetches.
|
|
233
|
+
|
|
234
|
+
### Build pipeline
|
|
235
|
+
|
|
236
|
+
`fetch-plus-build.sh` is only a wrapper, the same as `bun ./index.js -fb`: it
|
|
237
|
+
runs the steps below in order. Each one writes files the next one reads.
|
|
238
|
+
|
|
239
|
+
| script | reads | writes |
|
|
240
|
+
| --- | --- | --- |
|
|
241
|
+
| `fetch-alpine.sh` | Alpine CDN | `kernel/vmlinuz-virt`, `kernel/linuxx64.efi.stub`, `initramfs/lib/ld-musl-x86_64.so.1`, `initramfs/lib/modules/…/{failover,net_failover,virtio_net}.ko` |
|
|
242
|
+
| `fetch-bun.sh` | GitHub, Alpine CDN | `initramfs/bin/bun`, `initramfs/lib/{libc.musl-x86_64.so.1,libstdc++.so.6,libgcc_s.so.1}` |
|
|
243
|
+
| `scripts/pack-initramfs.sh` | `initramfs/` | `build/initramfs.cpio.gz` |
|
|
244
|
+
| `build-uki.sh` | that archive, kernel, stub | `build/cmdline`, `build/os-release`, `vda/EFI/BOOT/BOOTX64.EFI` |
|
|
245
|
+
| `build-image.sh` | `vda/EFI/BOOT/BOOTX64.EFI` | `vda.img` |
|
|
246
|
+
|
|
247
|
+
`build-uki.sh` calls `scripts/pack-initramfs.sh` itself, so that one is rarely
|
|
248
|
+
run directly.
|
|
249
|
+
|
|
250
|
+
The stages nest — the initramfs is baked into the UKI, and the UKI into the
|
|
251
|
+
disk image — so a one-line edit to `initramfs/init.js` still needs both of:
|
|
252
|
+
|
|
253
|
+
```sh
|
|
254
|
+
bun ./index.js -b # or: ./build-uki.sh && ./build-image.sh
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
The kernel command line works the same way: `build-uki.sh` writes it to
|
|
258
|
+
`build/cmdline` and compiles it into the UKI. Nothing reads it from disk at
|
|
259
|
+
boot.
|
|
260
|
+
|
|
261
|
+
### UKI layout
|
|
262
|
+
|
|
263
|
+
`build-uki.sh` appends sections to systemd's `linuxx64.efi.stub` with
|
|
264
|
+
`objcopy`, at hand-picked VMAs because `objcopy` will not lay them out for you:
|
|
265
|
+
|
|
266
|
+
| section | offset from image base | contents | size |
|
|
267
|
+
| --- | --- | --- | --- |
|
|
268
|
+
| `.text` | +0x0 | the stub itself | 66 KB |
|
|
269
|
+
| `.osrel` | +0x20000 | `build/os-release` | 78 B |
|
|
270
|
+
| `.cmdline` | +0x30000 | `build/cmdline` | 92 B |
|
|
271
|
+
| `.linux` | +0x2000000 | `kernel/vmlinuz-virt` | 12 MB |
|
|
272
|
+
| `.initrd` | +0x3000000 | `build/initramfs.cpio.gz` | 34 MB |
|
|
273
|
+
|
|
274
|
+
The result is a single 46 MB PE32+ file holding kernel, initramfs and command
|
|
275
|
+
line.
|
|
276
|
+
|
|
277
|
+
### Disk layout
|
|
278
|
+
|
|
279
|
+
`build-image.sh` needs no mount, no loop device and no root privilege. It
|
|
280
|
+
formats a standalone FAT32 image, fills it with mtools, builds the GPT with
|
|
281
|
+
`parted`, and `dd`s the filesystem into the partition with
|
|
282
|
+
`conv=notrunc,sparse`. The `mkfs.fat -h 2048` matters: the FAT hidden-sector
|
|
283
|
+
count has to match the sector the partition will start at, or some firmware
|
|
284
|
+
rejects the volume.
|
|
285
|
+
|
|
286
|
+
```text
|
|
287
|
+
LBA 0 protective MBR
|
|
288
|
+
LBA 1..33 primary GPT
|
|
289
|
+
LBA 2048..262110 ESP, FAT32 "EFIBOOT", type GUID C12A7328-F81F-11D2-BA4B-00A0C93EC93B
|
|
290
|
+
/EFI/BOOT/BOOTX64.EFI the UKI
|
|
291
|
+
LBA 262111.. backup GPT
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
128 MiB sparse, 1 MiB-aligned, with 34 sectors reserved at the end for the
|
|
295
|
+
backup GPT. `EFI/BOOT/BOOTX64.EFI` is the removable-media fallback path, so the
|
|
296
|
+
firmware runs it without any NVRAM boot entry.
|
|
297
|
+
|
|
298
|
+
### Running
|
|
299
|
+
|
|
300
|
+
`bun ./index.js -r` runs `run-qemu.sh`, which boots `vda.img` on q35 under
|
|
301
|
+
TCG with 512 MiB, a virtio disk, virtio-net user networking, no display, and
|
|
302
|
+
COM1 on stdio; anything after `--` is appended to the QEMU command line. The
|
|
303
|
+
chain is OVMF → the stub's `.text` → the stub loading its own
|
|
304
|
+
`.linux`/`.initrd`/`.cmdline` → kernel → `rdinit=/bin/bun`.
|
|
305
|
+
|
|
306
|
+
Ctrl-C quits QEMU. Leaving the REPL does not end the session: `init.js`
|
|
307
|
+
restarts it, because a PID 1 that exits panics the kernel.
|
|
308
|
+
|
|
309
|
+
#### Real hardware
|
|
310
|
+
|
|
311
|
+
Build the physical-machine image in PRoot, then write the complete `vda.img`
|
|
312
|
+
(not its inner FAT partition) to a USB drive and boot it as x86-64 UEFI media:
|
|
313
|
+
|
|
314
|
+
```sh
|
|
315
|
+
bun ./index.js -fb --real
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
`--real` uses Alpine `linux-lts`, adds the xHCI and USB HID module chain, and
|
|
319
|
+
changes the embedded console order to:
|
|
320
|
+
|
|
321
|
+
```text
|
|
322
|
+
console=ttyS0,115200 console=tty0
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Serial kernel logging is retained, while `/dev/console` and the Bun REPL use
|
|
326
|
+
the physical display and keyboard. The UKI is unsigned, so Secure Boot must be
|
|
327
|
+
disabled unless the image is signed separately.
|
|
328
|
+
|
|
329
|
+
This path has been tested successfully on real hardware: the machine entered
|
|
330
|
+
the interactive `bun-repl>` with working local keyboard input. Physical NIC
|
|
331
|
+
drivers and configuration are not included yet, so networking is currently
|
|
332
|
+
expected to fail there; that failure is caught and does not prevent local use.
|
|
333
|
+
|
|
334
|
+
From the Bun REPL, start the bundled Buninu userspace:
|
|
335
|
+
|
|
336
|
+
```text
|
|
337
|
+
bun-repl> start()
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
The bundled `jmi` terminal editor works without a network connection. For
|
|
341
|
+
example, open a new `hlw.js` from the Buninu shell:
|
|
342
|
+
|
|
343
|
+
```sh
|
|
344
|
+
jmi hlw.js
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
The recommended colour theme for `jmi` is `cmc-tc`. Once inside the editor,
|
|
348
|
+
press `Ctrl-E`, type `theme ` (including the trailing space), press `Tab`, then
|
|
349
|
+
use the `Up` and `Down` arrow keys to select `cmc-tc` and press `Enter`.
|
|
350
|
+
|
|
351
|
+
Enter and save this content:
|
|
352
|
+
|
|
353
|
+
```js
|
|
354
|
+
console.log("Hello world from real hardware");
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
After leaving the editor, execute it locally:
|
|
358
|
+
|
|
359
|
+
```sh
|
|
360
|
+
bun hlw.js
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
The normal QEMU image should still be built without `--real`, because QEMU's
|
|
364
|
+
default runner uses `-display none` and expects the Bun REPL on `ttyS0`:
|
|
365
|
+
|
|
366
|
+
```sh
|
|
367
|
+
bun ./index.js -fb --linux-lts
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
#### Networking
|
|
371
|
+
|
|
372
|
+
The NIC is QEMU user-mode networking (SLIRP): the guest is `10.0.2.15/24`
|
|
373
|
+
behind a NAT with `10.0.2.2` as gateway and `10.0.2.3` as DNS, so it can reach
|
|
374
|
+
out — `fetch example.com` at boot proves it — but nothing reaches in unless a
|
|
375
|
+
port is forwarded. `PORTS` does that, space-separated, as `host[:guest]` with
|
|
376
|
+
`guest` defaulting to `host`:
|
|
377
|
+
|
|
378
|
+
```sh
|
|
379
|
+
PORTS="18080" bun ./index.js -r # host 127.0.0.1:18080 → guest :18080
|
|
380
|
+
PORTS="18080 2222:22" bun ./index.js -r # …plus host 127.0.0.1:2222 → guest :22
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
`run-qemu.sh` turns each entry into `hostfwd=tcp:127.0.0.1:H-:G`. Two things
|
|
384
|
+
follow from how SLIRP forwards:
|
|
385
|
+
|
|
386
|
+
* The host side binds `127.0.0.1` only, so nothing is exposed on the device's
|
|
387
|
+
own network interfaces. Drop the address (`hostfwd=tcp::H-:G`) to change
|
|
388
|
+
that.
|
|
389
|
+
* A forwarded connection arrives at the guest's `eth0` address, so the service
|
|
390
|
+
inside has to listen on `0.0.0.0` (or `10.0.2.15`). One bound to the guest's
|
|
391
|
+
own `127.0.0.1` gets no traffic from outside; verified with two servers on
|
|
392
|
+
forwarded ports, one on each address.
|
|
393
|
+
|
|
394
|
+
The guest's `127.0.0.1` still works for anything inside the guest: `init.js`
|
|
395
|
+
brings `lo` up right after mounting, which is when the kernel assigns
|
|
396
|
+
`127.0.0.1/8`. Without that step every bind to `127.0.0.1` fails with
|
|
397
|
+
`EADDRNOTAVAIL`.
|
|
398
|
+
|
|
399
|
+
Two things to expect:
|
|
400
|
+
|
|
401
|
+
* **Booting modifies `vda.img`.** The firmware is attached read-only and has no
|
|
402
|
+
separate variable store, so OVMF persists its NV variables as `/NvVars` on
|
|
403
|
+
the ESP. `git status` reports `vda.img` as modified after every boot.
|
|
404
|
+
* **QEMU write-locks `vda.img`.** A second instance fails with `Failed to get
|
|
405
|
+
"write" lock`; copy the image first if you want two at once.
|
|
406
|
+
|
|
407
|
+
### Iterating on the boot
|
|
408
|
+
|
|
409
|
+
Rebuilding the UKI and the disk image for every attempt is slow, and neither is
|
|
410
|
+
needed to exercise the guest: QEMU can boot the kernel and initramfs directly
|
|
411
|
+
and take the command line on the host side, so only
|
|
412
|
+
`./scripts/pack-initramfs.sh` has to be re-run between attempts.
|
|
413
|
+
|
|
414
|
+
```sh
|
|
415
|
+
qemu-system-x86_64 -machine q35,accel=tcg -cpu max -m 512M \
|
|
416
|
+
-kernel kernel/vmlinuz-virt -initrd build/initramfs.cpio.gz \
|
|
417
|
+
-append "console=ttyS0,115200 panic=0 PATH=/bin rdinit=/bin/bun -- -e console.log(1+1)" \
|
|
418
|
+
-nic user,model=virtio-net-pci -display none -serial stdio -no-reboot
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
A panicking guest does not exit QEMU — `panic=0` parks it rather than rebooting
|
|
422
|
+
into the firmware menu — so press Ctrl-C. Run the real UEFI path once at the
|
|
423
|
+
end, since it is the only thing that exercises the stub and the GPT.
|
|
424
|
+
|
|
425
|
+
### Reaching JavaScript with nothing mounted
|
|
426
|
+
|
|
427
|
+
The default QEMU kernel command line is
|
|
428
|
+
|
|
429
|
+
```text
|
|
430
|
+
console=tty0 console=ttyS0,115200 panic=0 PATH=/bin rdinit=/bin/bun -- -e import('/init.js')
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
so the kernel execs `/bin/bun` itself, with nothing native in between, and
|
|
434
|
+
`init.js` mounts `/proc`, `/sys`, `/dev` and `/tmp` through `bun:ffi` as its
|
|
435
|
+
first action. Everything before `--` needs an `=`, because the kernel appends
|
|
436
|
+
any bare word to the init argv instead of treating it as an environment
|
|
437
|
+
assignment; everything after `--` becomes `argv[1..]` verbatim, with `argv[0]`
|
|
438
|
+
set to the `rdinit=` path. Parameter order is otherwise free, so `rdinit=` is
|
|
439
|
+
placed last and the tail of the line reads as the `bun -e …` it turns into.
|
|
440
|
+
|
|
441
|
+
Two separate things have to be true for this to work.
|
|
442
|
+
|
|
443
|
+
**The entry point must be `-e`, not a file.** `bun /init.js` opens the entry
|
|
444
|
+
file and then `readlink("/proc/self/fd/N")` to canonicalize it
|
|
445
|
+
(`maybe_open_with_bun_js` in `src/runtime/cli/run_command.rs`); it gives up
|
|
446
|
+
when that fails, which is what a /proc-less boot runs into. `-e` never opens an
|
|
447
|
+
entry file, so it skips that step. Bun's startup does *not* resolve
|
|
448
|
+
`/proc/self/exe` — that is memoized behind `process.execPath`/`process.argv[0]`
|
|
449
|
+
and falls back to `argv[0]` — and the remaining `/proc` reads during startup
|
|
450
|
+
(`vm/overcommit_memory`, `vm/mmap_min_addr`, `self/cgroup`, `self/statm`) are
|
|
451
|
+
all non-fatal.
|
|
452
|
+
|
|
453
|
+
**`/dev/urandom` must exist before Bun starts.** JSC's `OSRandomSource` calls
|
|
454
|
+
`CRASH()` when it cannot open it, and as PID 1 that is an instant kernel panic:
|
|
455
|
+
|
|
456
|
+
```text
|
|
457
|
+
panic(main thread): abort() called
|
|
458
|
+
traps: bun[1] trap invalid opcode
|
|
459
|
+
Kernel panic - not syncing: Attempted to kill init!
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
Nothing has mounted devtmpfs at that point, so `scripts/pack-initramfs.sh`
|
|
463
|
+
records `urandom` — along with `console`, which the kernel opens as init's
|
|
464
|
+
fd 0/1/2 before the exec, and a few other harmless nodes — directly in the
|
|
465
|
+
cpio archive.
|
|
466
|
+
`ttyS0` is listed last among the `console=` arguments so it, rather than the
|
|
467
|
+
invisible `tty0`, is what `/dev/console` points at.
|
|
468
|
+
|
|
469
|
+
The initramfs holds no `/init`; the kernel reaches Bun through `rdinit=` alone.
|
|
470
|
+
The retired native bootstrap is kept in `test/build-init-bootstrap.sh`, which
|
|
471
|
+
rebuilds it as `/init` — useful for mounting something before Bun starts, or
|
|
472
|
+
for bisecting a boot failure by exec'ing Bun with different arguments. Build
|
|
473
|
+
it, repack, and boot it with `rdinit=/init`. Varying which filesystems such a
|
|
474
|
+
bootstrap mounted before the exec is how the `/dev/urandom` requirement above
|
|
475
|
+
was found.
|
|
476
|
+
|
|
477
|
+
### What init.js does
|
|
478
|
+
|
|
479
|
+
It installs signal handlers, loads a separate physical copy of musl through
|
|
480
|
+
`bun:ffi`, prints a greeting, and starts `node:repl`. The loader and libc paths
|
|
481
|
+
contain identical bytes but are deliberately distinct inodes:
|
|
482
|
+
|
|
483
|
+
```text
|
|
484
|
+
/lib/ld-musl-x86_64.so.1
|
|
485
|
+
/lib/libc.musl-x86_64.so.1
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
Calling `dlopen` on the same musl inode that is already acting as Bun's loader
|
|
489
|
+
deadlocks, while the independent physical libc works. It provides `mount`,
|
|
490
|
+
`waitpid`, networking calls, and the generic `syscall` entry point, so no
|
|
491
|
+
custom `libinit.so` is needed.
|
|
492
|
+
|
|
493
|
+
The Bun init also loads Alpine's three compressed `virtio_net` modules through
|
|
494
|
+
musl's generic `syscall`, configures QEMU user networking as `10.0.2.15/24`
|
|
495
|
+
with the standard `10.0.2.2` gateway and `10.0.2.3` DNS proxy, and fetches
|
|
496
|
+
`http://example.com` before opening the REPL.
|
|
497
|
+
|
|
498
|
+
The REPL exposes a global `bunmsh()` function. Calling it creates
|
|
499
|
+
`/tmp/bunmsh-runtime`, installs the pinned `bunmsh@0.3.6` package there, and
|
|
500
|
+
directly runs its `src/main.js` with a small explicit environment. The calls
|
|
501
|
+
are synchronous so bunmsh exclusively owns the terminal until `exit` returns
|
|
502
|
+
to the Bun REPL.
|
|
503
|
+
|
|
504
|
+
## Authorship
|
|
505
|
+
|
|
506
|
+
Buninu Linux is written and maintained by Dr. John (醫者小智), the author of
|
|
507
|
+
[Buninu](https://github.com/jjtseng93/buninu), whose userspace it runs. The
|
|
508
|
+
kernel, the C library, the GCC runtime, the UEFI stub and Bun itself are the
|
|
509
|
+
work of their respective projects; [NOTICE.md](NOTICE.md) names each one with
|
|
510
|
+
the exact version, package and SHA-256 that ships here.
|
|
511
|
+
|
|
512
|
+
## License
|
|
513
|
+
|
|
514
|
+
Everything in this repository that is not listed in the table below — the
|
|
515
|
+
build scripts, `hello/hello.c`, `init.js`, the retired bootstrap, and the
|
|
516
|
+
configuration and metadata files — is Buninu Linux's own work under the MIT
|
|
517
|
+
License; see [LICENSE](LICENSE).
|
|
518
|
+
|
|
519
|
+
The repository also commits four third-party binaries under `initramfs/lib/`,
|
|
520
|
+
and the built image redistributes several more. Each stays under its own
|
|
521
|
+
terms, with the full texts in [`LICENSES/`](LICENSES/):
|
|
522
|
+
|
|
523
|
+
| Component | License | Where |
|
|
524
|
+
|---|---|---|
|
|
525
|
+
| musl (`ld-musl-x86_64.so.1`, `libc.musl-x86_64.so.1`) | MIT | committed |
|
|
526
|
+
| GCC runtime (`libgcc_s.so.1`, `libstdc++.so.6`) | GPL-3.0-or-later with the GCC Runtime Library Exception | committed |
|
|
527
|
+
| Linux `virt`/`lts` kernels and VirtIO, networking, xHCI, USB and HID modules | GPL-2.0-only with the Linux syscall note | image only |
|
|
528
|
+
| systemd EFI stub | LGPL-2.1-or-later | image only |
|
|
529
|
+
| Bun | MIT, plus the licenses of what it statically links | image only |
|
|
530
|
+
|
|
531
|
+
One component is worth naming here rather than leaving to be found: the two
|
|
532
|
+
GCC runtime libraries are **GPL-3.0 with the GCC Runtime Library Exception**.
|
|
533
|
+
That exception is what lets them ship next to MIT-licensed code, so nothing
|
|
534
|
+
here changes Buninu Linux's own terms — but if your organisation screens for
|
|
535
|
+
GPL, this is the component it will find. [NOTICE.md](NOTICE.md) records the
|
|
536
|
+
exact Alpine build of every component, the pinned aports commit that is its
|
|
537
|
+
Corresponding Source, and SHA-256 sums for every binary.
|
package/build-image.sh
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
cd "$(dirname "$0")"
|
|
5
|
+
|
|
6
|
+
mkdir -p vda/EFI/BOOT
|
|
7
|
+
test -s vda/EFI/BOOT/BOOTX64.EFI || {
|
|
8
|
+
echo "error: build stage: no EFI payload yet; run ./build-uki.sh (./index.js -b) or ./hello/build-hello.sh first" >&2
|
|
9
|
+
exit 1
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
# Create a standalone FAT32 filesystem, populate it with mtools, then insert
|
|
13
|
+
# it into a GPT disk. No mount, loop device, or root privilege is required.
|
|
14
|
+
for required_tool in parted mkfs.fat mmd mcopy; do
|
|
15
|
+
command -v "$required_tool" >/dev/null || {
|
|
16
|
+
echo "error: build stage needs $required_tool; run inside PRoot, see README section 0" >&2
|
|
17
|
+
exit 1
|
|
18
|
+
}
|
|
19
|
+
done
|
|
20
|
+
|
|
21
|
+
temporary_esp="$(mktemp --tmpdir=. .esp.XXXXXX.img)"
|
|
22
|
+
trap 'rm -f "$temporary_esp"' EXIT
|
|
23
|
+
|
|
24
|
+
disk_sectors=$((128 * 1024 * 1024 / 512))
|
|
25
|
+
esp_start=2048
|
|
26
|
+
esp_end=$((disk_sectors - 34))
|
|
27
|
+
esp_sectors=$((esp_end - esp_start + 1))
|
|
28
|
+
|
|
29
|
+
truncate -s $((esp_sectors * 512)) "$temporary_esp"
|
|
30
|
+
mkfs.fat -F 32 -h "$esp_start" -n EFIBOOT "$temporary_esp" >/dev/null
|
|
31
|
+
mmd -i "$temporary_esp" ::/EFI ::/EFI/BOOT
|
|
32
|
+
mcopy -i "$temporary_esp" vda/EFI/BOOT/BOOTX64.EFI ::/EFI/BOOT/BOOTX64.EFI
|
|
33
|
+
|
|
34
|
+
rm -f vda.img
|
|
35
|
+
truncate -s $((disk_sectors * 512)) vda.img
|
|
36
|
+
parted -s vda.img mklabel gpt
|
|
37
|
+
parted -s vda.img unit s mkpart ESP fat32 "${esp_start}s" "${esp_end}s"
|
|
38
|
+
parted -s vda.img set 1 esp on
|
|
39
|
+
|
|
40
|
+
dd if="$temporary_esp" of=vda.img bs=512 \
|
|
41
|
+
seek="$esp_start" count="$esp_sectors" \
|
|
42
|
+
conv=notrunc,sparse status=none
|
|
43
|
+
|
|
44
|
+
echo "Packed vda/EFI/BOOT/BOOTX64.EFI into vda.img"
|
package/build-uki.sh
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
cd "$(dirname "$0")"
|
|
5
|
+
|
|
6
|
+
linux_flavor=${LINUX_FLAVOR:-virt}
|
|
7
|
+
kernel_release="6.18.52-0-$linux_flavor"
|
|
8
|
+
kernel_image="kernel/vmlinuz-$linux_flavor"
|
|
9
|
+
|
|
10
|
+
if [ ! -s "$kernel_image" ] || { [ "${REAL_MACHINE:-}" = 1 ] && \
|
|
11
|
+
[ ! -s "initramfs/lib/modules/$kernel_release/kernel/drivers/hid/usbhid/usbhid.ko" ]; }; then
|
|
12
|
+
./fetch-alpine.sh
|
|
13
|
+
fi
|
|
14
|
+
./scripts/pack-initramfs.sh
|
|
15
|
+
|
|
16
|
+
mkdir -p build vda/EFI/BOOT
|
|
17
|
+
printf '%s\n' \
|
|
18
|
+
'NAME="Buninu Linux"' \
|
|
19
|
+
'ID=buninu-linux' \
|
|
20
|
+
'PRETTY_NAME="Buninu Linux 1"' \
|
|
21
|
+
'VERSION_ID=1' > build/os-release
|
|
22
|
+
# Bun itself is PID 1: no native bootstrap. `-e import('/init.js')` avoids the
|
|
23
|
+
# entry-file open that would readlink /proc/self/fd/N before /proc exists;
|
|
24
|
+
# init.js mounts /proc, /sys, /dev and /tmp as its first action.
|
|
25
|
+
#
|
|
26
|
+
# Everything before `--` needs an `=`: the kernel appends any bare word to the
|
|
27
|
+
# init argv instead of treating it as an environment assignment. Everything
|
|
28
|
+
# after `--` becomes argv[1..] verbatim, and argv[0] is the rdinit path. The
|
|
29
|
+
# kernel does not care about the order of the parameters, so `rdinit=` goes
|
|
30
|
+
# last and the tail of the line reads as the `bun -e ...` it turns into.
|
|
31
|
+
#
|
|
32
|
+
# ttyS0 is listed last so it, not tty0, is the console the kernel opens as the
|
|
33
|
+
# init process's fd 0/1/2. `-display none` leaves tty0 with nowhere to go.
|
|
34
|
+
if [ "${REAL_MACHINE:-}" = 1 ]; then
|
|
35
|
+
consoles="console=ttyS0,115200 console=tty0 REAL_MACHINE=1"
|
|
36
|
+
else
|
|
37
|
+
consoles="console=tty0 console=ttyS0,115200"
|
|
38
|
+
fi
|
|
39
|
+
printf '%s' "$consoles panic=0 PATH=/bin KERNEL_RELEASE=$kernel_release rdinit=/bin/bun -- -e import('/init.js')" > build/cmdline
|
|
40
|
+
|
|
41
|
+
if command -v x86_64-w64-mingw32-objcopy >/dev/null; then
|
|
42
|
+
objcopy_command=x86_64-w64-mingw32-objcopy
|
|
43
|
+
objdump_command=x86_64-w64-mingw32-objdump
|
|
44
|
+
else
|
|
45
|
+
echo "error: build stage needs x86_64-w64-mingw32-objcopy (Debian binutils-mingw-w64-x86-64)" >&2
|
|
46
|
+
echo "run inside PRoot; see README section 0" >&2
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
image_base_hex="$($objdump_command -p kernel/linuxx64.efi.stub \
|
|
51
|
+
| awk '$1 == "ImageBase" { print $2; exit }')"
|
|
52
|
+
image_base=$((16#$image_base_hex))
|
|
53
|
+
osrel_vma=$((image_base + 0x20000))
|
|
54
|
+
cmdline_vma=$((image_base + 0x30000))
|
|
55
|
+
linux_vma=$((image_base + 0x2000000))
|
|
56
|
+
initrd_vma=$((image_base + 0x3000000))
|
|
57
|
+
|
|
58
|
+
# These are the conventional non-overlapping VMAs used for x86-64 UKIs.
|
|
59
|
+
# Both supported Alpine kernels are below 16 MiB, so .linux ends before .initrd.
|
|
60
|
+
"$objcopy_command" \
|
|
61
|
+
--add-section .osrel=build/os-release \
|
|
62
|
+
--change-section-vma .osrel="$osrel_vma" \
|
|
63
|
+
--set-section-flags .osrel=contents,alloc,load,readonly,data \
|
|
64
|
+
--add-section .cmdline=build/cmdline \
|
|
65
|
+
--change-section-vma .cmdline="$cmdline_vma" \
|
|
66
|
+
--set-section-flags .cmdline=contents,alloc,load,readonly,data \
|
|
67
|
+
--add-section .linux="$kernel_image" \
|
|
68
|
+
--change-section-vma .linux="$linux_vma" \
|
|
69
|
+
--set-section-flags .linux=contents,alloc,load,readonly,data \
|
|
70
|
+
--add-section .initrd=build/initramfs.cpio.gz \
|
|
71
|
+
--change-section-vma .initrd="$initrd_vma" \
|
|
72
|
+
--set-section-flags .initrd=contents,alloc,load,readonly,data \
|
|
73
|
+
kernel/linuxx64.efi.stub vda/EFI/BOOT/BOOTX64.EFI
|
|
74
|
+
|
|
75
|
+
echo "Built UKI with Alpine linux-$linux_flavor at vda/EFI/BOOT/BOOTX64.EFI"
|