LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-27-2017, 08:43 PM   #1
tecbox
LQ Newbie
 
Registered: Mar 2010
Posts: 4

Rep: Reputation: 0
Recompile kernel


I am a newbie to Linux and I recently installed Linux from DVD. I am trying to make a change to a kernel setting and recompile the kernel for it to take effect.

Code:
[root@vm1 4.1.12-61.1.18.el7uek.x86_64]# uname -r
4.1.12-61.1.18.el7uek.x86_64

[root@vm1 4.1.12-61.1.18.el7uek.x86_64]# rpm -qa | grep kernel
kernel-headers-3.10.0-514.el7.x86_64
abrt-addon-kerneloops-2.1.11-45.0.1.el7.x86_64
kernel-devel-3.10.0-514.el7.x86_64
kernel-tools-libs-3.10.0-514.el7.x86_64
kernel-3.10.0-514.el7.x86_64
kernel-uek-firmware-4.1.12-61.1.18.el7uek.noarch
kernel-tools-3.10.0-514.el7.x86_64
kernel-uek-4.1.12-61.1.18.el7uek.x86_64
kernel-uek-devel-4.1.12-61.1.18.el7uek.x86_64
After running 'make menuconfig' and made the change to the setting I saved the .config file. I then ran the 'make' command from the kernel source directory '/usr/src/kernels/4.1.12-61.1.18.el7uek.x86_64'. This resulted in the following error:

Code:
[root@vm1 4.1.12-61.1.18.el7uek.x86_64]# make
  HOSTCC  scripts/kconfig/conf.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
make[1]: *** No rule to make target `arch/x86/syscalls/syscall_32.tbl', needed by `arch/x86/syscalls/../include/generated/asm/syscalls_32.h'.  Stop.
make: *** [archheaders] Error 2
From the searching I've done on this error, it seems that I need the source for my existing kernel. Is the source for my existing kernel additional files that I need to download above and beyond the files that already exist in my source directory (/usr/src/kernels/4.1.12-61.1.18.el7uek.x86_64)?

Thanks.
 
Old 08-28-2017, 12:44 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,204
Blog Entries: 1

Rep: Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059
Hi,

You didn't say your distro, but from the kernel packages names, I assume you're running an RHEL7 based.
If that's the case, take a look here (especially part 2)

Regards
 
Old 08-28-2017, 01:15 AM   #3
Gugulana
LQ Newbie
 
Registered: Aug 2017
Posts: 2

Rep: Reputation: Disabled
Wow! Is recompiling kernel a newbie question around here? I am waaayy behind.
 
Old 08-28-2017, 08:40 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,864
Blog Entries: 4

Rep: Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995
If you are using a kernel from a distro which supplies that kernel in binary form, I do not recommend recompiling it. The distro distributor has carefully prepared "everything, just so," and if you change kernel settings you're throwing in quite a wild-card. Yeah, they're supposed to have provided you with exactly the kernel-config that they used in their build, but . . .

= = = = =

Yes, Gugulana, sometimes a "newbie" around this forum is "a newbie to Linux" who has decades of experience with computers and with (other) operating systems. I certainly remember that, when I first started getting-to-know Linux, I felt like a even though at that point I had more than 15 years' experience with computers and had even worked on major source-code modifications to IBM's VM/SP and VM/XA operating systems. I had also studied the source-code to the MPE-IV operating system for the HP-3000 minicomputer. For a while (and sometimes, still ...) Linux made me feel like a fool. An operating system can make a fool of anyone.

Last edited by sundialsvcs; 08-28-2017 at 08:45 AM.
 
Old 08-28-2017, 08:47 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,894
Blog Entries: 13

Rep: Reputation: 4945Reputation: 4945Reputation: 4945Reputation: 4945Reputation: 4945Reputation: 4945Reputation: 4945Reputation: 4945Reputation: 4945Reputation: 4945Reputation: 4945
I think you need to inform us what Linux distribution you are building the kernel for. And if you are following any instructions for compiling that distributions kernel, or if you obtained kernel source from somewhere else, which is not recommended.

Yes, per your comment. You do need the source for your existing kernel. This would be the correct choice. Please respond with the distribution and version you currently have.
 
Old 08-28-2017, 02:13 PM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,864
Blog Entries: 4

Rep: Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995
Quote:
Originally Posted by rtmistler View Post
Yes, per your comment. You do need the source for your existing kernel. This would be the correct choice. Please respond with the distribution and version you currently have.
Distros will distribute their "kernel source code" as an optional package.

Carefully consult the official documentation provided by the distro – such as this document for Ubuntu – before undertaking such a project on your system.

Be sure to make a carefully-labeled copy of the hidden .config file, before and after your custom modifications, so that you can re-create them at any time, and also so that you can diff them to objectively determine what the differences are. ("What t'hell did I just do? ... ... oh, that's easy, let me see. ") You can also use this technique to express your custom changes as a patch which can be applied to future configurations to re-apply your changes automagically.

Be aware also that the command, make distclean, will wipe out(!) that hidden file ... so you'd better have saved a copy first!
 
Old 08-28-2017, 06:01 PM   #7
tecbox
LQ Newbie
 
Registered: Mar 2010
Posts: 4

Original Poster
Rep: Reputation: 0
I apologize, the distro is Oracle Enterprise Linux 7.3 based on Red Hat Enterprise Linux Server release 7.3 (Maipo).

The DVD I installed from is only 4.5GB in size, but they also have available a source DVD (2 DVDs) available that total approximately 6.9GB in size.

I have a problem with a video card logging a TON of information to /var/log/messages and one of the suggestions was to deactivate CONFIG_FENCE_TRACE setting in the kernel.

I'm looking to simply change this setting and didn't want to have to load 6.9GB of DVD's if it wasn't necessary.

Yes, per your comment. You do need the source for your existing kernel. This would be the correct choice. Please respond with the distribution and version you currently have.

Quote:
Originally Posted by rtmistler View Post
Yes, per your comment. You do need the source for your existing kernel. This would be the correct choice. Please respond with the distribution and version you currently have.
So, with this in mind, would I have to load the source DVD's to the /usr/src/kernels directory? If so, what are the files that already exist in the /usr/src/kernels directory used for (the ones that got put there when I installed Linux)?
 
Old 08-28-2017, 11:13 PM   #8
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
The kernel source is one rpm file. Then, you need a few build packages. You have to set-up the build tree. Install the kernel source rpm. You can follow the instructions for Fedora. https://fedoraproject.org/wiki/Building_a_custom_kernel
 
Old 08-29-2017, 03:22 AM   #9
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875
Various routes to build a kernel, but mostly the .config needs to be at least close to what works from your current distro. So various routes to do that.

$ cp /boot/config .config

or

$ zcat /proc/config.gz > .config
(or was it konfig.gz?)

and then

$ make oldconfig

press enter a lot for the options that are new and not covered by the old config.

Various ways to track down the option that triggers the error and disable it. But in theory the distros .config with the -headers- and -dev things for their kernel should "compile" with little fuss. I guess it depends on "WHY" you feel you need to compile a kernel in the first place. For "modules" (drivers) you can most times compile those against the distros kernel. YMMV
 
Old 08-29-2017, 07:02 AM   #10
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,864
Blog Entries: 4

Rep: Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995
When I build a kernel, I want to be certain that everything gets recompiled. For this reason, I set-aside the configuration file (by renaming it), do make distclean, rename the config file back, and proceed with the recommended make sequence.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel Panic in 64bit Arch Linux after Kernel Recompile: 2.6.35-rc3 jackerybakery Linux - General 3 06-16-2010 10:21 AM
Kernel recompile, LILO warning and Kernel-panic Tux-Slack Slackware 26 02-26-2008 05:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration