logo

bootstrap-initrd

Linux initrd to bootstrap from a small binary seed git clone https://anongit.hacktivis.me/git/bootstrap-initrd.git/

README.md (2870B)


  1. # bootstrap-initrd
  2. ```
  3. Copyright 2017 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  4. SPDX-License-Identifier: MPL-2.0
  5. ```
  6. A initrd generator for Linux to bootstrap a POSIX-ish system from a reasonably small binary seed.
  7. ## Status
  8. - [x] Small binary seed of only TCC and musl (~1.2MB of binaries, depending on the architecture), enforced by [deblob](https://hacktivis.me/projects/deblob)
  9. - [x] Capable of bootstrapping <https://git.sr.ht/~mcf/oasis>
  10. - [ ] Self-replicating: Able to reassemble the initrd with Alpine apks
  11. - [ ] Self-hosting: Able to recompile all the software used from source (including tcc and musl)
  12. - [x] Code compiled by `init.sh` is reviewable, mostly thanks to a lack of autotools
  13. ## Downloading
  14. Can either be downloading this git repo, or downloading from the archives at <https://distfiles.hacktivis.me/releases/bootstrap-initrd/>
  15. The signify public keys are at <https://distfiles.hacktivis.me/releases/signify/>
  16. (Note: https is optional, the assets are signed anyway)
  17. ## Explorations
  18. - Reduce the binary seed even further, without compromising on keeping the bootstrapping simple and reasonably fast
  19. ## Non-Goals
  20. - GNU Environment, there is already <https://github.com/fosslinux/live-bootstrap> for this and it's a massive effort
  21. - Become a distro, at worst it should end up deferring to an existing ports system like <https://www.pkgsrc.org/>
  22. ## Architectures
  23. You can set `ALPINE_ARCH` to change the architecture, by default it's set to `x86_64`.
  24. - `aarch64`: Works except for extras (tested on HoneyComb LX2k with linux 6.12.21-gentoo)
  25. - `armhf`: Untested
  26. - `armv7`: Untested
  27. - `riscv64`: Works except for extras (tested on VisionFive2 with linux-lts from Alpine)
  28. - `x86`: Works
  29. - `x86_64` (aka amd64): Works
  30. ## Rationales
  31. Moved to RATIONALES.md and RATIONALES-Exclusion.md
  32. ## Extras
  33. The `/extras` directory is for software which is either specific
  34. to bootstrapping a particular system, or software which contains
  35. pregenerated code rather than 100% source code.
  36. You can automatically build all of it with `/extras-build-all.sh`
  37. You can exclude those tarballs from the initrd with setting
  38. the `EXCLUDE_EXTRAS` environment variable to any value.
  39. ## Launching in QEMU
  40. * You need a Linux kernel, so far no known version limitations
  41. * Combination of `panic=1` and `-no-reboot` allows to exit+relaunch
  42. ```
  43. $ ./make-initrd.sh && qemu-system-x86_64 -enable-kvm -m 512 -kernel /boot/vmlinuz-6.6.21-gentoo -initrd bootstrap-initrd/x86_64+extras.cpio.gz -append 'init=/init console=ttyS0 panic=1' -nographic -no-reboot
  44. ```
  45. ## Dev setup via bubblewrap
  46. ```
  47. $ ./make-root.sh && bwrap --clearenv --unshare-all --bind bootstrap-initrd/x86_64+extras/ / --proc /proc --dev /dev --uid 0 --gid 0 /init
  48. ```
  49. Useful as it allows to manipulate the environment externally, for example to edit files in an editor more comfortable than `ed(1)`.