From owner-freebsd-questions@freebsd.org Mon Mar 11 07:08:05 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C191B1533E21 for ; Mon, 11 Mar 2019 07:08:05 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A9C686694 for ; Mon, 11 Mar 2019 07:08:03 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([92.193.208.84]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPA (Nemesis) id 1N32y5-1gw3KC0gHd-013Oaz; Mon, 11 Mar 2019 08:07:57 +0100 Date: Mon, 11 Mar 2019 08:07:56 +0100 From: Polytropon To: samir.otmane@numericable.fr Cc: freebsd-questions@freebsd.org Subject: Re: Barebone kernel options request Message-Id: <20190311080756.6191bb55.freebsd@edvax.de> In-Reply-To: References: 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-Provags-ID: V03:K1:U8HjbL4EKI8J5oP755YYp3pN0qpPxsY0DCAxU6hfIByIbdM+Ast 1yUFDSsH4nTt02CdUit6u84s2GTEBYMOn03Ylmp9UkJ7fOMm7vKzV5AIv1LXqfW9uDP5ygt ANgW7FF9i2ig/NMPR1KqZ3T2mUg5xDtJKQPL0YGeJ5F2blQ9p/5eH4OuAKmP5C+3OF8Kh8j ILpyg8XDc/hMqI3UnHtbA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:cSDT0JVC1Ds=:/We/j7OtcO+I/ppFXnKhMe 5TLnCNKLPRAoTabTfFkZTEOr0otGizZ1R2KLU7ueA13FssRY/AurCV+Nxg4ELBeN3PleGva5L P0gzw7TnCnctA3/J5AE2gofC2bAw3yp3vzvz3JnpBCNIpSNfjCozSPJWwld2r+bT04lbilcDh xYbXaQvDmEZL35/y+xnsKjXJk9LB9vIY3Sduv6xZV1r6zEUKvw07SXOZQzC448e49517M05ab ZbSKU6LHgaUi7+bradw9dvQJxO1E2md45yjLWWHr+wCYc2lOIdCcgMDnGa2lAW7lwt1E7wEXt RRAbQwd9Cxl7a8QEr3qPsQ6mCbDug+yEmhMJWXsyGAp6DtJbZB55/Jp/iAfxx891iLEN8fZRR ol+LEHWImdFmAeytpF/D/fedQF3wG7XyAr1Qdy9iXrilIZqBxV6FrBxrvssANVJw9TcUUbHIW g06xOo9haehBRbQqfJFxliNCoGh30saJmxaKw1nToBfjtV3K7SgKaC0hjjqiUaNtBEhgj7jec lH5OG8YNoFs29VBHS7o6ViQOIL6lMWATocl6vAmnt6K4OAHr5tLIUOAuhSGbJum/n7yHNk0dg K0WvAQ5tB1utlWl3E1FmIouk3HQzOWc+kXwWqN54dVir43vou6BsaZrvN7Ge1u6Kuplei0Gsh hU9KHm6bmo1M5ucc6Gt/FM/TJ0AUTZrkXdCfH7ERVWaxcf4JO5PEszFMV/U92zSDxFwn6gMpK v9QMxB0vjCxABiHCpUCwmCI/RuGTz1Vq1ukN4iuX4WeeHszDQP3X1FG1Dhg= X-Rspamd-Queue-Id: 3A9C686694 X-Spamd-Bar: ++++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [6.16 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; MV_CASE(0.50)[]; TO_DN_NONE(0.00)[]; HAS_ORG_HEADER(0.00)[]; MX_GOOD(-0.01)[mx00.schlund.de,mx01.schlund.de]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.79)[ip: (3.27), ipnet: 212.227.0.0/16(-1.04), asn: 8560(1.73), country: DE(-0.01)]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_PBL(0.00)[84.208.193.92.zen.spamhaus.org : 127.0.0.10]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.99)[0.986,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.99)[0.991,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000,0]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[133.126.227.212.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_LAST(0.00)[] X-Spam: Yes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Mar 2019 07:08:06 -0000 On Sun, 10 Mar 2019 13:58:30 +0100 (CET), samir.otmane@numericable.fr wrote: > For my purpose, i would like to get a very barebone FreeBSD kernel > ( For instance i don't want jaling, i'll want to get rid of unwanted > overhead ), but i don't know how to do so. > > > > IRC chatters told me that it would be very challenging to do so. Not really. :-) First of all, read chapter 8, "Configuring the FreeBSD Kernel" in The FreeBSD Handbook: https://www.freebsd.org/doc/en/books/handbook/kernelconfig.html You will then make a copy of the GENERIC kernel configuration file and adjust it to your needs, i. e., remove all the entries you do not need. Then you can go ahead and build a kernel based on that configuration file, install it, and boot it. Pay attention to the correct version match of source, world, and kernel on your system. Also read the comment header of /usr/src/Makefile, it contains a nice summary of build targets. You will also find further instructions in "man 7 build". I've been following the tradition of a custom kernel for many years in the past, especially for performance and speed reasons, as well as for following the mindset "I don't have it, therefore I don't need it". Today, this doesn't seem to be a valid reason anymore, but you can always cite security considerations... ;-) Sometimes people will tell you: "Don't write your own configuration file by altering a copy of GENERIC; instead just include GENERIC, add what you want to add, and use nodevice and nooption for what you don't want from GENERIC." Personally, I think this will cause much more work if your goal is to _reduce_ the kernel, instead of just inflating it with additional stuff. But of course, that method will work, too. > I found that page ( https://www.freebsd.org/cgi/man.cgi?query=src.conf ) > but it only disables user-land program building, not kernel-land code. That is correct. The /etc/src.conf file's purpose is to control the build caused by "make buildworld" and has little effect on the kernel - you can use it to avoid building certain kernel modules, though. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...