[TUHS] Abstractions

Greg A. Woods woods at robohack.ca
Wed Feb 24 12:47:07 AEST 2021


At Tue, 23 Feb 2021 16:15:52 -0500, Henry Bent <henry.r.bent at gmail.com> wrote:
Subject: Re: [TUHS] Abstractions
>
> It's also worth
> pointing out that NetBSD, in addition to having a separate /bin and
> /usr/bin, has /rescue which has a large selection of statically linked
> binaries.

Indeed.  However /rescue is really just a hack to avoid the problems
that occur when basic tools are dynamic-linked.

My vastly preferred alternative is to static-link everything.

Of course with C libraries these days that means the binaries can be
rather large -- albiet still relatively small in comparison to modern
disks.

In any case I've also built NetBSD such that all of the base system
binaries are linked together into one binary (we call this "crunchgen",
but Linux usually calls it "Busybox(tm)").  I decided to put all the bin
directories together into one for the ultimate savings of space and time
and effort, but it would be trivial to keep the root and /usr split for
better managing application-specific embedded systems.

This hard-static-linking of everything into one binary results in a
surprisingly small, indeed very tiny, system.  For i386 (32-bit) it
could probably boot multiuser in about 16mb of RAM.

What I've got so far is a bootable image file of a "complete"
NetBSD-5/i386 systems that's just a tiny bit over 7Mb.  It contains a
kernel and a ramdisk image with a 12Mb filesystem containing a crunchgen
binary with almost everything in it (247 system programs, including all
the networking tools, but no named, and no toolchain, no mailer, and no
manual pages -- not atypical of what was delivered with some commercial
unix systems of days gone by, but of course updated with modern things
like ssh, etc..)

--
					Greg A. Woods <gwoods at acm.org>

Kelowna, BC     +1 250 762-7675           RoboHack <woods at robohack.ca>
Planix, Inc. <woods at planix.com>     Avoncote Farms <woods at avoncote.ca>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP Digital Signature
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20210223/1335c30b/attachment.sig>


More information about the TUHS mailing list