Slashdot Mirror


miniBSD - reducing FreeBSD

dnaumov writes "miniBSD - reducing FreeBSD is a great guide, which explains in great detail, how you can create a truly small installation of FreeBSD on your system, completely by yourself. There is also the PicoBSD project, which has similar goals, but it's based on an outdated version of FreeBSD and is considered to be way too minimalistic (2 floppies) by many. The guide will walk you through things like creating the directory tree inside a chroot jail, rebuilding the bootloader and everything else needed to create a FreeBSD install that takes just around 20 MB of space."

7 of 39 comments (clear)

  1. Amazingly, almost half of that is perl! by RLiegh · · Score: 4, Interesting
    From the article:

    I did another minimal FreeBSD install and started looking for things I could remove in order to save space. After much tinkering, my "miniBSD" only weighed 22 MB (all binaries linked dynamically) and still had all the functionality I wanted (including ssh, FTP, perl and all the basic commands one expects on a reasonable UNIX system). Without perl, it fits in about 12 MB.

    emphasis mine.
  2. A new possible BSD ? by dnaumov · · Score: 4, Interesting

    There is a thread on BSDForums, where people are discussing the possibility of either creating a script that would automate the creation of a "MiniBSD installation" or possibly creating a new BSD altogether, using the MiniBSD philosophy and FreeBSD base.

    1. Re:A new possible BSD ? by josepha48 · · Score: 3, Interesting
      I think that one thing people are missing is that in a real FreeBSD system the /bin and /sbin contain static executables. Thus they are larger because all the code in 'in there'. In miniBSD all the programs are shared executables.

      This thread, if you read all of it, suggests that a new BSD would be a little to much and that it may be better for it to be part of FreeBSD as either an option or a seperate script.

      If you read the miniBSD there are scripts that do the coping for files from the real system to the directory that is going to be the compact flash directory. He starts out by telling the user to make world, which essentially tells people to build the system from the gound up. Also making sure to make NO static binaries. On most systems you may want static binaries, in case the system had an improper shutdown.If sh is shared and the shared libs are in /usr/lib (where they are on FreeBSD) then you would not be able to run sh if you could not mount /usr. In his scenerio it is a compact flash card that is being used and it is mounted read only ALL the time. If you do this to your system then you could cut down the size of the system.

      Also there is pam to think about. My FreeBSD 4.7 system has pam on by default. He does not mention this. So when I used his mklibs.pl script it did not get the pam libs and the system was pretty hosed.

      Oh and I have managed to cut FreeBSD down to about 72Megs with sshd running and bind 9, ipsec, and ipfw2, natd, and console access. Still I am looking at how to cut down more and still not loose functionality.

      I think the real solution would be a project in the ports that would allow an automated minibsd system to be built. i.e. run script x and make a few choices and it builds the system for you. Options could be include sshd, include bind 8 or 9, include perl or not and get your customizish system that way.

      --

      Only 'flamers' flame!

  3. PicoBSD and miniBSD have two different goals by eht · · Score: 4, Informative

    The Tentative PicoBSD FAQ has useful information on how to built a PicoBSD build out of the current source tree and therefore isn't anywhere near two years old, nor does it build to two floppies, there are three differnet versions of it with a fourth in psuedo permanent beta testing

    miniBSD has a different aim of not so much tweaking, for example in PicoBSD SSH daemon and client are just two aspects of one program instead of two sperate programs because of all the shared code between them, it's more meant to run on compact flash and is easier to update since PicoBSD is a compressed bootable image

  4. Packagizing "base" by cperciva · · Score: 3, Interesting

    Every time someone asks about dropping Sendmail or Bind from the base system, discussion on the FreeBSD lists ends up with the following: If you go ahead and work out how to packagize "base", we'll probably end up doing it.

    I think starting with this "miniBSD" and adding everything else back in might be the right way to do it.

  5. Re:Why does it have to be FreeBSD? by evilviper · · Score: 4, Insightful

    FreeBSD's hardware advantage isn't all that significant. OpenBSD supports every network card I have ever tried (and that is a huge number of diverse types). So what exactly does FreeBSD support that is so important??? The only hardware I can recall OpenBSD not supporting is a few sound-cards I have, and that's a non-issue for this type of system.

    Sure, it doesn't support SMP, but I don't consider that to be much of a drawback. SMP isn't all that popular, and would likely be even less so in these types of machines.

    If you still want to site hardware/SMP support as a major issue, I can point out that Linux supports even more hardware, and (supposedly) has far better SMP support.

    As for the advantages of OpenBSD, it is smaller, far less complex to setup/configure/maintain, more secure, and has plenty of great programs that FreeBSD lacks (Systrace and PF kick ass).

    --
    Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
  6. Re:Why does it have to be FreeBSD? by evilviper · · Score: 3, Informative
    Hmm, how much smaller? Do you have number at hand or just think so?

    Well, emBSD (small OpenBSD distro) fits on a 32MB flash card with room to spare, and that includes SSH, IPSec, pf, network card drivers, etc. No doubt it could be made much smaller.

    I don't see much complexity in FreeBSD setup/configure/maintain... If OpenBSD even less complex then it's missing some features?

    It's not missing any features, it's just a better, simpler, configuration system. Try it some time, rather than just complaining about what you don't know.

    instead of PF you could use IPFW or IPF or both simultaneously ;P

    No other firewall software out there has anything like PF-Auth. Then there is ALTQ which has been merged with PF to allow complex bandwidth limiting. PF also has SCRUB and MODULATE STATE directives, which clean up packets, and provide more security for the network. Then there is all of PF's advanced options.

    Do you have bigger list of "great programs that FreeBSD lacks"? BTW there is a systrace port for FreeBSD

    Those were just off the top of my head... There are certainly more. You are welcome to install OpenBSD and find out for yourself. And it's good to hear the systrace port is finished.

    Couple years ago I tried to run OpenBSD on 486. I remember it was definitely slower than FreeBSD on the same hardware..

    Well, the one place that FreeBSD has an advantage is kernel startup times on slow hardware. After startup, it should run jut as fast. Besides, it sounds like you haven't tried it in some time (or on very modern hardware)... It was around Release 2.8 that OpenBSD got a big speed boost.
    --
    Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant