Find the answer to your Linux question:
Results 1 to 9 of 9
ok this is my first time compiling the kernel since i installed gentoo. first i downloaded the new kernel source with this command ...... Code: emerge gentoo-sources now im having ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2008
    Location
    127.0.0.1
    Posts
    29

    compiling a new kernel


    ok this is my first time compiling the kernel since i installed gentoo. first i downloaded the new kernel source with this command ......

    Code:
    emerge gentoo-sources
    now im having trouble getting to the next step in upgrading
    (taken from this page TIP Upgrading your kernel - Gentoo Linux Wiki)
    Code:
    cp <old-source>/.config linux/.config
    my question is how do i find out what the old source was so i can make the old config file part of the new source that way i dont have to go back through and redo the kernel?

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by Tralfas View Post
    ok this is my first time compiling the kernel since i installed gentoo. first i downloaded the new kernel source with this command ......

    Code:
    emerge gentoo-sources
    now im having trouble getting to the next step in upgrading
    (taken from this page TIP Upgrading your kernel - Gentoo Linux Wiki)
    Code:
    cp <old-source>/.config linux/.config
    my question is how do i find out what the old source was so i can make the old config file part of the new source that way i dont have to go back through and redo the kernel?
    In Gentoo, when you emerge a kernel it sits into /usr/src/, under that directory you will have many subdirectories with the different kernel sources that you installed.

    You can cd into that dir, and then use ls to see the installed kernel trees. Then use uname -r to see what version you are currently using. Whith the info from this two commands, you should be able to find which is the right thing to do.

    I leave that as an exercise. If you can't find the way yourself, just post the output of these two commands here, and I will try to help:

    $ ls -l /usr/src/
    $ uname -r

  3. #3
    Just Joined!
    Join Date
    Nov 2004
    Posts
    2
    Not necessarily the correct way to do it but I just copy
    /usr/src/linux-{current kernel}/.config to /usr/src/linux-{name of new kernel}/.config
    or you can just go into the new kernel and do
    make menuconfig
    and load the previous .config file that way.

    eselect kernel list should highlight the current kernel version unless you have changed it with eselect kernel set and uname -r should tell you what kernel you are currently running.

  4. #4
    Linux User dxqcanada's Avatar
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    259
    You can also copy the current running config to .config by:
    Code:
    # zcat /proc/config.gz > /usr/src/<kernel>/.config
    ... assuming that a config.gz file was created by the kernel.

    Here are a couple of references:

    Gentoo Wiki
    Gentoo Handbook



    Men occasionally stumble over the truth,
    but most of them pick themselves up
    and hurry off as if nothing had happened.

    Winston Churchill


    ... then the Unix-Gods created "man" ...

  5. #5
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Having options is always a good thing. But since it seems that right now, the problem is that he can't find the source tree on his filesystems, I think we should keep this simple for now. Having too much info when you can't even do the basic can be a bit overwhelming, in my humble opinion.

  6. #6
    Just Joined!
    Join Date
    Jan 2008
    Location
    127.0.0.1
    Posts
    29
    thanks for all the help
    i used cp to copy the old config to the new kernel source
    then i used make oldconfig and went through all the questions
    i compiled the kernel and copied the bzImage to /boot
    then i changed grub to include the new kernel name
    everything works and loads up except i think i need to use module rebuild so that alsa a nvidia works, because as of now i dont have a desktop just cli.

  7. #7
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by Tralfas View Post
    thanks for all the help
    i used cp to copy the old config to the new kernel source
    then i used make oldconfig and went through all the questions
    i compiled the kernel and copied the bzImage to /boot
    then i changed grub to include the new kernel name
    everything works and loads up except i think i need to use module rebuild so that alsa a nvidia works, because as of now i dont have a desktop just cli.
    The nvidia drivers (and any other drivers that's not part of the kernel itself) need to be re-emerged each time you install a new kernel. Make sure that /usr/src/linux is pointing to the right kernel, because most of these packages use that link to choose the kernel that they will link against.

    There are automatic tools for this, such as module-rebuild or whatever it's called. I can't comment on them because I never used them (for no particular reason, just laziness :P ).

  8. #8
    Just Joined!
    Join Date
    Jan 2008
    Location
    127.0.0.1
    Posts
    29
    i just used symlink in my make file so that it points to the right kernel instead of updating the symbolic link.

  9. #9
    Just Joined!
    Join Date
    Jan 2008
    Location
    127.0.0.1
    Posts
    29
    module-rebuild is pretty nice!

    just
    Code:
    emerge module-rebuild
    you just populate the list of modules that you need to reinstall(i only had an nvidia one)
    Code:
    module-rebuild populate
    then rebuild the modules
    Code:
    module-rebuild rebuild
    pretty easy!

    thanks for the help once again!

Posting Permissions

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