Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 37e222326095a93978d54b1564dd9954 > files > 105

apcupsd-3.10.5-1mdk.ppc.rpm

<!doctype html public "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
   <title>Configuring a Kernel for USB Support</title>
   <meta name="Author" content="Kern Sibbald">
   <link rel=stylesheet href="apcupsd-styles.css" type="text/css">
</head>
<body>
<h1>Configuring a Kernel for USB Support</h1>
<h2>General</h2>
Apcupsd version 3.9.x (development version to be released as
3.10.1) provides support for USB UPSes on Linux systems.
However at this time (August 2001) Linux kernels do not yet
support the HIDDEV device that is used by <b>apcupsd</b>.
If you have a kernel version 2.4.5 or later and you
apply the appropriate Alan Cox patch, you will be able
to enable USB support in <b>apcupsd</b>.  
<p></p>For kernel 2.4.5, you need patch <b>ac12</b> or
later. For later versions of the kernel, any <b>ac</b>
patch should work.
<h2>Downloading</h2>
New kernel versions are released and an amazing
speed, so by the time you read this, the current
stable kernel will no longer be 2.4.5.
You can obtain the 2.4 kernels from: 
<a href="http://www.kernel.org/pub/linux/kernel/v2.4/">http://www.kernel.org/pub/linux/kernel/v2.4/</a>.
<p></p>You can obtain the Allen Cox patches from:
<a href="http://www.kernel.org/pub/linux/kernel/people/alan/2.4/">http://www.kernel.org/pub/linux/kernel/people/alan/2.4/</a>
<p>
Alternatively, you can obtain the latest kernel source from your
favorite vendor. For example, for RedHat, you would
obtain: kernel-source-2.4.x.rpm
and install it with <b>rpm</b>, then skip the
first two steps in the next section.

<h2>Building the Kernel</h2>
I provide here only a very brief explanation of the steps
necessary to build your kernel.  If you have a later
kernel such as RedHat 7.3 (kernel 2.4.18-5), you don't
need to rebuild it. If you want to anyway, you can install
the <b>kernel-source</b> rpm, cd to the appropriate
directory (usually <b>/usr/src/linux-2.4</b>), then skip immediately to
step 11 below.
<pre>
 1. Download kernel from:
    http://www.kernel.org/pub/linux/kernel/v2.4/
    (I assume you get linux-2.4.5.tar.gz and that
     you put it into /usr/src)

 2. Download Alan Cox patch from:
    http://www.kernel.org/pub/linux/kernel/people/alan/2.4/
    (I assume you get patch-2.4.5-ac12.gz and that you
     put it into /usr/src)

 3. su root

 4. cd /usr/src

 5. Ensure that the directory linux does not exist,
    or if it is linked, remove the link or change the
    name.

 6. Unpack the kernel with:

    tar xvfz linux-2.4.5.tar.gz                 

 7. Unpack the patch with:

    gunzip patch-2.4.5-ac12.gz

 8. Move the kernel source into a different directory:

    mv linux linux-2.4.5
        
        or
        
        mv linux linux-2.4.5-ac12
 
 9. cd linux-2.4.5

10. Apply the patch with:

    patch -p1 <../patch-2.4.5-ac12

    There should be no errors.

11. make mrproper

12. Find a valid configuration file, and
    make sure it has the following configuration
        statements. If not, please add them:
        
    CONFIG_USB=m
    CONFIG_USB_LONG_TIMEOUT=y
    CONFIG_USB_LARGE_CONFIG=y
    CONFIG_USB_HID=m
    CONFIG_USB_HIDDEV=m

    Note, the CONFIG_USB_LARGE_CONFIG does not seem to be present
    in some of the later kernels (e.g. 2.4.18)

13. make menuconfig  or   make xconfig (if you are running X)
    load a valid configuration file
    check the above values and ensure they are correct
    save config

14. Check what you saved by editing .config
    You can skip this if you have done kernel builds
        before.

15. make dep

16. make clean

17. make bzImage

18. make modules

19. make modules_install

20. make install

21. If you boot from a SCSI, you will need to make a
    new initrd image

22. Update /etc/lilo.conf to include the new kernel.
    If you are using grub, edit the /boot/grub config
    file and skip steps 24 and 25.

23. cd /etc  (skip this if you are using grub)

24. lilo -v  (skip this if you are using grub) 

25. reboot

26. Ensure that uhci and hid are loaded by
    doing <b>cat /proc/modules</b>
        
        If not, load them by hand.
        
        modprobe uhci
        modprobe hid
</pre>

<h3>Build Problems</h3>
If you start with the RedHat <b>kernel-source</b> package as
I did and use one of their config files in <b>configs</b> as I
did, you are very likely to get a number of undefined symbols
when making or installing the modules. In this case, I found that
I can simply edit <b>.config</b> with my favorite editor, comment
out modules that don't build (knowing which ones is not always
obvious from the names), then simply <b>make modules</b> and
<b>make modules_install</b> until all the problems go away.
Once the module build and install is correct,
I recommend doing <b>make bzImage</b> and <b>make install</b>
again.                                 

<h3>Disclaimer</h3>
I'm not at all a kernel expert so you are pretty much
on your own here. Any corrections to these instructions
would be welcome.
<hr>

<a href="snmp.html" target="_self"><img src="back.gif" border=0 alt="Back"></a>
<a href="win32.html" target="_self"><img src="next.gif" border=0 alt="Next"></a>
<a href="index.html"><img src="home.gif" border=0 alt="Home"></a>
</body>
</html>