3 ms·
I currently want to put together a cut-down, minimal userspace rootfs that boots a VNC viewer for some old laptops. Essentially busybox+wpa_supplicant+Xorg (for
by i336_ 10y ago
I currently want to put together a cut-down, minimal userspace rootfs that boots a VNC viewer for some old laptops. Essentially busybox+wpa_supplicant+Xorg (for synaptics touchpad support >.>)+tigervnc, and a bunch of hand-written init scripts to boot everything.
I could go hunting and take my existing system apart until I have a bunch of binaries and libraries that coexist and don't cause nuclear explosions, but I can't help but think that rebuilding all the bits I need from scratch might get me a smaller initramfs image. (At the very least I could compile out all the features I don't need.)
My question is: how best could I build everything (on Arch Linux) in an isolated way, such that gcc/clang figures out that I want everything to link together, without going full crazy and building gcc inside a chroot (like LFS does), etc etc? I figure I want lots of PREFIX and manual specification of libraries to ./configure, but is there anything else I should take into account?
I also vaguely recall a single-floppy Linux distro from years back that came with a random shell or Perl script that would do code analysis for you and strip out never-used function calls in libraries so that the resulting library build was smaller. Is anyone aware of anything like that that's a proper application?
- wtf_is_up 10y agoCheck out Yocto Project. I've used it to build a minimal distro for Gumstix boards, but it also supports generic x86/amd64 targets as well. It's built on top of bitbake and you essentially enable recipes for packages you want to have installed. https://www.yoctoproject.org/downloads/bsps https://www.yoctoproject.org/downloads/bsps
- gvb 10y agoAlso check out Buildroot: https://buildroot.org/ https://buildroot.org/ It uses Kconfig to give pretty fine grained selection of what packages are included in your file system and supports (painless!?) cross compilation by building the proper compiler toolchain or using a preexisting toolchain. Once you are happy with your configuration, you can save it e.g. as a "default config" and regenerate it repeatably, reliably, and effortlessly. It takes a while to do a full build, but caching speeds up rebuilds (you have to be careful to "rm" cached parts that you really do want to rebuild). make distclean && make <defaultconfig> && make I've been really impressed. I'm currently building for an embedded target on a AMD64 linux creating a x86 ISO that I boot on a VM for development when I don't have real hardware available and then building for our embedded ARM hardware when I get access to our prototype.
- i336_ 10y agoMaybe I'll have to give it a look. I get the impression it wants to add a bit of its own special sauce into things. I was just thinking along the lines of building the libraries and binaries together and adding an init script or two, without anything else. (Also, what's the prototype? That sounds interesting.)