Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Sep 2017 15:03:30 -0400
From:      Anton Yuzhaninov <citrin+bsd@citrin.ru>
To:        freebsd-questions@freebsd.org
Subject:   Re: help with condensing bsd
Message-ID:  <8e90abb6-79b0-5f2a-8c1a-4126a663f0ee@citrin.ru>
In-Reply-To: <b591f6b4-0a03-3db2-b823-c7df349b636e@tysdomain.com>
References:  <b591f6b4-0a03-3db2-b823-c7df349b636e@tysdomain.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 09/08/17 12:04, Littlefield, Tyler wrote:
> I wish to create a smaller BSD as I have a vps with a minimal amount of
> space.

1. Reducing kernel size.

create custom config - add to it all you need (drivers, geom/netgraph
modules e. t. c.) and add line
makeoptions     NO_MODULES=yes

only kernel will be build without modules.
Kernel can be compressed using gzip -9

2. World.

Simple way - just disable optional stuff via src.conf
Read man src.conf and add knobs like
WITHOUT_ACCT=yes
WITHOUT_ACPI=yes
WITHOUT_AMD=yes
e.t.c.
to you src.conf

Not all can be switched off via src.conf, but if you not building image
for tiny embedded system a few extra Mb probably doesn't matter.

> I know that I can buildworld and cut a lot of things out (does
> anyone have a good example from where to start)?
> My question is this: Once I buildworld and buildkernel, how do I package
> these up? I have a few systems that need this new buildworld and
> buildkernel, and i also want to replace the base iocage jail.

Different options are possible.

I use this way:

On build host I run script make-release.sh [1]
result of this script: files base.txz kernel.txz e. t. c.

/usr/src/release/release.sh can be used instead, but for me it was more
easy to write own script than customize release.sh.

To upgrade OS on VPS I use shell script [2] which fetches this files and
extracts them using tar. To upgrade files in /etc I currently use
etcupdate (because mergemaster needs /usr/src).

If you already have OS installed in this VPS you can install you custom
build (and copy /etc/src.conf used for this build) and then run
make delete-old && make delete-old-libs
to delete switched off parts (but you will need /usr/src for this task).

Also you can save space by not keeping /usr/ports and installing binary
packages. If custom options are need you will have to run own package
repo using poudriere.

1. http://termbin.com/ad1c
2. http://termbin.com/rvd8



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8e90abb6-79b0-5f2a-8c1a-4126a663f0ee>