Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Genkernel: Deriving ${KERNEL_SOURCE_DIR} failed [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 205

PostPosted: Mon Sep 29, 2014 9:58 pm    Post subject: Genkernel: Deriving ${KERNEL_SOURCE_DIR} failed [SOLVED] Reply with quote

Not sure if I should post this here or in "Portage and Programming"

I'm changing hardware out underneath my gentoo install (same processor family) and I'm having issues with genkernel.

My old kernel doesn't seem to be recognising the keyboard off the new motherboard, so I figure all I need to do is boot off a liveCD, chroot into my old system, and recompile my kernel.

So I boot, mount everything, chroot in, and run genkernel, and I get this error message:
Code:
ERROR: Deriving ${KERNEL_SOURCE_DIR} failed


What's going wrong?


Last edited by Illiander on Sun Oct 05, 2014 4:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Mon Sep 29, 2014 11:08 pm    Post subject: Reply with quote

from chroot:
Code:
eselect kernel list
ls -l /usr/src

is /usr/src/linux symlink present and valid?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 205

PostPosted: Tue Sep 30, 2014 7:37 am    Post subject: Reply with quote

kernel 3.14.14 is installed and selected.
ls -l crashes me out of the chroot with the message "Illegal Instruction", but running the same test from the un-chrooted environment shows that the link is pointing in the right place.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Tue Sep 30, 2014 9:25 am    Post subject: Reply with quote

did you switch from amd => intel or intel => amd?

it may help when you post your old make.conf before changing your cpus and post new and old cpu here.

you may have a newer cpu which does not support the instructions of the previous cpu.

if you only want to build a kernel, you could build it anywhere and move it to the boot partition. you do notneed to build it in the gentoo chroot at all. you may also take the kernel from the livecd and boot from it into your chroot (that should be possible too)..
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 205

PostPosted: Tue Sep 30, 2014 10:07 am    Post subject: Reply with quote

Both machines are AMD.
The new machine may actually be older hardware (my previous hardware died, this is a patchwork rig to keep me going until the proper replacement finds it's way through the mail in a few weeks)

Old Machine: AMD Phenom II (x6)

New Machine: AMD Athlon 64 (x2)

old make.conf:
Code:
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
#CFLAGS="-O2 -march=native"
CFLAGS="-O2 -pipe -march=native"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
USE="-kde -qt4 mmx sse sse2 X a52 aac aalib acl acpi aim alsa apache2 apm atm audiofile bash-completion bidi bindist bluetooth bzip cairo canna caps cdda cddb cdinstall cdparanoia cdr cjk cgi crypt css ctype cups cvs cxx dbus dbx dga djvu dri dv dvb dvd dvdr emacs encode enscript esd evo examples exif expat fbcon ffmpeg flac flatfile fltk freetds freewnn fontconfig ftp gcj gd gdbm geoip gif gimp glut glib -gnome gnome-keyring gnuplot gps gsm gstreamer gtk gtkhtml hal hardened hddtemp icq idn ieee1394 imagemagic imap ipv6 jabber java java6 javascript jingle joystick jpeg jpeg2k kerberos lame latex ldap libwww lirc lm_sensors lua lzo mate mad mailwrapper matroska matrox migemo mikimod mime mmap mng -mono mp3 mp4 mpeg msn mtp mule multilib musepack musicbrainz mysql mysqli nas ncurses nntp nocd nsplugin offensive ogg openal openexr opengl openmp oscar pcre pdf perl php png portaudio python qmail-spp raw readline rss ruby samba sasl scanner sdl seamonkey firefox sharedext sharedmem shorten simplexml smp sockets socks5 source sox speex spell ssl startup-notification subversion svg svga symlink tcl tcpd theora tiff tokenizer truetype unicode usb v4l v4l2 vcd videos vorbis wavpack win32codecs wmf wxwidgets xine libdvdread libdvdcss xinerama xml xosd xmp xscreensaver xv xvid yahoo zeroconf zlib zsh-completion quicktime real gif jpeg mpeg matroska xanim png tiff svg a52 aac exif mp3 ogg vorbis theora xpm wmf win32codecs x264 flac postscript xvid mad mp2 divx encode apache2 php mysql unicode ssl crypt ctype pcre session pulseaudio -systemd"
#MAKEOPTS="-j1"
MAKEOPTS="-j4"

GENTOO_MIRRORS="rsync://ftp.df.lth.se/pub/gentoo/ ftp://gd.tuwien.ac.at/opsys/linux/gentoo/ rsync://de-mirror.org/gentoo/"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"

INSTALL_MASK="${INSTALL_MASK} /usr/lib/systemd"

VIDEO_CARDS="nvidia noveau vesa"
INPUT_DEVICES="evdev keyboard mouse"

ACCEPT_LICENSE="* -@EULA NVIDIA"

# If you have >=app-portage/layman-1.3.0
source "/var/lib/layman/make.conf"

# Set PORTDIR for backward compatibility with various tools:
#   gentoo-bashcomp - bug #478444
#   euse - bug #474574
#   euses and ufed - bug #478318
PORTDIR="/usr/portage"

FEATURES="splitdebug"

source /var/lib/layman/make.conf


Edit:
I also tried going through the steps for manually building a kernel, and "make oldconfig" also drops me out of the chroot with an "Illegal instruction" message

Edit2:
Or I could try working this through from another direction: When I try to run my system now, I get the following errors at the end of the boot process (plus some about alsactrl not finding stuff farther up, but they scroll off the top of my screen too fast to make out much more than that):
Code:
 * Starting local
INIT: Id "c6" respawning too fast: disabled for 5 minutes
INIT: Id "c1" respawning too fast: disabled for 5 minutes
INIT: Id "c2" respawning too fast: disabled for 5 minutes
INIT: Id "c3" respawning too fast: disabled for 5 minutes
INIT: Id "c5" respawning too fast: disabled for 5 minutes
INIT: Id "c4" respawning too fast: disabled for 5 minutes
INIT: no more processes left in this runlevel

I'm currently assuming that this is because I was on a 6-core machine, and now I'm on a 2-core machine. But if there's something else going on, I'm all ears.
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 205

PostPosted: Wed Oct 01, 2014 11:17 am    Post subject: Reply with quote

And I tried building kernels from the liveCD, both 3.14.14 (what I was running) and the one on the livecd (2.something).

Neither of those work either.
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 205

PostPosted: Wed Oct 01, 2014 4:11 pm    Post subject: Reply with quote

On the liveCD, -nofb kernels shouldn't start kdm, right?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Wed Oct 01, 2014 5:31 pm    Post subject: Reply with quote

"illegal instruction" means you are telling the cpu to do something it cannot do. Appears that code compiled for a Phenom II is attempting to execute on an Athlon X64

Quote:
* Starting local
INIT: Id "c6" respawning too fast: disabled for 5 minutes
INIT: Id "c1" respawning too fast: disabled for 5 minutes
INIT: Id "c2" respawning too fast: disabled for 5 minutes
INIT: Id "c3" respawning too fast: disabled for 5 minutes
INIT: Id "c5" respawning too fast: disabled for 5 minutes
INIT: Id "c4" respawning too fast: disabled for 5 minutes
INIT: no more processes left in this runlevel
is probably occurring because the handbook says
Quote:
If you need serial console access (which is possible in case of remote servers), you might need to uncomment the serial console section in /etc/inittab if it has not been done already automatically.

Code Listing 4.2: Editing /etc/inittab
# nano -w /etc/inittab
The following excerpt shows the uncommented section:

Code Listing 4.3: Uncommenting serial consoles in inittab
# SERIAL CONSOLES
s0:12345:respawn:/sbin/agetty 9600 ttyS0 vt100
s1:12345:respawn:/sbin/agetty 9600 ttyS1 vt100
and it seemed like a good idea
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 205

PostPosted: Fri Oct 03, 2014 6:40 am    Post subject: Reply with quote

ok, so portage isn't likeing the older processor either (I tried rebuilding GCC in prep for rebuilding @system, and it hung before calling gcc) So I guess I'm going to be rebuilding from a stage3 tarball.

What files do you recommend I grab before overwriting the drive, and would you recomend overwriting or wiping and starting over?

Files I've already grabbed: make.conf, world, and my portage overrides folder ( /etc/portage/package.* )
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Fri Oct 03, 2014 7:01 am    Post subject: Reply with quote

get /home also

the easier way to avoid losing something you may want is described by Neddy Seagoon here: https://forums.gentoo.org/viewtopic-p-7601832.html#7601832

basically a chroot with a stage 3 and portage with a binpkg directory populated by using quickpkg then use the binpkg directory with the old install to rebuild system
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 205

PostPosted: Fri Oct 03, 2014 8:01 am    Post subject: Reply with quote

/home is on a seperate hdd that I'm not mounting until I have a working system. (I've done that for as long as I can remember, makes things *so* much safer)

Thanks for that link, that looks like exactly what I was asking for.
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 205

PostPosted: Fri Oct 03, 2014 3:57 pm    Post subject: Reply with quote

ok, that seems to have gotten me farther, or it's not working at all (not sure which)

emerge -k portage and gcc seem to work, but glibc is complaining about nonfatal() not existing at the EAPI level being used (*after* the emerge -k portage and gcc goes through)

And trying to emerge glibc with the binary gcc and portage crashes out complaining about "configure: error: linker with -z relro support required" which doesn't show up anything useful with google.

Also, after rebuilding nano in the rescue chroot, quickpkg-ing it, and installing the binary to my main system, it's still crashing out with an "Illegal Instruction" message, but *only* in /mnt/gentoo, not /mnt/gentoo/home/rescue. ("gcc --help" is doing the same, which is tending me towards the "not done anything at all" side)


What am I missing here?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Fri Oct 03, 2014 4:56 pm    Post subject: Reply with quote

Dependencies still have phenom instructions.
I would revert to profile 1 (if I could), quickpackage world, emerge -e --usepkg system, emerge -e --usepkg world
then increment back to the desired profile.
when frustration tolerance level is reached revert to plan a.

this has to be at least as annoying as trying to update a couple of year old system (in fact updating old may be complicating the problem).
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 205

PostPosted: Sat Oct 04, 2014 10:59 am    Post subject: Reply with quote

Frustration tolerence has definitely been reached. root wiped and starting a fresh install.

How robust is portage in handling the world file? (Will I need to do a manual merge of everything, or can I just dump my old one at the end of the new one and "emerge @world" will handle everything? (I might do a manual merge anyway, it's as good a time as any to clean it up, but it would be good to know))

---

Please tell me that newer processors are backwards compatible, so I don't need to do this all again in a couple of weeks.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Sat Oct 04, 2014 3:18 pm    Post subject: Reply with quote

just gut feeling, but I'd favor diff or meld world file versus backup world file, try to segregate accidental world packages (should have used emerge -1 but didn't), and then manual emerge.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 205

PostPosted: Sun Oct 05, 2014 4:37 pm    Post subject: Reply with quote

ok, that's me back up and running on the temp machine. I ended up doing a manual merge, this was my first gentoo install (lasted me ~5 years before the hardware died), and I forgot the --oneshot flag a *lot* early on., so most of my world file was extrainious.

Thank you everyone for all the help, it was very much appreciated.

Advice for anyone else finding this thread and needing to move to an older processor: Just grab world, package.* make.conf, /home and anything else you need, and rebuild everything from a stage3 tarball. It will save you a lot of time and frustration.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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