From owner-freebsd-questions@freebsd.org Tue Sep 19 09:07:56 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 0E5E4E06FD3 for ; Tue, 19 Sep 2017 09:07:56 +0000 (UTC) (envelope-from kraduk@gmail.com) Received: from mail-qk0-x230.google.com (mail-qk0-x230.google.com [IPv6:2607:f8b0:400d:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B892172FB1 for ; Tue, 19 Sep 2017 09:07:55 +0000 (UTC) (envelope-from kraduk@gmail.com) Received: by mail-qk0-x230.google.com with SMTP id u67so2949547qkg.6 for ; Tue, 19 Sep 2017 02:07:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mT2ioZqn+TBwq67fI2Qvaog4YhPfKNUs5UsTc+sza8c=; b=nmoTKMLxGtIkhow2Y1tDkZ1yrSO0fKsFU8sKpikp02EQmmetnsJyRDtbziv/XrnJ+Y BYVmNs6ClcX0U11EygH7A0FK7pQxfGa6zjmAbxZAD6m4qhQGQzN627JLsMbw22crg3RM Le9sFAltSZr06OTsYcEqOthL1ugHdcDiVMceAR5Jw/oaAncsXBgGSDQK2aeEBYZrIMes fuwZcSqVikH9lHQGxEFrmYkdZQt+DTyTg5uDsytvE/X3bsgkIyZjWqtljw3gvOwh3pUu h28S+UlBIV0XyKhWzgzMKN1Tur5T6PJJdo5u/Elcp4c5mO7oNxGVw3qcgr8U0B5knAIM 7+rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mT2ioZqn+TBwq67fI2Qvaog4YhPfKNUs5UsTc+sza8c=; b=jk1v/tdrU0r/2R7CwqwdxCg8mf1DflE0bzoIhCz3TCoCXuILTQKk6mMElRktQEdkAp unW2wuUag+/IRlXMH1RCGTcH/hWOzUDhMUAdh7pzj4ggKSKZeb0wUxgy39OdK3KV5yNr z92oa1zsu7476VqjVZN6fXCfxHXhTufTwzC5AiGcE3Yj6x4zUWwHOpmnAZs1VMRur5Ny 1Wz/H+FlHJyJNDloHZd3JeCLppYJfbRm/NU+P8niu56RhfhXEC4XU6gMdHzAUUpie/wk LEIzQDZKbQnsv0U0Bw2+/5/nrl7uKs3p6qoWuDt5yRO/X5tq6VTlAhQEtcIEnZs6I5b1 /qjw== X-Gm-Message-State: AHPjjUglFuMMojAVxtV2emQSGlK2PrNXQUQLxg9HJh19cjNus+9xK80/ QlHBtB2ItbcoO0PUYIFsha9me5z1GMxXZ+kRl2s= X-Google-Smtp-Source: AOwi7QBPNEayCqzykgJeMlpdOGKymeLeOT/myMg5FQJJ4PlSpWZjvAX7v3tpJTo/mwUGk1Bod7jccWMAGxocn6Wlzbw= X-Received: by 10.55.155.203 with SMTP id d194mr866450qke.288.1505812074747; Tue, 19 Sep 2017 02:07:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.27.239 with HTTP; Tue, 19 Sep 2017 02:07:54 -0700 (PDT) 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> From: krad Date: Tue, 19 Sep 2017 10:07:54 +0100 Message-ID: Subject: Re: help with condensing bsd To: sorressean Cc: Anton Yuzhaninov , FreeBSD Questions Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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: Tue, 19 Sep 2017 09:07:56 -0000 Thats what boot environments are for. Create a blank filesystem and then do and install with the dest-dir installed. make delete-old etc should take care of a lot of the issues. You could of course use pkgbase to create your base image, and you can strip bits off afterward quite easily. However as you a re doing a custom build there is no getting away from /usr/src, until pkgbase becomes standard in maybe 12, or 13. On 11 September 2017 at 14:59, 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. If you just extract > this new system over your current system, how does that get rid of things > you removed? For example I got rid of bluetooth and various other things > that I don't want installed. > Thanks, > > 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 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions- > unsubscribe@freebsd.org" > > > -- > > Take Care, > Tyler Littlefield > > Tyler Littlefield Consulting: website development and business > solutions. My personal site > My Linkedin > @Sorressean on Twitter > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions- > unsubscribe@freebsd.org" >