Bug 20191

Summary: you don't ALWAYS have to make world before building a kernel
Product: Documentation Reporter: dan <dan>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description dan 2000-07-26 11:50:00 UTC
The handbook implies that when building a custom kernel, you need to 
do a build world first. That's not correct.

From http://www.freebsd.org/handbook/kernelconfig-building.html (near 
bottom of page):

For FreeBSD 4.x or later (or upgrading from FreeBSD 3.x to FreeBSD 
4.x or higher), use the following commands (be sure you have built 
world before!):

While correct, if you know what you are doing, we've had people
asking about how to build world, when all they need is a new
kernel.

Someone please verify my claims in the patch for correctness.  Cheers.
Comment 1 eogren 2000-07-26 15:01:37 UTC
Make [build|install]kernel requires a populated /usr/obj. The only way to
get that is to make world, so the entry is correct.

However, it is pretty unreasonable for everyone who downloads 4.1 and has
no intentions of tracking -STABLE to have to a) download the entire src
tree and b) build it just to get a custom kernel, and for these people,
the config, make sequence should work fine, since there aren't going to be
any toolchain issues.

So, having said that, how's the below patch look? My warnings might be a
little too dire, but I figured it would reduce the 10.2 million questions
on -stable about kernel builds dying if I made the point several times.

Eric

Index: chapter.sgml
===================================================================
RCS file: /usr/local/doctree/doc/en_US.ISO_8859-1/books/handbook/kernelconfig/chapter.sgml,v
retrieving revision 1.30
diff -u -r1.30 chapter.sgml
--- chapter.sgml	2000/07/25 09:34:10	1.30
+++ chapter.sgml	2000/07/26 13:59:57
@@ -160,14 +160,34 @@
 &prompt.root; <userinput>make</userinput>
 &prompt.root; <userinput>make install</userinput></screen>
 
-    <para>For FreeBSD 4.x or later (or upgrading from FreeBSD 3.x to
-      FreeBSD 4.x or higher), use the following commands (be sure you
-      have <link linkend="cutting-edge">built world</link> before!):</para>
+    <para>If you have just upgraded to a newer version of 4.X or
+      higher (ie from 3.X to 4.0-STABLE, or even from 4.0-STABLE to a
+      later version of 4.0-STABLE), make sure you have <link
+      linkend="cutting-edge">built world</link>, and then run the
+      following commands:</para>
 
     <screen>&prompt.root; <userinput>cd /usr/src</userinput>
 &prompt.root; <userinput>make buildkernel KERNEL=MYKERNEL</userinput>
 &prompt.root; <userinput>make installkernel KERNEL=MYKERNEL</userinput></screen>
 
+    <para>If you have <emphasis>not</emphasis> upgraded your source
+      tree in any way (you have not run <application>CVSUp</application>, 
+      <application>CTM</application>, or used 
+      <application>anoncvs</application>, then you should use the 
+      <command>config</command>, <command>make depend</command>, 
+      <command>make</command>, <command>make install</command> sequence.</para>
+
+    <warning>
+      <para>If you have upgraded your sources since your last kernel
+        build, you <emphasis>must</emphasis> use the <command>make
+        buildkernel</command> method to build your kernel.  Otherwise,
+	old utilities will be used to build the kernel, which will
+	probably fail.  <emphasis>Do not use the
+	<command>config</command>/<command>make</command> sequence to
+	build your kernel if you have updated the
+	sources!</emphasis></para>
+    </warning>
+    
     <para>The new kernel will be copied to the root directory as
       <filename>/kernel</filename> and the old kernel will be moved to
       <filename>/kernel.old</filename>.  Now, shutdown the system and
 

On Wed, Jul 26, 2000 at 03:42:06AM -0700, dan@freebsddiary.org wrote:
> >Description:
> The handbook implies that when building a custom kernel, you need to 
> do a build world first. That's not correct.
Comment 2 Jim Mock freebsd_committer freebsd_triage 2000-07-26 18:38:22 UTC
State Changed
From-To: open->closed

Committed with Eric's changes.  Thanks!