Skip to content

Latest commit

 

History

History
56 lines (34 loc) · 2.45 KB

README.md

File metadata and controls

56 lines (34 loc) · 2.45 KB

Minimal build & boot linux kernel + coreutils (via busybox), openssh & iputils

qemu showing boot into minimal linux

Goal is to have mimimal but realistic node with network capabilities build in (ip) and bootstrapped (similar to alpine's netbot (example)). Clearlinux is interesting. This is using musl (which alpine uses) rather than glibc to support staticaly built binaries more easily.

The process in a nutshell

  • Given a built linux kernel (e.g. vmlinuz-lts)
  • Clone and build all the various packages you want
  • Write an init script
  • Build all the binaries + init script into a initramfs
  • Run/boot with qemu
  • Rememebr busybox needs to be static build (see .config)
    • dropbear needs at least a dropbear_rsa_host_key key config or will not start see gist
    • Prefering openssh for end user compatability (statically built)

TODO: add iproute2 for minimal routing.

Things you need to build

See ./build-all.sh

What does this repo not include (yet)

  • Automated ci

### How do I build statically coreutils, do I even need to?

See https://lists.gnu.org/archive/html/coreutils/2019-04/msg00001.html switched to using musl.

Reading

See also

https://wiki.gentoo.org/wiki/Custom_Initramfs https://unix.stackexchange.com/a/305406 https://landley.net/writing/rootfs-howto.html https://landley.net/writing/rootfs-programming.html

"Stuff like this is slowly becoming a lost art" src ooopse.

TODO: kernel inital ram disk support https://stackoverflow.com/questions/14430551/qemu-boot-error-swapper-used-greatest-stack-depth TODO READ: https://bbs.archlinux.org/viewtopic.php?pid=1378903#p1378903

Notes

"busybox qemu /bin/sh: can't access tty; job control turned off" https://github.com/brgl/busybox/blob/master/shell/cttyhack.c