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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-27-2017, 08:43 PM
|
#1
|
LQ Newbie
Registered: Mar 2010
Posts: 4
Rep:
|
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.
|
|
|
08-28-2017, 12:44 AM
|
#2
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,204
|
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
|
|
|
08-28-2017, 01:15 AM
|
#3
|
LQ Newbie
Registered: Aug 2017
Posts: 2
Rep:
|
Wow! Is recompiling kernel a newbie question around here? I am waaayy behind.
|
|
|
08-28-2017, 08:40 AM
|
#4
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,864
|
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.
|
|
|
08-28-2017, 08:47 AM
|
#5
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,894
|
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.
|
|
|
08-28-2017, 02:13 PM
|
#6
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,864
|
Quote:
Originally Posted by rtmistler
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!
|
|
|
08-28-2017, 06:01 PM
|
#7
|
LQ Newbie
Registered: Mar 2010
Posts: 4
Original Poster
Rep:
|
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
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)?
|
|
|
08-28-2017, 11:13 PM
|
#8
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
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
|
|
|
08-29-2017, 03:22 AM
|
#9
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
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
|
|
|
08-29-2017, 07:02 AM
|
#10
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,864
|
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.
|
|
|
All times are GMT -5. The time now is 02:33 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|