From owner-freebsd-questions@freebsd.org Mon Sep 11 16:13:28 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 8FCC8E14634 for ; Mon, 11 Sep 2017 16:13:28 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailrelay12.qsc.de (mailrelay12.qsc.de [212.99.163.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.antispameurope.com", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 160FB67310 for ; Mon, 11 Sep 2017 16:13:27 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de ([213.148.129.14]) by mailrelay12.qsc.de; Mon, 11 Sep 2017 18:13:24 +0200 Received: from r56.edvax.de (port-92-195-6-118.dynamic.qsc.de [92.195.6.118]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id AE4803CBF9; Mon, 11 Sep 2017 18:13:22 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id v8BGDLZC003814; Mon, 11 Sep 2017 18:13:21 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Mon, 11 Sep 2017 18:13:21 +0200 From: Polytropon To: tyler@tysdomain.com Cc: Anton Yuzhaninov , freebsd-questions@freebsd.org Subject: Re: help with condensing bsd Message-Id: <20170911181321.3d892b7b.freebsd@edvax.de> In-Reply-To: <27aa284a-2de7-ead6-ecb8-3ca73f133d66@tysdomain.com> References: <8e90abb6-79b0-5f2a-8c1a-4126a663f0ee@citrin.ru> <27aa284a-2de7-ead6-ecb8-3ca73f133d66@tysdomain.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-cloud-security-sender: freebsd@edvax.de X-cloud-security-recipient: freebsd-questions@freebsd.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mailrelay12.qsc.de with 2AC576A3601 X-cloud-security-connect: mx01.qsc.de[213.148.129.14], TLS=1, IP=213.148.129.14 X-cloud-security: scantime:.1352 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: Mon, 11 Sep 2017 16:13:28 -0000 On Mon, 11 Sep 2017 09:59:49 -0400, Littlefield, Tyler wrote: > On 9/8/2017 3:03 PM, Anton Yuzhaninov wrote: > > 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). > > > To bad there's not a way to do this without /usr/src. Correct. All the make targets depend on various files inside that subtree to determine the correct actions. > If you just extract this new system over your current system, > how does that get rid of things you removed? It doesn't. The idea is to extract it to a freshly initialized file system. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...