Date: Fri, 01 Jun 2001 17:49:39 -0700 From: Terry Lambert <tlambert2@mindspring.com> To: Jiangyi Liu <gzjyliu@public.guangzhou.gd.cn> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: How to recompile kernel after minor changes? Message-ID: <3B183823.E1748B4E@mindspring.com> References: <878zjb20fd.fsf@fatcow.home>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B183823.E1748B4E>