From owner-freebsd-hackers Fri Jun 1 17:49:19 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from johnson.mail.mindspring.net (johnson.mail.mindspring.net [207.69.200.177]) by hub.freebsd.org (Postfix) with ESMTP id 4105B37B423 for ; Fri, 1 Jun 2001 17:49:16 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.245.128.214.Dial1.SanJose1.Level3.net [209.245.128.214]) by johnson.mail.mindspring.net (8.9.3/8.8.5) with ESMTP id UAA01598; Fri, 1 Jun 2001 20:49:12 -0400 (EDT) Message-ID: <3B183823.E1748B4E@mindspring.com> Date: Fri, 01 Jun 2001 17:49:39 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Jiangyi Liu Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: How to recompile kernel after minor changes? References: <878zjb20fd.fsf@fatcow.home> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Jiangyi Liu wrote: > > Hi all, > > After just changing a little in sys/kern/kern_sig.c, how can I rebuild > the kernel fast? I think it should not take such a long time as 'make > buildkernel' does. Anyway, just kern_sig.c need to be recompiled and > the kernel can be linked. So how do you guys do in such case? Use this to build the kernel: 1st time: cd /sys/i386/conf cp GENERIC MYKERNEL 1st time, and any time yo modify the contents of MYKERNEL: cd /sys/i386/conf config MYKERNEL cd ../../compile/MYKERNEL make depend Each time you want to build a kernel, after a change: cd /sys/compile/MYKERNEL make If it works, to run on the new kernel: make install sync reboot If it doesn't boot, at the boot prompt when it is counting down, hit the spacebar, and type: unload boot kernel.old Once booted, if you want to ignore your changed kernel: cd / chflags noschflg kernel modules mv kernel kernel.bad mv modules modules.bad mv modules.old modules mv kernel.old kernel I have a shell script for this las, which does everything automatically, and checking for mistakes automatically, called "badkernel". If someone is willing to check it in, I'll provide it. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message