Comment 9 for bug 1530187

Revision history for this message
In , Tiwai-r (tiwai-r) wrote :

(In reply to comment #5)
> (In reply to comment #3)
> > I am not a kernel developer and so I'm not sure how to build r592.c with the
> > patch, however, I would be happy to test it if somebody else would build it for
> > me. Alternatively, if its simple to do, then please provide some instructions
> > and I will attempt to build it.
>
> Yes, you should learn how to build a kernel and a patched module. There are a
> few good ways. I'll give some brief instructions later.

A quick way to rebuild a module is like below:

1. Install kernel-source and kernel-desktop-devel packages.

2. Copy the relevant driver code to the local directory. Suppose you'll work on a directory /somewhere/test to compile the module:
   % mkdir /somewhere/test
   % cp -a /usr/src/linux/drivers/memstick/host /somewhere/test

3. Patch the code. In this case, pass -p4 to strip the paths:
   % cd /somewhere/test
   % patch -p4 < /yetsomewhere/r592.patch

4. Build the module. This is the tricky part. Pass -C option to make.
   % make -C /usr/src/linux-obj/x86_64/desktop M=$(pwd) modules

5. If successful built, install it to the updates directory. Do this as root.
   % su
   ....
   # mkdir -p /lib/modules/$(uname -r)/updates
   # cp *.ko /lib/modules/$(uname -r)/updates
   # depmod -a

6. Confirm that the module will be loaded from the new path. The command below should give the path with "updates" path:
   % /usr/sbin/modinfo r592 | grep filename
   filename: /lib/modules/..../updates/r592.ko

7. Retest. If anything goes wrong, just remove the updated modules from /lib/modules/*/updates/* directory.

Since this rebuilds only a few modules, it won't take time at all, at most 5 minutes or so.