Bug 162597

Summary: [handbook] Handbook section 12.14.3 example unclear.
Product: Documentation Reporter: r. clayton <rvclayton>
Component: Books & ArticlesAssignee: Manolis Kiagias <manolis>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description r. clayton 2011-11-15 20:20:03 UTC
Example 12-1, Creating a Swapfile on FreeBSD, in section 12.14.3, Swapfiles, starts off with

  1. Be certain that your kernel configuration includes the memory disk driver 
     (md(4)). It is default in GENERIC kernel.

       device   md   # Memory "disks"

I found this unclear for at least two reasons:

  It doesn't say how to be certain your kernal configuration includes the memory 
  disk driver.  The call-out box indicates what to look for, but it doesn't 
  indicate where to look (note I had to guess at what the call-out box text   
  meant; the example doesn't explain).  After futzing around with "kernel
  configuration" I eventually ended up at /usr/src/sys/i386/conf/GENERIC .

  The example describes (more or less) what you should do, but it doesn't say
  what you should do if your attempt to do (in this case, verify the memory disk
  driver) fails.

If you want to argue that none of this matters because md is included by default in GENERIC, then the text is still unclear:  why bring it up at all?  Just delete step 1 and start at step 2.

Fix: 

Replace the call-out box text with something like:

  $ grep md.*Memory /usr/src/sys/i386/conf/GENERIC
  device          md              # Memory "disks"

  $

Now all is revealed: what to do, where to do it, and what to look for.  There are a few problems - the example's architecture specific, the grep pattern may match other entries, and this may not be the recommended way to check for kernel features - but these problems are easily fixed.

I don't have any suggestions for handling the case when the example fails because I don't know what to do in that case.
How-To-Repeat: See http://www.freebsd.org/doc/handbook/adding-swap-space.html
Comment 1 sonic2000gr 2011-11-15 20:36:06 UTC
We shouldn't really direct the user to check anything in GENERIC, since 
the device is  there by default. I suppose we could rephrase this to 
something like the following:

"The GENERIC kernel already includes support for the md(4) device needed 
for this operation. When building a custom kernel, make sure to include 
the following line in your kernel configuration file:

device   md   # Memory "disks"

For information on building your own kernel please refer to 
<chapter/section ref here>."

Would this be appropriate?
Comment 2 Manolis Kiagias freebsd_committer freebsd_triage 2011-11-15 21:11:25 UTC
Responsible Changed
From-To: freebsd-doc->manolis

I'll handle this one
Comment 3 rvclayton 2011-11-15 21:41:47 UTC
--
Comment 4 rvclayton 2011-11-15 21:45:18 UTC
  I suppose we could rephrase this to something like the following:

  "The GENERIC kernel already includes support for the md(4) device needed 
  for this operation. When building a custom kernel, make sure to include 
  the following line in your kernel configuration file:

  device   md   # Memory "disks"

  For information on building your own kernel please refer to 
  <chapter/section ref here>."

  Would this be appropriate?

I like it (except maybe change the first sentence to "The GENERIC kernel
includes the md(4) device needed for this operation.")  Thank you for your
response to this.
Comment 5 sonic2000gr 2011-11-15 21:56:10 UTC
On 15/11/2011 11:45 ìì, R. Clayton wrote:
>    I suppose we could rephrase this to something like the following:
>
>    "The GENERIC kernel already includes support for the md(4) device needed
>    for this operation. When building a custom kernel, make sure to include
>    the following line in your kernel configuration file:
>
>    device   md   # Memory "disks"
>
>    For information on building your own kernel please refer to
>    <chapter/section ref here>."
>
>    Would this be appropriate?
>
> I like it (except maybe change the first sentence to "The GENERIC kernel
> includes the md(4) device needed for this operation.")  Thank you for your
> response to this.
>

Here is a quick patch then:

http://www.freebsdgr.org/all/en_US.ISO8859-1/books/handbook/config/config.txt

(note: no need to include the comment part on the device line)

and test build here:

http://www.freebsdgr.org/all/en_US.ISO8859-1/books/handbook/adding-swap-space.html

Unless there are any objections, I'll commit this tomorrow morning.
Thanks for reporting this!
Comment 6 dfilter service freebsd_committer freebsd_triage 2011-11-16 06:55:37 UTC
manolis     2011-11-16 06:55:28 UTC

  FreeBSD doc repository

  Modified files:
    en_US.ISO8859-1/books/handbook/config chapter.sgml 
  Log:
  Clear up the Handbook example on adding a swap file
  
  PR:             docs/162597
  Submitted by:   R. Clayton <rvclayton at acm dot org>
  Reviewed by:    gjb
  
  Revision  Changes    Path
  1.248     +8 -4      doc/en_US.ISO8859-1/books/handbook/config/chapter.sgml
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 7 Manolis Kiagias freebsd_committer freebsd_triage 2011-11-16 07:06:21 UTC
State Changed
From-To: open->closed

Changes were committed and will appear on the website soon. 
Thanks for reporting this!