From owner-freebsd-questions@freebsd.org Tue Jul 7 16:28:17 2015 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 540E6996BD5 for ; Tue, 7 Jul 2015 16:28:17 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1835B101D for ; Tue, 7 Jul 2015 16:28:16 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-74-114.dynamic.qsc.de [92.195.74.114]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 53D5E3CCFF; Tue, 7 Jul 2015 18:28:08 +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 t67GS7CV002166; Tue, 7 Jul 2015 18:28:07 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Tue, 7 Jul 2015 18:28:07 +0200 From: Polytropon To: Lev Cc: freebsd-questions@freebsd.org Subject: Re: own kernel vs. update Message-Id: <20150707182807.bee1587c.freebsd@edvax.de> In-Reply-To: <20150707180022.02bb01d8@jive.levalinux.org> References: <20150707172116.2aa2d38a@jive.levalinux.org> <20150707172902.99e4afc5.freebsd@edvax.de> <20150707180022.02bb01d8@jive.levalinux.org> 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-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2015 16:28:17 -0000 Re-including list, hope that's okay... On Tue, 7 Jul 2015 18:00:22 +0200, Lev wrote: > Is there any way to compile my kernel and put the result somewhere else, and > make the bootloader load my new kernel? Yes, this is possible. The kernel and the modules can be found in /usr/obj - the subtree where all parts of the compiled systems go before they are installed to their final places. The KODIR variable can be set for the installation process to _not_ default to /boot/kernel for the results: # cd /usr/src # make kernel KERNCONF=MYKERNEL KODIR=mykernel NB: "make kernel" is shorthand for "make buildkernel && make installkernel". Then you can edit /boot/loader.conf to load your custom kernel instead of the GENERIC one that's being installed (and updated with freebsd-update): autoboot_delay="5" kernel="mykernel" bootfile="kernel" This will make the loader load /boot/mykernel/kernel and ignore /boot/kernel/kernel (the GENERIC kernel). See "man loader.conf" and /boot/defaults/loader.conf for details and examples. Maybe this is helpful: https://www.freebsd.org/doc/handbook/kernelconfig-building.html https://www.freebsd.org/doc/handbook/kernelconfig-trouble.html#kernelconfig-noboot > And if I want to run the stock > kernel, I can chose between FreeBSD's and mine? The loader allows that, too. Its interactive mode can be used, see the "unload " and "load " commands when the boot loader has been interrupted. unload mykernel load kernel boot This assumes you're not using the boot menu. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...