3

I recently tried to install OpenBSD to my Soekris net4526, but the 64MB onboard memory is too small. Is there any way to make OpenBSD smaller, because even the smallest configuration (bsd and baseXX.tgz only) doesn't fit.I tried with OpenBSD 3.9. Can you give me some links?

  • ftp.openbsd.org/pub/OpenBSD/5.8/i386/INSTALL.i386 says 32 MB is the minimum – Jeff Schaller Mar 29 '16 at 15:25
  • @kristjank. Are you talking about RAM or Storage? – user34720 Mar 29 '16 at 16:39
  • I am talking about storage. The required amount of storage for OpenBSD is 250 MB, but i want to select only the packages I want, e.g. only networking and http stuff. – kristjank Mar 29 '16 at 18:13
4

The good news is it can be done, but you'll need to know what you're doing and you won't be able to ask for any help on the openbsd mailing lists.

You'll need:

  • a more powerful build machine then your soekris
  • a list of things to delete which will be based on whatever compromises you're willing to make. (You haven't given any detail about what you're planning to use this machine for).

I just downloaded the latest base.tgz snapshot. It's 148M in size. Here are some ideas about things you could look to remove from base:

  • if you can live without Perl, removing it will save you 54.5M
  • without perl, you may as well delete the pkg_* tools and /etc/signify/openbsd-*-pkg.pub files. You can also delete some other odds and ends like fw_update, libexec/security, etc.
  • the terminfo database, 5.6M
  • /usr/bin/spell, /usr/bin/deroff (only kept around because it's used by spell) and /usr/share/dict will save 3.5M
  • prune the zoneinfo, 3M
  • /etc/firmware will save 2.3M
  • maybe you don't need /sbin/isakmpd which will save 1.8M
  • /usr/share/man/ will save 1.3M (a select few man pages are installed in base not in the man set).
  • without man pages, you may as well delete /usr/bin/man, /usr/bin/mandoc, /etc/examples/man.conf
  • you can also probably delete libsqlite for 3M
  • delete dig, host, nslookup for 1.4M
  • /usr/share/misc will save 1.2M
  • cvs will save 0.7M
  • /usr/bin/file and /etc/magic will save 0.6M
  • texinfo will save 0.5M
  • /usr/mdec will save 0.3M
  • /var/sysmerge/etc.tgz will save 0.2M

At this point you'll be close. Maybe around 70M of usage, so you'll have to start deleting things you wouldn't use. For example, in /usr/sbin do you need pppd? Do you need httpd? You probbably don't need installboot, etc, etc. You will need to go through with a fine tooth comb based on your use case.

One other thing you can experiment with is to compile your system with -Os instead of -O2. It might be worth checking if it saves space too. But note -Os is not a well tested gcc code-path on OpenBSD. It would not surprise me if you run into compiler bugs by doing this.

So I think the point, is it can be done if you're willing to sink enough time into this as a project. Only you can decide if you want to create such a stripped down version of OpenBSD. And again, don't expect any help from the openbsd mailing lists. People will laugh at you if you ask for help with this project over there.

1

sure, flashrd should be fine for your scenario:

flashrd boots within 64MB RAM and 1GB flash hosting a default OpenBSD/i386 or Open BSD/amd64 installation. At least 128MB RAM is recommended for the default flashrd setup.

you have to use a up-to-date version of OpenBSD with flashrd (currently at 5.9) which is strongly recommended in any case.

1

A few tricks can be used to reduce the size of libraries. I always perform this step before removing executables from the system.

  1. Remove library profiling data to save ~56Mb:

    rm /target/usr/lib/lib*_p.a
    
  2. Strip symbol tables from shared objects:

    strip /target/usr/lib/lib*.so.*
    

For instance libc.so.86.0 amounts to 3Mb, while only 750kb stripped.

This doesn't affect usability [without gdb installed] at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.