Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: HOWTO: use linux restricted modules with a custom kernel

  1. #1
    Join Date
    Nov 2006
    Location
    Switzerland
    Beans
    416

    HOWTO: use linux restricted modules with a custom kernel

    IMPORTANT: MANY PEOPLE REPORT PROBLEMS TO HAVE THIS WORKING. FOR NOW IT'S VERY LIKELY IT'S NOT GOING TO WORK FOR YOU AS IS!!!!!!!


    This HowTo propose a trick to use linux restricted modules and use the restricted driver manager in Feisty with a custom kernel (like a Vanilla kernel or a patched Ubuntu kernel etc).

    Why do this?
    ----------------
    Sometime you need to use a custom compiled kernel for various reasons if you need specific hardware to work, if you want the very latest Linux kernel or if you want to use some patches like the popular undervolting patch (linux PHC). When you compile a kernel it has its own specific name and is thus no more "associated" to the linux restricted modules that came with the Ubuntu distrbution. So usually people compiling a new kernel couldn't use the restricted modules and had to use workarounds to have their specific hardware working (like Nvidia or ATI cards). This HowTo is made to propose a way to use those restricted modules with custom kernels.

    How does this work?
    -------------------------
    Nothing fancy here. It's all about symlinking! Basically when you compile a kernel it gets a specific name/version that doesn't match those of the restricted modules that came with Ubuntu. So if you create symlinks or all references to restricted modules under the new name of the kernel, Ubuntu may think that there exist restricted modules for our specific kernel and will use them. So for all files/folders containing restricted modules for the original kernel, you have to create a symlink with the new kernel name/version.

    Which Ubuntu version does it apply to?
    -----------------------------------------------
    This trick has been tested on Feisty Fawn and the user who kindly tested that was able to install/uninstall Nvidia restricted drivers from the Restricted driver manager while using a custom compiled Vanilla kernel patched with Con Kolivas performance patch. It must be mentionned that the Vanilla kernel was the same version (2.6.20) as the linux-restricted-module that come with Ubuntu. However it's quite possible that this would work if you use a newer/older kernel as well. It just hasn't been tested yet.

    Is it dangerous?
    -------------------
    Honestly I don't think so but obviously do a backup before messing with this, just in case something get screwed. You can easily revert the modification applied by this trick simply by removing the symlinks created. If you have any problem you should still be able to reboot the computer under the old kernel version to remove the changes.





    OK so what should I do to have this work (on Feisty)?
    -----------------------------------------------------------------

    ***** PLEASE BACKUP FIRST *****

    Here we will assume that you new custom kernel is 2.6.20-ck1. Just adapt the blue text to your own kernel if it different.

    1) We first need to trick Ubuntu into thinking that there exist a linux-restricted-modules package specific to your custom kernel. This is required to allow the restricted drivers manager in Feisty to work.

    sudo gedit /var/lib/dpkg/status and copy the following at the end of the file then save it:

    Code:
    Package: linux-restricted-modules-2.6.20-ck1
    Status: install ok installed
    Priority: optional
    Section: restricted/misc
    Installed-Size: 41328
    Maintainer: Ubuntu Kernel Team <kernel-team@lists.ubuntu.com>
    Architecture: i386
    Source: linux-restricted-modules-2.6.20
    Version: 2.6.20-ck1
    Provides: nvidia-kernel-1.0.9631, nvidia-kernel-1.0.7184, nvidia-kernel-1.0.9755
    Depends: linux-image-2.6.20-15-generic, linux-restricted-modules-common (>= 2.6.20), module-init-tools, nvidia-kernel-common
    Suggests: nvidia-glx | nvidia-glx-legacy | nvidia-glx-new, avm-fritz-firmware-2.6.20-15
    Description: Non-free Linux 2.6.20 modules on x86/x86_64
     This package provides restricted modules for Linux version 2.6.20 on
     x86/x86_64.
     .
     Currently the following modules are included:
     - madwifi (Atheros)
     - fglrx (ATI)
     - nvidia
     - fcdsl2, fcdslsl, fcdslslusb, fcdslusb, fcdslusb2, fcpci (AVM ISDN)
     .
     These modules are "restricted" because they are not available under a
     completely Free licence.
    2) sudo gedit /var/lib/dpkg/available and copy the following at the end of the file then save it:

    Code:
    Package: linux-restricted-modules-2.6.20-ck1
    Priority: optional
    Section: restricted/misc
    Installed-Size: 41328
    Maintainer: Ubuntu Kernel Team <kernel-team@lists.ubuntu.com>
    Architecture: i386
    Source: linux-restricted-modules-2.6.20
    Version: 2.6.20-ck1
    Provides: nvidia-kernel-1.0.9631, nvidia-kernel-1.0.7184, nvidia-kernel-1.0.9755
    Depends: linux-image-2.6.20-15-generic, linux-restricted-modules-common (>= 2.6.20), module-init-tools, nvidia-kernel-common
    Suggests: nvidia-glx | nvidia-glx-legacy | nvidia-glx-new, avm-fritz-firmware-2.6.20-15
    Size: 16096180
    Description: Non-free Linux 2.6.20 modules on x86/x86_64
     This package provides restricted modules for Linux version 2.6.20 on
     x86/x86_64.
     .
     Currently the following modules are included:
     - madwifi (Atheros)
     - fglrx (ATI)
     - nvidia
     - fcdsl2, fcdslsl, fcdslslusb, fcdslusb, fcdslusb2, fcpci (AVM ISDN)
     .
     These modules are "restricted" because they are not available under a
     completely Free licence.
    3) Now we will create all the symlinks so that the new kernel can use the restricted modules that originally came with Ubuntu. 2.6.20-15 is the kernel version that comes with Feisty. If you don't use Feisty you need to adjust this version number to whatever your distribution is.

    In the terminal copy/paste these lines one at a time and run them:

    cd /lib/firmware
    sudo ln -s 2.6.20-15-generic 2.6.20-ck1

    cd /lib/linux-restricted-modules
    sudo ln -s 2.6.20-15-generic 2.6.20-ck1

    cd /usr/share/linux-restricted-modules
    sudo ln -s 2.6.20-15-generic 2.6.20-ck1

    cd /var/lib/dpkg/info
    sudo ln -s linux-restricted-modules-2.6.20-15-generic.md5sums linux-restricted-modules-2.6.20-ck1.md5sums
    sudo ln -s linux-restricted-modules-2.6.20-15-generic.postinst linux-restricted-modules-2.6.20-ck1.postinst
    sudo ln -s linux-restricted-modules-2.6.20-15-generic.postrm linux-restricted-modules-2.6.20-ck1.postrm
    sudo ln -s linux-restricted-modules-2.6.20-15-generic.list linux-restricted-modules-2.6.20-ck1.list


    4) Try to open the restricted drivers manager and see if it works. You should now be able to install/uninstall restricted drivers!
    Last edited by kilou; June 9th, 2007 at 10:16 PM.

  2. #2
    Join Date
    May 2007
    Beans
    14

    Re: HOWTO: use linux restricted modules with a custom kernel

    First of all, When you paste those two blocks of text, you need to put a space before each of the following lines of text, for both blocks:

    Code:
    This package provides restricted modules for Linux version 2.6.20 on
    x86/x86_64.
    .
    Currently the following modules are included:
    - madwifi (Atheros)
    - fglrx (ATI)
    - nvidia
    - fcdsl2, fcdslsl, fcdslslusb, fcdslusb, fcdslusb2, fcpci (AVM ISDN)
    .
    These modules are "restricted" because they are not available under a
    completely Free licence.
    Then, I had to reinstall all of the packages that were related to the restricted drivers manager (Except the fake one we added), and reboot. But I'd been having trouble with this and just manually installed the madwifi drivers I needed in the end, although the Restricted Drivers Manager does work, and does recognize that I do indeed need the Atheros drivers.

    Thanks,

    Eddie

  3. #3
    Join Date
    Nov 2006
    Location
    Switzerland
    Beans
    416

    Re: HOWTO: use linux restricted modules with a custom kernel

    Quote Originally Posted by Eddi3 View Post
    But I'd been having trouble with this and just manually installed the madwifi drivers I needed in the end, although the Restricted Drivers Manager does work, and does recognize that I do indeed need the Atheros drivers.
    Hi Eddy,

    thanks for the precisions. I have modified the first post so that the spaces are properly registred when doing a copy/paste. What kind of troubles did you experience? Was the restricted driver manager not able to install the Atheros drivers for your madwifi?
    Last edited by kilou; May 20th, 2007 at 09:21 PM.

  4. #4
    Join Date
    Nov 2006
    Location
    Switzerland
    Beans
    416

    Re: HOWTO: use linux restricted modules with a custom kernel

    If you want to use the updated restricted modules that came with kernel update 2.6.20-16, you need to replace the 2.6.20-15 with 2.6.20-16 everywhere.

  5. #5
    Join Date
    Nov 2005
    Beans
    88

    Re: HOWTO: use linux restricted modules with a custom kernel

    When I try this procedure and I click on the restricted drivers manager, I get the following text box:

    You need to install the package

    linux-restricted-modules-2.6.21.3-custom

    for this program to work.

    Any ideas what could be wrong? I checked for simple transcription errors (modified for 16-generic and also the name of my custom kernel).

  6. #6
    Join Date
    Nov 2006
    Location
    Switzerland
    Beans
    416

    Re: HOWTO: use linux restricted modules with a custom kernel

    The example above is for a kernel that is called 2.6.20-ck1. Yours is called 2.6.21.3-custom so you have to use that name instead.

    So first remove all the symlinks you created with the first trial:

    sudo rm /lib/firmware/2.6.20-ck1
    sudo rm /lib/linux-restricted-modules/2.6.20-ck1
    sudo rm /usr/share/linux-restricted-modules/2.6.20-ck1
    sudo rm /var/lib/dpkg/info/linux-restricted-modules-2.6.20-ck1.md5sums
    sudo rm /var/lib/dpkg/info/linux-restricted-modules-2.6.20-ck1.postinst
    sudo rm /var/lib/dpkg/info/linux-restricted-modules-2.6.20-ck1.postrm
    sudo rm /var/lib/dpkg/info/linux-restricted-modules-2.6.20-ck1.list

    and then redo the process but replace all the blue texts with 2.6.21.3-custom. Don't forget there is blue text in the /var/lib/dpkg/status and /var/lib/dpkg/available file as well! Let me know if that works for you.

    Hope this helps
    Last edited by kilou; May 31st, 2007 at 05:41 PM.

  7. #7
    Join Date
    Nov 2005
    Beans
    88

    Re: HOWTO: use linux restricted modules with a custom kernel

    I did substitute the name of my kernel for the one used in your examples. I'll recheck it, though.

  8. #8
    Join Date
    Nov 2006
    Location
    Switzerland
    Beans
    416

    Re: HOWTO: use linux restricted modules with a custom kernel

    Did you really change the kernel version in /var/lib/dpkg/status and /var/lib/dpkg/available?? Please post a copy of what you pasted inside to make sure.

  9. #9
    Join Date
    Nov 2005
    Beans
    88

    Re: HOWTO: use linux restricted modules with a custom kernel

    Here's some info on what I've got. The problem still persists:

    root@valar:/lib/firmware# ls -l
    drwxr-xr-x 4 root root 4096 2007-04-15 07:53 2.6.20-15-generic/
    drwxr-xr-x 4 root root 4096 2007-05-29 08:10 2.6.20-16-generic/
    lrwxrwxrwx 1 root root 17 2007-05-31 10:57 2.6.21.3-custom -> 2.6.20-16-generic/

    root@valar:/lib/linux-restricted-modules# ls -l
    drwxr-xr-x 17 root root 4096 2007-04-15 07:53 2.6.20-15-generic/
    drwxr-xr-x 17 root root 4096 2007-05-29 08:10 2.6.20-16-generic/
    lrwxrwxrwx 1 root root 17 2007-05-31 10:58 2.6.21.3-custom -> 2.6.20-16-generic/

    root@valar:/lib/linux-restricted-modules# ls -l /usr/share/linux-restricted-modules/
    drwxr-xr-x 3 root root 4096 2007-04-15 07:53 2.6.20-15-generic/
    drwxr-xr-x 3 root root 4096 2007-05-29 08:10 2.6.20-16-generic/
    lrwxrwxrwx 1 root root 17 2007-05-31 10:58 2.6.21.3-custom -> 2.6.20-16-generic/

    root@valar:/var/lib/dpkg/info# ls -l *custom*
    -rw-r--r-- 1 root root 827980 2007-05-31 10:36 linux-headers-2.6.21.3-custom.list
    -rw-r--r-- 1 root root 1045395 2007-05-31 09:56 linux-headers-2.6.21.3-custom.md5sums
    -rwxr-xr-x 1 root root 7126 2007-05-31 09:54 linux-headers-2.6.21.3-custom.postinst*
    -rwxr-xr-x 1 root root 11846 2007-05-31 09:45 linux-image-2.6.21.3-custom.config*
    -rw-r--r-- 1 root root 141727 2007-05-31 10:31 linux-image-2.6.21.3-custom.list
    -rw-r--r-- 1 root root 185519 2007-05-31 09:45 linux-image-2.6.21.3-custom.md5sums
    -rwxr-xr-x 1 root root 49480 2007-05-31 09:45 linux-image-2.6.21.3-custom.postinst*
    -rwxr-xr-x 1 root root 15176 2007-05-31 09:45 linux-image-2.6.21.3-custom.postrm*
    -rwxr-xr-x 1 root root 20962 2007-05-31 09:45 linux-image-2.6.21.3-custom.preinst*
    -rwxr-xr-x 1 root root 13266 2007-05-31 09:45 linux-image-2.6.21.3-custom.prerm*
    -rw-r--r-- 1 root root 14282 2007-05-31 09:45 linux-image-2.6.21.3-custom.templates
    lrwxrwxrwx 1 root root 47 2007-05-31 10:55 linux-restricted-modules-2.6.21.3-custom.list -> linux-restricted-modules-2.6.20-16-generic.list
    lrwxrwxrwx 1 root root 50 2007-05-31 10:54 linux-restricted-modules-2.6.21.3-custom.md5sums -> linux-restricted-modules-2.6.20-16-generic.md5sums
    lrwxrwxrwx 1 root root 51 2007-05-31 10:54 linux-restricted-modules-2.6.21.3-custom.postinst -> linux-restricted-modules-2.6.20-16-generic.postinst*
    lrwxrwxrwx 1 root root 49 2007-05-31 10:54 linux-restricted-modules-2.6.21.3-custom.postrm -> linux-restricted-modules-2.6.20-16-generic.postrm*

    tail of /var/lib/dpkg/status:

    Package: linux-restricted-modules-2.6.21.3-custom
    Status: install ok installed
    Priority: optional
    Section: restricted/misc
    Installed-Size: 41328
    Maintainer: Ubuntu Kernel Team <kernel-team@lists.ubuntu.com>
    Architecture: i386
    Source: linux-restricted-modules-2.6.20
    Version: 2.6.21.3-custom
    Provides: nvidia-kernel-1.0.9631, nvidia-kernel-1.0.7184, nvidia-kernel-1.0.9755
    Depends: linux-image-2.6.20-16-generic, linux-restricted-modules-common (>= 2.6.20), module-init-tools, nvidia-kernel-common
    Suggests: nvidia-glx | nvidia-glx-legacy | nvidia-glx-new, avm-fritz-firmware-2.6.20-15
    Description: Non-free Linux 2.6.20 modules on x86/x86_64
    This package provides restricted modules for Linux version 2.6.20 on
    x86/x86_64.
    .
    Currently the following modules are included:
    - madwifi (Atheros)
    - fglrx (ATI)
    - nvidia
    - fcdsl2, fcdslsl, fcdslslusb, fcdslusb, fcdslusb2, fcpci (AVM ISDN)
    .
    These modules are "restricted" because they are not available under a
    completely Free licence.


    tail of /var/lib/dpkg/available:

    Package: linux-restricted-modules-2.6.21.3-custom
    Priority: optional
    Section: restricted/misc
    Installed-Size: 41328
    Maintainer: Ubuntu Kernel Team <kernel-team@lists.ubuntu.com>
    Architecture: i386
    Source: linux-restricted-modules-2.6.20
    Version: 2.6.21.3-custom
    Provides: nvidia-kernel-1.0.9631, nvidia-kernel-1.0.7184, nvidia-kernel-1.0.9755
    Depends: linux-image-2.6.20-16-generic, linux-restricted-modules-common (>= 2.6.20), module-init-tools, nvidia-kernel-common
    Suggests: nvidia-glx | nvidia-glx-legacy | nvidia-glx-new, avm-fritz-firmware-2.6.20-15
    Size: 16096180
    Description: Non-free Linux 2.6.20 modules on x86/x86_64
    This package provides restricted modules for Linux version 2.6.20 on
    x86/x86_64.
    .
    Currently the following modules are included:
    - madwifi (Atheros)
    - fglrx (ATI)
    - nvidia
    - fcdsl2, fcdslsl, fcdslslusb, fcdslusb, fcdslusb2, fcpci (AVM ISDN)
    .
    These modules are "restricted" because they are not available under a
    completely Free licence.

  10. #10
    Join Date
    Nov 2006
    Location
    Switzerland
    Beans
    416

    Re: HOWTO: use linux restricted modules with a custom kernel

    Weird. Could you please post the output of uname -a ?

    I'll try to compile the 2.6.21.3 Vanilla kernel and see if this works on my system.
    Last edited by kilou; May 31st, 2007 at 11:03 PM.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •