{"id":15451423,"url":"https://github.com/davidar/bootsh","last_synced_at":"2026-01-04T22:46:24.900Z","repository":{"id":236033857,"uuid":"791769159","full_name":"davidar/bootsh","owner":"davidar","description":"Bootstrappable, self-hosting POSIX shell","archived":false,"fork":false,"pushed_at":"2024-05-22T11:24:11.000Z","size":19560,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-23T03:22:43.374Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-25T10:33:50.000Z","updated_at":"2024-05-27T12:10:12.631Z","dependencies_parsed_at":"2024-05-07T11:26:02.886Z","dependency_job_id":"8daefc37-258c-4e0d-92df-05b03c001396","html_url":"https://github.com/davidar/bootsh","commit_stats":null,"previous_names":["davidar/dash","davidar/bootsh"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidar%2Fbootsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidar%2Fbootsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidar%2Fbootsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidar%2Fbootsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidar","download_url":"https://codeload.github.com/davidar/bootsh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245031516,"owners_count":20549925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T21:24:25.136Z","updated_at":"2026-01-04T22:46:24.871Z","avatar_url":"https://github.com/davidar.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# *boot*sh\n\nA comprehensive POSIX userspace, including a C compiler, in a single tiny (\u003c1MB) executable.\n\n- **Bootstrappable:** *boot*sh contains a variety of builtin commands (including `grep`, `diff`, `sed`, `xzcat`, `sha1sum`, `ninja` and many more) providing a solid POSIX base to [bootstrap a full GNU/Linux distribution from source](https://github.com/sabotage-linux/sabotage).\n\n- **Self-hosting:** *boot*sh can compile itself from source, thanks to its builtin `cc` command which implements a full C99 compiler.\n\n- **Tiny:** *boot*sh can be compiled into a single ~700KB binary executable in under 10 seconds. With [UPX](https://upx.github.io/) it can be reduced to half that size.\n\n## Build\n\nJust run `./configure \u0026\u0026 ninja`. The configure script will prompt you for any missing build dependencies. If you don't have `ninja`, you can run `make` to bootstrap with the builtin copy of [samurai](https://github.com/michaelforney/samurai).\n\n## Usage\n\nA [Docker image](https://hub.docker.com/r/davidar/bootsh/tags) is provided to demonstrate how *boot*sh can be used in a self-contained environment.\n\n```sh\ndocker run --rm -it davidar/bootsh\n```\n\nThis image contains four files:\n\n- `/bin/sh`: the *boot*sh executable\n\n- `/bin/init`: a small shell script for constructing the root filesystem and bootstrapping musl libc from source\n\n- `/bin/configure-musl.sh`: sets up an alternative ninja-based build system for musl\n\n- `/bin/awk`: a [C script](scripts/wak.c) (note the `#!/bin/cc -run` interpreter line) which is JIT compiled as needed\n\nUpon running the Docker image, it will bootstrap itself by constructing a minimal root filesystem on top of this.\n\nAlternatively, you can build a minimal Linux distribution by running\n\n```sh\nscripts/build-docker.sh --kernel\n```\n\nThis will produce a compressed kernel in `build/bzImage` and a compressed root filesystem in `build/initramfs.cpio.xz` (whose contents are the same as the Docker image).\nTogether they occupy less than 2MB. To boot the kernel in QEMU, run\n\n```sh\nscripts/run-qemu.sh\n```\n\n## POSIX Compliance\n\n*boot*sh implements all of the [mandatory POSIX commands](https://en.wikipedia.org/wiki/List_of_POSIX_commands)\n(and a number of optional commands) except for the following:\n\n- system administration: `at`, `batch`, `crontab`, `df`, `logger`, `lp`, `man`, `newgrp`, `ps`\n- text/locale processing: `csplit`, `gencat`, `iconv`, `locale`, `localedef`, `pr`, `split`\n- interactive tools: `ed`, `mailx`, `mesg`, `unexpand`, `write`\n- terminal control: `stty`, `tabs`, `tput`\n- miscellaneous: `bc`, `join`, `m4`, `pathchk`, `pax`, `tsort`\n\n## Credits\n\n*boot*sh is based on several MIT/BSD licensed projects:\n\n- The [Debian Almquist shell](http://gondor.apana.org.au/~herbert/dash/)\n- Command line utilities from [toybox](http://landley.net/toybox/)\n- The MIT-relicensed parts of the [Tiny C Compiler](https://bellard.org/tcc/)\n- Version 8.0 of [compiler-rt](https://compiler-rt.llvm.org/) (before it was relicensed from MIT to Apache 2.0)\n- `ar` from the [Cosmopolitan](https://github.com/jart/cosmopolitan) project\n- [wak](https://github.com/raygard/wak), the one-file implementation of `awk`\n- [samurai](https://github.com/michaelforney/samurai), a reimplementation of [Ninja](https://github.com/ninja-build/ninja)\n- [musl libc](https://musl.libc.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidar%2Fbootsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidar%2Fbootsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidar%2Fbootsh/lists"}