From owner-freebsd-questions@freebsd.org Fri Sep 8 19:03:36 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07AD4E049E5 for ; Fri, 8 Sep 2017 19:03:36 +0000 (UTC) (envelope-from citrin+bsd@citrin.ru) Received: from hz.citrin.ru (hz.citrin.ru [IPv6:2a01:4f8:d16:10c3::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C55F86696F for ; Fri, 8 Sep 2017 19:03:35 +0000 (UTC) (envelope-from citrin+bsd@citrin.ru) Received: from x220.lan (c-24-60-168-172.hsd1.ct.comcast.net [24.60.168.172]) by hz.citrin.ru (Postfix) with ESMTPSA id 384CA2C1790 for ; Fri, 8 Sep 2017 19:03:32 +0000 (UTC) Subject: Re: help with condensing bsd To: freebsd-questions@freebsd.org References: From: Anton Yuzhaninov Message-ID: <8e90abb6-79b0-5f2a-8c1a-4126a663f0ee@citrin.ru> Date: Fri, 8 Sep 2017 15:03:30 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrin.ru; s=s0; t=1504897412; bh=6rkCAytuFF684aCGOq6tH/CBSPcLgebOcMRhTXne1MY=; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=Is2fPLe2dgmbxUxquBADLPWQBPFjTKhgbVNCboDqMDpKEbel7NOEq8Sz0acbw1X/RYJWFmY+PxvJbdmO29yNk0CYz7KDh7IvKG6AUQJ3grtMRd99RaEqKuTpIzvRVFM24ZWOrQMrmG+203aK7mCWmQJ2uNYADSjgkG7zjxQUW/E= X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Sep 2017 19:03:36 -0000 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