Thread: Fedora 12

  1. #1
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065

    Fedora 12

    I'm a Slackware guy -- never liked the whole RPM/yum/apt-get/etc thingies. To that end, I need some help. What I want to do is download the kernel source for 2.6.31.6 for FC12. The problem is that I was able to yum install kernel and it got for me this ugly beast that I was unable to compile as there was "no rule to compile missing-syscalls" as the error that halted my progress. Not to be out done, I downloaded linux-2.6.31.6 from kernel.org and was able to reproduce almost all of the kernel tree. The one thing that I know I will need is drm_kms_helper (as I'm really attempting to make the 2.6.31.6 pure tree look like the FC12 modified tree).

    To that end, is there a way to patch the pure kernel with the FC12 patches so that I can get the drm_kms_helper.ko without breaking the kernel build

    OR

    is there a way that I can get the kernel source RPM to build?

    Any of you Fedora fanatics please let me know.

    Thanks!

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Unfortunately you can't build the Fedora kernel the normal way you're used to. You need to build the kernel through rpm which can seem a bit unintuitive if you're not familiar with rpm development. There are step-by-step instructions here on how to do it.
    bit∙hub [bit-huhb] n. A source and destination for information.

  3. #3
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Ur, um, okay, then will I be able to do a development build of a third party kernel module? What would be the procedure for doing that?

  4. #4
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Developing modules is different. You can install the module development rpm, and this will create a development branch at:
    /lib/modules/`uname -r`/build

    You can then build a module like this:
    (assuming you are in the same directory as the module source)
    make -C /lib/modules/`uname -r`/build M=`pwd`
    bit∙hub [bit-huhb] n. A source and destination for information.

  5. #5
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Okay, I wondered about that. Apparently there is a source tree (broken, of course) that resides under /lib/modues/longversionname/source that the driver I was attempting to build was accessing -- but the tree appeared to be unbuild (as in one usually has to run make under the tree to get the dependencies correct) but I couldn't get that one to compile the "normal" way either. Perhaps the script you sent will work for me.

    Man oh man I LOOOOOOVE Slackware.

  6. #6
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Yeah, to my knowledge, redhat based distros are the only ones where you can't do the normal:
    make menuconfig
    make all
    make modules_install
    make install
    bit∙hub [bit-huhb] n. A source and destination for information.

  7. #7
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    I would apply the FC patches to the kernel.org source, since they are just normal patches. RPM files are acually .cpio archives, btw, you can pull files (such as patches) out of them without installing.

    NB, are you sure you need to go this far anyway? All you really need to do is build against the same version number -- unless there is some peculiar reason, I would not think redhat's modifications will make any difference.

    If you are just doing this for yourself, just build and install a normal kernel. I've used FC for years and
    1) I never run a stock kernel
    2) I always use sources from kernel.org, not rpms, to build
    3) this has never caused me any kind of problem

    In fact it has spared me exactly the kind of problems (with the "abnormal" package source tree) you refer to when building third party stuff.
    Last edited by MK27; 12-04-2009 at 05:08 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  8. #8
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    unless there is some peculiar reason, I would not think redhat's modifications will make any difference.
    They make a huge difference. redhat has a ton of patches, and if you attempt to build a module against a non-patched kernel, you can expect all kinds of odd behavior once you load that module in. I learned this the hard way.
    bit∙hub [bit-huhb] n. A source and destination for information.

  9. #9
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by bithub View Post
    They make a huge difference. redhat has a ton of patches, and if you attempt to build a module against a non-patched kernel, you can expect all kinds of odd behavior once you load that module in. I learned this the hard way.
    Well, you should be rebuilding the kernel if you build against a different source, obviously.

    I guess that is no good if you are making a module for distribution tho.

    Just apply the patches!
    Code:
    #!/bin/bash
    
    for file in *; do
    	if [[ $file == *.patch ]]; then
    		patch -p0 <$file
    	fi
    done
    I don't have a kernel.src.rpm handy, but I think all those patches end in ".patch"
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  10. #10
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Well, the first thing bithub suggested didn't work -- it failed, miserably, late Friday afternoon. Taking the suggestion of MK (partially), I went to the source directory of the RPM Build (after it failed) and am now attempting to build the kernel from there -- this is a really slow machine.

    As to the requirements: I have none. I'm expecting that, since they chose to use FC 12, they want everything to be FC 12'isk (and none of that team was around on Friday afternoon). So, my plan is to make it look as close as possible. There was one module that wasn't a part of the mainstream kernel -- drm_kms_helper -- which this box does use. So, I'm attempting to get that little guy into this kernel build.

    Again, I have no requirements so I'm just aiming at the most logical target.

  11. #11
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Quote Originally Posted by Kennedy View Post
    Well, the first thing bithub suggested didn't work -- it failed, miserably, late Friday afternoon. Taking the suggestion of MK (partially), I went to the source directory of the RPM Build (after it failed) and am now attempting to build the kernel from there -- this is a really slow machine.

    As to the requirements: I have none. I'm expecting that, since they chose to use FC 12, they want everything to be FC 12'isk (and none of that team was around on Friday afternoon). So, my plan is to make it look as close as possible. There was one module that wasn't a part of the mainstream kernel -- drm_kms_helper -- which this box does use. So, I'm attempting to get that little guy into this kernel build.

    Again, I have no requirements so I'm just aiming at the most logical target.
    What failed? I've been building modules on Fedora like that for a while now. Did you install the kernel-devel rpm first?
    bit∙hub [bit-huhb] n. A source and destination for information.

  12. #12
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    I followed those instructions to the letter. I got an error, but I don't remember what it was -- I've slept <some> since then.

    It looked like it was all building nicely (though the build was not one that I've ever seen before), then poof, gone. It was after the command
    Code:
    rpmbuild -bb --with baseonly --with firmware --without debuginfo --target=`uname -m` kernel.spec
    But, it was getting late on Friday and I left it here over the weekend. I had already thought to do something like what MK had suggested. . . which, BTW compiled at least. Now I just have to see if I get all the modules that were already installed on this puppy.

  13. #13
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Quote Originally Posted by Kennedy View Post
    I followed those instructions to the letter. I got an error, but I don't remember what it was -- I've slept <some> since then.

    It looked like it was all building nicely (though the build was not one that I've ever seen before), then poof, gone. It was after the command
    Code:
    rpmbuild -bb --with baseonly --with firmware --without debuginfo --target=`uname -m` kernel.spec
    But, it was getting late on Friday and I left it here over the weekend. I had already thought to do something like what MK had suggested. . . which, BTW compiled at least. Now I just have to see if I get all the modules that were already installed on this puppy.
    Oh, I thought you meant my module building instructions were wrong -- not the kernel building instructions. I thought you just needed to build a module, not the whole kernel.
    bit∙hub [bit-huhb] n. A source and destination for information.

  14. #14
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Hmmm, perhaps I'm confused. All I have ever seen was that one had to compile against a kernel that has already had make run on it -- i.e. a precompiled kernel. Is this not the case?

    I'm having success, at the moment, though. I have a compilable kernel that I can build against -- AND I was able to get _EVERY_ kernel module that was previously build from the 2.6.31.6-145.fc12 build. So, on with the countdown.

    Thanks for ya'lls help, though.

  15. #15
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Quote Originally Posted by Kennedy View Post
    Hmmm, perhaps I'm confused. All I have ever seen was that one had to compile against a kernel that has already had make run on it -- i.e. a precompiled kernel. Is this not the case?

    I'm having success, at the moment, though. I have a compilable kernel that I can build against -- AND I was able to get _EVERY_ kernel module that was previously build from the 2.6.31.6-145.fc12 build. So, on with the countdown.

    Thanks for ya'lls help, though.
    Fedora has a unique method of compiling modules. You install the kernel-devel rpm which will set up a module build environment. Then all you need to do to compile a module is run:

    make -C /lib/modules/`uname -r`/build M=`pwd`
    (The above command assumes you are in the same directory as your module source code)
    bit∙hub [bit-huhb] n. A source and destination for information.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Fedora 9 - Instability
    By Mario F. in forum Tech Board
    Replies: 16
    Last Post: 09-30-2008, 09:55 PM
  2. Is this me or Windows?
    By carrotcake1029 in forum C Programming
    Replies: 9
    Last Post: 05-07-2008, 09:18 AM
  3. working out
    By ZakkWylde969 in forum A Brief History of Cprogramming.com
    Replies: 35
    Last Post: 11-29-2003, 01:17 PM
  4. Heaps...
    By Nutshell in forum C Programming
    Replies: 14
    Last Post: 04-23-2002, 08:54 AM
  5. Can't figure out why?
    By kwigibo in forum C Programming
    Replies: 10
    Last Post: 10-14-2001, 10:58 PM