Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel Sources gone, how to "restore" ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Mati
Apprentice
Apprentice


Joined: 02 Sep 2008
Posts: 172

PostPosted: Sat Apr 18, 2015 8:14 am    Post subject: Kernel Sources gone, how to "restore" ? Reply with quote

Hi there,

it seems that my kernel sources have been unmerged (somehow). I need to set an additional option in my kernel, i.e., to recompile with this option. But for this i need the sources.
I do not want to get a newer kernel-version an set all the options again. How do i get exactly the sources for my kernel linux-3.18.7-gentoo
and use all my setting from my current kernel ? Is there an easy possibility which i oversee simply?

Thanks for any help!
Back to top
View user's profile Send private message
EmaRsk
Apprentice
Apprentice


Joined: 07 Sep 2004
Posts: 158
Location: Italy

PostPosted: Sat Apr 18, 2015 8:35 am    Post subject: Reply with quote

For getting back your options, you need the .config file that you used. If you didn't save it somewhere, you can check if you have it in /proc/config.gz (there's an option in the kernel to have it generated automatically).
But even when depcleaning, portage doesn't delete the kernel folder if there's a .config file in it, if it's gone you must have done something else.
Back to top
View user's profile Send private message
Mati
Apprentice
Apprentice


Joined: 02 Sep 2008
Posts: 172

PostPosted: Sat Apr 18, 2015 9:01 am    Post subject: Reply with quote

Hi,

there is the .config file with my settings yes. Can you pinpoint me to the workflow i should now start? Just download the sources from somewhere? But how do i get exactly the sources to my kernel-version?

Thanks
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Sat Apr 18, 2015 9:04 am    Post subject: Reply with quote

Do you have a local overlay?

If so, just go here

https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/

and find the ebuild for your kernel and put it in your local overlay, then you can unmask it or whatever and re-emerge it. Voila!


As said before, you'll need to copy (and decompress) /proc/config.gz to .config in your kernel sources directory or you'll have to set all the options again!
Back to top
View user's profile Send private message
Mati
Apprentice
Apprentice


Joined: 02 Sep 2008
Posts: 172

PostPosted: Sat Apr 18, 2015 9:30 am    Post subject: Reply with quote

ehm, sorry, but what is a local overlay?
Back to top
View user's profile Send private message
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 225

PostPosted: Sat Apr 18, 2015 9:52 am    Post subject: Reply with quote

Local overlay is your own repository, runing on your pc. There's wiki page on setting up a local overlay.
Back to top
View user's profile Send private message
Mati
Apprentice
Apprentice


Joined: 02 Sep 2008
Posts: 172

PostPosted: Sat Apr 18, 2015 9:59 am    Post subject: Reply with quote

Thanks, so my directory under /usr/scr/linux looks likes this:

Code:

-rw-r--r--  1 root root   440625  8. Mär 12:27 Module.symvers
-rw-r--r--  1 root root  2778885  8. Mär 12:27 System.map
drwxr-xr-x  4 root root       27 16. Apr 17:40 arch
drwxr-xr-x  3 root root     4096 16. Apr 17:39 block
drwxr-xr-x  2 root root     8192 16. Apr 17:40 crypto
drwxr-xr-x 60 root root     4096 16. Apr 17:40 drivers
drwxr-xr-x  4 root root      110 16. Apr 17:40 firmware
drwxr-xr-x 27 root root     8192 16. Apr 17:40 fs
drwxr-xr-x  4 root root       35 16. Apr 17:40 include
drwxr-xr-x  2 root root     4096 16. Apr 17:39 init
drwxr-xr-x  2 root root     4096 16. Apr 17:39 ipc
drwxr-xr-x 12 root root     8192 16. Apr 17:40 kernel
drwxr-xr-x  7 root root    12288 16. Apr 17:40 lib
lrwxrwxrwx  1 root root       28  9. Mär 21:13 linux-3.18.7-gentoo -> /usr/src/linux-3.18.7-gentoo
drwxr-xr-x  2 root root     8192 16. Apr 17:39 mm
-rw-r--r--  1 root root     9963  8. Mär 12:27 modules.builtin
-rw-r--r--  1 root root      689  8. Mär 12:27 modules.order
drwxr-xr-x 19 root root     4096 16. Apr 17:40 net
drwxr-xr-x  6 root root     4096 16. Apr 17:40 scripts
drwxr-xr-x  5 root root     4096 16. Apr 17:40 security
drwxr-xr-x 20 root root     4096 16. Apr 17:40 sound
drwxr-xr-x  2 root root     4096 16. Apr 17:39 usr
-rwxr-xr-x  1 root root 29781173  8. Mär 12:27 vmlinux
-rw-r--r--  1 root root 33818506  8. Mär 12:27 vmlinux.o



can you please tell me whether this is an local overlay?
i suppose the matter that i do not have a genkernel means that i have a local overlay and can just go to download the ebuild?
Back to top
View user's profile Send private message
EmaRsk
Apprentice
Apprentice


Joined: 07 Sep 2004
Posts: 158
Location: Italy

PostPosted: Sat Apr 18, 2015 10:19 am    Post subject: Reply with quote

First, about the overlay and stuff like that: does it need to be so complicated? Do you need to match the exact version? Why don't you just emerge the kernel sources again, copy your .config in there, and configure and build it normally?

Second, you have a /usr/src/linux/linux-3.18.7-gentoo pointing to /usr/src/linux-3.18.7-gentoo. This is messed up.
You should have /usr/src/linux -> /usr/src/linux-3.18.7-gentoo or whatever kernel you're building.
Note that the symlink is not needed to build the kernel, it's just there for convenience, and some software use it for some checks.
Back to top
View user's profile Send private message
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 225

PostPosted: Sat Apr 18, 2015 10:50 am    Post subject: Reply with quote

Mati,

That is the kernel source tree. If you're fine with that version, just copy your config in the tree and build the kernel (and forget about overlays, at least for now). In case you need a specific version of the kernel, first check if that version is in portage tree. If it is, emerge that version. if it is not, you'll have to deal with local overlay.
Back to top
View user's profile Send private message
EmaRsk
Apprentice
Apprentice


Joined: 07 Sep 2004
Posts: 158
Location: Italy

PostPosted: Sat Apr 18, 2015 11:08 am    Post subject: Reply with quote

bstaletic, that looks like what's left of the kernel tree after an unmerge: I don't see the README and other usual files in the ls posted. The unmerge operation deletes the sources, leaving everything created by the configuration/building process.
Back to top
View user's profile Send private message
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 225

PostPosted: Sat Apr 18, 2015 11:36 am    Post subject: Reply with quote

Mati,

Do you care about kernel version? Also remove the symlink for now.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43425
Location: 56N 3W

PostPosted: Sat Apr 18, 2015 2:26 pm    Post subject: Reply with quote

Mati,

You can emerge =gentoo-sources-<ver> if the ebuild is still in the tree or you can upgarde the kernel using you existing .config as a starting point.
You don't neet to set all the options again.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Mati
Apprentice
Apprentice


Joined: 02 Sep 2008
Posts: 172

PostPosted: Sun Apr 19, 2015 7:55 am    Post subject: Reply with quote

Thanks for your great help so far.

The above output is from /usr/src/linux. Under /usr/src/ i have:

Code:

lrwxrwxrwx  1 root root   19  9. Mär 21:13 linux -> linux-3.18.7-gentoo
drwxr-xr-x 20 root root 4096 10. Aug 2014  linux-3.12.21-gentoo-r1
drwxr-xr-x 24 root root 4096 15. Apr 11:27 linux-3.18.11-gentoo
drwxr-xr-x 20 root root 4096 18. Apr 10:08 linux-3.18.7-gentoo


so i suppose this is correct, i.e., i can delete the symlink inside /usr/src/linux pointing to itself right?
Back to top
View user's profile Send private message
EmaRsk
Apprentice
Apprentice


Joined: 07 Sep 2004
Posts: 158
Location: Italy

PostPosted: Sun Apr 19, 2015 8:03 am    Post subject: Reply with quote

Yes, you can remove the offending symlink, but I suspect the folder should be removed entirely.
Can you post the output of eselect kernel list please?
Back to top
View user's profile Send private message
Mati
Apprentice
Apprentice


Joined: 02 Sep 2008
Posts: 172

PostPosted: Sun Apr 19, 2015 8:50 am    Post subject: Reply with quote

I installed the newest kernel sources, copied the config file, set my additional option, compiled the kernel and copied it under boot. Additionally i ran grub2-mkconfig.

However, the new kernel starts, but my UI (KDE+login manager) is not coming up as in my old kernel - i'm getting a black screen with blinking curser at the top left. Any hints?
Could some .profile be the reason or something? Or some bashrc ?

Code:
Available kernel symlink targets:
  [1]   linux-3.18.11-gentoo *


Thanks again!
Back to top
View user's profile Send private message
EmaRsk
Apprentice
Apprentice


Joined: 07 Sep 2004
Posts: 158
Location: Italy

PostPosted: Sun Apr 19, 2015 9:37 am    Post subject: Reply with quote

As eselect shows, the only kernel source you have installed is linux-3.18.11-gentoo.
This means that in the /usr/scr/linux-3.12.21-gentoo-r1 and /usr/src/linux-3.18.7-gentoo you don't have the full sources, but only the files generated by the building process (and that emerge doesn't remove when unmerging).
You already copied .config into the new tree, so you can remove those folders.
If you didn't enable /proc/config.gz, I suggest you also copy .config to /boot/config-3.18.11-gentoo, so if you remove the kernel tree by mistake you don't lose your precious configuration.

About the black screen issue, maybe you need to recompile the drivers for your video card against the new kernel?
Check if /var/log/Xorg.0.log gives some info.
Back to top
View user's profile Send private message
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 225

PostPosted: Sun Apr 19, 2015 9:50 am    Post subject: Reply with quote

Black screen issue need more detail. Are you able to log into tty? Or are you completely locked out? What video card driver do you use?
Back to top
View user's profile Send private message
Mati
Apprentice
Apprentice


Joined: 02 Sep 2008
Posts: 172

PostPosted: Sun Apr 19, 2015 7:27 pm    Post subject: Reply with quote

I'm using nvidia drivers. l cannot login, all i do is hitting strg+alt + backspace in order to reboot.

Code:

[    13.483]
X.Org X Server 1.16.4
Release Date: 2014-12-20
[    13.483] X Protocol Version 11, Revision 0
[    13.483] Build Operating System: Linux 3.12.21-gentoo-r1 i686 Gentoo
[    13.483] Current Operating System: Linux gentoo 3.18.7-gentoo #1 SMP Sun Mar 8 12:27:18 CET 2015 i686
[    13.483] Kernel command line: BOOT_IMAGE=/boot/kernel-3.18.7-gentoo root=/dev/sda14 ro
[    13.483] Build Date: 07 March 2015  07:55:55PM
[    13.483]
[    13.483] Current version of pixman: 0.32.6
[    13.483]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[    13.483] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    13.483] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Apr 19 19:50:10 2015
[    13.534] (==) Using config file: "/etc/X11/xorg.conf"
[    13.534] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    13.568] (==) ServerLayout "Layout0"
[    13.568] (**) |-->Screen "Screen0" (0)
[    13.568] (**) |   |-->Monitor "Monitor0"
[    13.579] (**) |   |-->Device "Device0"
[    13.579] (**) |-->Input Device "Keyboard0"
[    13.579] (**) |-->Input Device "Mouse0"
[    13.579] (==) Automatically adding devices
[    13.579] (==) Automatically enabling devices
[    13.579] (==) Automatically adding GPU devices
[    13.579] (WW) The directory "/usr/share/fonts/misc/" does not exist.
[    13.579]    Entry deleted from font path.
[    13.579] (WW) The directory "/usr/share/fonts/TTF/" does not exist.
[    13.579]    Entry deleted from font path.
[    13.579] (WW) The directory "/usr/share/fonts/OTF/" does not exist.
[    13.579]    Entry deleted from font path.
[    13.579] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
[    13.579]    Entry deleted from font path.
[    13.579] (WW) The directory "/usr/share/fonts/100dpi/" does not exist.
[    13.579]    Entry deleted from font path.
[    13.579] (WW) The directory "/usr/share/fonts/75dpi/" does not exist.
[    13.579]    Entry deleted from font path.
[    13.579] (==) FontPath set to:
 13.579] (==) ModulePath set to "/usr/lib/xorg/modules"
[    13.579] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[    13.579] (WW) Disabling Keyboard0
[    13.579] (WW) Disabling Mouse0
[    13.579] (II) Loader magic: 0x8266660
[    13.579] (II) Module ABI versions:
[    13.579]    X.Org ANSI C Emulation: 0.4
[    13.579]    X.Org Video Driver: 18.0
[    13.579]    X.Org XInput driver : 21.0
[    13.579]    X.Org Server Extension : 8.0
[    13.579] (II) xfree86: Adding drm device (/dev/dri/card0)
[    13.581] (--) PCI:*(0:1:0:0) 10de:0e22:3842:1370 rev 161, Mem @ 0xfc000000/33554432, 0xd0000000/134217728, 0xd8000000/67108864, I/O @ 0x00008c00/128, BIOS @ 0x????????/524288
[    13.581] (II) LoadModule: "glx"
[    13.622] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    13.979] (II) Module glx: vendor="X.Org Foundation"
[    13.979]    compiled for 1.16.4, module version = 1.0.0
[    13.979]    ABI class: X.Org Server Extension, version 8.0
[    13.979] (==) AIGLX enabled
[    13.979] (II) LoadModule: "nvidia"
[    14.059] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
[    14.147] (II) Module nvidia: vendor="NVIDIA Corporation"
[    14.147]    compiled for 4.0.2, module version = 1.0.0
[    14.147]    Module class: X.Org Video Driver
[    14.168] (II) NVIDIA dlloader X Driver  346.59  Tue Mar 31 13:19:42 PDT 2015
[    14.168] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[    14.168] (++) using VT number 7

[    14.189] (II) Loading sub module "fb"
[    14.189] (II) LoadModule: "fb"
[    14.189] (II) Loading /usr/lib/xorg/modules/libfb.so
[    14.201] (II) Module fb: vendor="X.Org Foundation"
[    14.201]    compiled for 1.16.4, module version = 1.0.0
[    14.201]    ABI class: X.Org ANSI C Emulation, version 0.4
[    14.201] (II) Loading sub module "wfb"
[    14.201] (II) LoadModule: "wfb"
[    14.201] (II) Loading /usr/lib/xorg/modules/libwfb.so
[    14.210] (II) Module wfb: vendor="X.Org Foundation"
[    14.210]    compiled for 1.16.4, module version = 1.0.0
[    14.210]    ABI class: X.Org ANSI C Emulation, version 0.4
[    14.210] (II) Loading sub module "ramdac"
[    14.210] (II) LoadModule: "ramdac"
[    14.210] (II) Module "ramdac" already built-in
[    14.226] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
[    14.226] (==) NVIDIA(0): RGB weight 888
[    14.226] (==) NVIDIA(0): Default visual is TrueColor
[    14.226] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[    14.265] (**) NVIDIA(0): Enabling 2D acceleration
[    14.265] (EE) NVIDIA(0): Failed to initialize the GLX module; please check in your X
[    14.265] (EE) NVIDIA(0):     log file that the GLX module has been loaded in your X
[    14.265] (EE) NVIDIA(0):     server, and that the module is the NVIDIA GLX module.  If
[    14.265] (EE) NVIDIA(0):     you continue to encounter problems, Please try
[    14.265] (EE) NVIDIA(0):     reinstalling the NVIDIA driver.
[    14.592] (II) NVIDIA(GPU-0): Found DRM driver nvidia-drm (20150116)
Back to top
View user's profile Send private message
Mati
Apprentice
Apprentice


Joined: 02 Sep 2008
Posts: 172

PostPosted: Sun Apr 19, 2015 7:36 pm    Post subject: Reply with quote

Hi folks,

reinstalling nvidia drivers did the trick! Thanks for your great help - i really appreciate your patience!
Back to top
View user's profile Send private message
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 225

PostPosted: Sun Apr 19, 2015 7:38 pm    Post subject: Reply with quote

That;s the xorg log, which means you can get to tty. Press Ctrl+Alt+FN to get to another tty and log in without starting xorg. Unfortunately I can't help you with that xorg error, as I've always struggled with those. Though it looks to me as if you should be looking at your Xorg.conf.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum