https://www.cyberciti.biz/tips/compiling-linux-kernel-26.html
last updated November 30, 2019 in CategoriesCentOS, Debian Linux, GNU/Open source, Howto, Linux
Compiling a custom kernel has its advantages and disadvantages. However, new Linux user/admin find it difficult to compile Linux kernel. Compiling kernel needs to understand few things and then type a couple of commands. This step by step howto covers compiling Linux kernel version 5.4.1 under an Ubuntu or Debian Linux. The following instructions successfully tested on an RHEL 7/CentOS 7 (and clones), Debian Linux, Ubuntu Linux and Fedora Linux 28/29. However, instructions remain the same for any other Linux distribution.
The procedure to build (compile) and install the latest Linux kernel from source is as follows:
Let us see all steps in details.
Visit the official project site and download the latest source code. Click on the big yellow button that read as “Latest Stable Kernel“:
The filename would be linux-x.y.z.tar.xz, where x.y.z is actual Linux kernel version number. For example file linux-5.4.1.tar.xz represents Linux kernel version 5.4.1. Use the wget command to download Linux kernel source code:$ wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.4.1.tar.xz
You really don’t have to extract the source code in /usr/src. You can extract the source code in your $HOME directory or any other directory using the following unzx command or xz command:$ unxz -v linux-5.4.1.tar.xz
OR$ xz -d -v linux-5.4.1.tar.xz
First grab the PGP signature for linux-5.4.1.tar:$ wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.4.1.tar.sign
Try to verify it:$ gpg --verify linux-5.4.1.tar.sign
Sample outputs:
gpg: assuming signed data in 'linux-5.4.1.tar' gpg: Signature made Sun 12 Aug 2018 04:00:28 PM CDT gpg: using RSA key 79BE3E4300411886 gpg: Can't check signature: No public key
Grab the public key from the PGP keyserver in order to verify the signature i.e. RSA key ID 79BE3E4300411886 (from the above outputs):$ gpg --recv-keys 79BE3E4300411886
Sample outputs:
gpg: key 79BE3E4300411886: 7 duplicate signatures removed gpg: key 79BE3E4300411886: 172 signatures not checked due to missing keys gpg: /home/vivek/.gnupg/trustdb.gpg: trustdb created gpg: key 79BE3E4300411886: public key "Linus Torvalds |
Now verify gpg key again with the gpg command:$ gpg --verify linux-5.4.1.tar.sign
Sample outputs:
gpg: assuming signed data in 'linux-5.4.1.tar' gpg: Signature made Sun 12 Aug 2018 04:00:28 PM CDT gpg: using RSA key 79BE3E4300411886 gpg: Good signature from "Linus Torvalds |
If you do not get “BAD signature” output from the “gpg –verify” command, untar/extract the Linux kernel tarball using the tar command, enter:$ tar xvf linux-5.4.1.tar
Before start building the kernel, one must configure Linux kernel features. You must also specify which kernel modules (drivers) needed for your system. The task can be overwhelming for a new user. I suggest that you copy existing config file using the cp command:$ cd linux-5.4.1
$ cp -v /boot/config-$(uname -r) .config
Sample outputs:
'/boot/config-4.15.0-30-generic' -> '.config'
You must have development tools such as GCC compilers and related tools installed to compile the Linux kernel.
Type the following apt command or apt-get command to install the same:$ sudo apt-get install build-essential libncurses-dev bison flex libssl-dev libelf-dev
See “Ubuntu Linux Install GNU GCC Compiler and Development Environment” for more info.
Try yum command:$ sudo yum group install "Development Tools"
OR$ sudo yum groupinstall "Development Tools"
Additional packages too:$ sudo yum install ncurses-devel bison flex elfutils-libelf-devel openssl-devel
Run the following dnf command:$ sudo dnf group install "Development Tools"
$ sudo dnf install ncurses-devel bison flex elfutils-libelf-devel openssl-devel
Now you can start the kernel configuration by typing any one of the following command in source code directory:
For example, run make menuconfig command launches following screen:$ make menuconfig
You have to select different options as per your need. Each configuration option has HELP button associated with it so select help button to get help. Please note that ‘make menuconfig’ is optional. I used it here to demonstration purpose only. You can enable or disable certain features or kernel driver with this option. It is easy to remove support for a device driver or option and end up with a broken kernel. For example, if the ext4 driver is removed from the kernel configuration file, a system may not boot. When in doubt, just leave support in the kernel.
Start compiling and tocreate a compressed kernel image, enter:$ make
To speed up compile time, pass the -j as follows:## use 4 core/thread ##
$ make -j 4
## get thread or cpu core count using nproc command ##
$ make -j $(nproc)
Compiling and building the Linux kernel going take a significant amount of time. The build time depends upon your system’s resources such as available CPU core and the current system load. So have some patience.
$ sudo make modules_install
So far we have compiled the Linux kernel and installed kernel modules. It is time to install the kernel itself:$ sudo make install
It will install three files into /boot directory as well as modification to your kernel grub configuration file:
You need to modify Grub 2 boot loader configurations. Type the following command at a shell prompt as per your Linux distro:
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
$ sudo grubby --set-default /boot/vmlinuz-5.4.1
You can confirm the details with the following commands:grubby --info=ALL | more
grubby --default-index
grubby --default-kernel
The following commands are optional as make install does everything for your but included here for historical reasons only:$ sudo update-initramfs -c -k 5.4.1
$ sudo update-grub
You have compiled a Linux kernel. The process takes some time, however now you have a custom Linux kernel for your system. Let us reboot the system.
Just issue the reboot command or shutdown command:# reboot
Verify new Linux kernel version after reboot:$ uname -mrs
Sample outputs:
Linux 5.4.1 x86_64
Configurations! You completed various steps to build the Linux kernel from source code and compiled kernel should be running on your system. I strongly suggest that you always keep backup of essential data and visit the kernel.org page here for more info.
SHARE ON Facebook Twitter
The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft takes a lot of my time and hard work to produce. If everyone who reads nixCraft, who likes it, helps fund it, my future would be more secure. You can donate as little as $1 to support nixCraft:
Become a Supporter Make a contribution via Paypal/Bitcoin
Historical Comment Archive
Anonymoussays:
March 7, 2006 at 1:40 am
According to the kernel documentation, the kernel should be compiled using gcc 2.95.x, with x >= 3. “apt-get install gcc” under debian gives you a recent gcc (version > 4).
Matkasays:
March 17, 2012 at 6:31 pm
http://theos.in/desktop-linux/tip-that-matters/exploring-linux-kernel/
nixcraftsays:
March 7, 2006 at 9:52 am
It works with gcc version >= 4.0.
gcc –version
gcc (GCC) 4.0.3 20060212 (prerelease) (Debian 4.0.2-9)
uname -a
Linux debian 2.6.15.4 #1 PREEMPT Fri Feb 17 20:46:04 IST 2006 i686 GNU/Linux
I have compiled above kernel using gcc 4.0.2-9. INSTALL file may be not updated.
Anonymoussays:
March 17, 2006 at 9:47 pm
Thanks a lot Gabber Anna,
It’s works for me :-))
nixcraftsays:
March 17, 2006 at 11:25 pm
LOL
Note sure who are you?
But you bring back some old memories…
Take care buddy
Learn Hackingsays:
March 25, 2007 at 7:57 am
any guess about boot loader?
debianusrsays:
August 18, 2007 at 5:57 pm
After building the kernel and updating grub I’ve rebooted the new kernel successfully. Now I am wondering if this process includes updating the kernel header files in /usr/include/. If not, what is the best way to do that and should any new directories be added to ld.so.conf so I can update glibc?
nixCraftsays:
August 18, 2007 at 6:55 pm
If you also upgraded kernel-devel and headers package you should get updates. No need to upgrade ld.so.conf or cache
Animeshsays:
October 13, 2007 at 4:59 pm
Info
—–
Kernel 2.6.23 has issues with kernel headers. If you have distro’s like fedora it gonna give up some wierd fixdep.c error messages.
Some forums say you need to have 2.4 headers for compiling it. Kernel header is a huge mess scattered around and well serious debates have gone down the drain…
http://kerneltrap.org/node/6536
Pradeepsays:
April 30, 2008 at 3:04 pm
Does this kernel support RHEL4 update 5
I am using kernel 2.6.9-55.EL can i upgade the
dushyantsays:
May 9, 2008 at 11:50 am
How much time does it take approximately?
Krishna Priya Bandyopadhyaysays:
May 15, 2008 at 6:45 pm
i am trying it on mandriva 2008.i can not do “$ make menuconfig”.is there any option to do that.please help me to get out of this as soon as possible.i wonder there is no option of “make”.
Pothikan Sureshsays:
June 4, 2008 at 8:05 am
Priya,
To make ‘make’ work, go inside the kernel directory ie., /usr/src/. There, u can find the make file. Now, just give “$make menuconfig”. It will work….
Krishna Priya Bandyopadhyaysays:
June 20, 2010 at 7:42 pm
Thanks for ur reply.I’m working fine now with the walk through given by you…
Krishba Priya bandyopadhyay
Bluessays:
June 4, 2008 at 11:28 pm
With 2.6 kernel there is no need for make modules. make builds kernel and modules. Have you ever read the README in kernel source directory?
Anil Kumar Jenasays:
June 24, 2008 at 8:38 pm
It will take near about 1 to 1.30 hours. for complete
installation
Linsays:
June 25, 2008 at 9:38 am
I tried make 2.6.25 in my desktop (FC5, kernel version 2.6.15), everything goes okay, but failed to boot the new kernel image with the follow error messages:
PCI: BIOS Bug: MCFG area at e0000000 is not E820-reserved
PCI: Not using MMCONFIG
Read Hat nash version 5.0.32 Starting
mount: error mounting /dev/root on /sysroot at ext3: No such device
….
In initrd.img file, I found no libata.ko or any other .ko modules are added before mkrootdev.
Is this problem caused by incorrect or even no HDD controller driver loaded? I did not see appropriate entry for libata in .config file. Do you guys have any suggestion on make it through?
Thanks.
-Lin
Logicsays:
July 8, 2008 at 12:22 am
About the 4th step, as the “make help” says: you do not need to do make modules again, so when using “make” it already compiles the modules.
Ramkeysays:
October 9, 2008 at 11:22 pm
Lin,
Did your problem sorted out?Thans
Rohit Awasthisays:
October 10, 2008 at 1:24 pm
Hi.. wt if somethin goes wrong… is there any way to get OS to its former stage, say ( backup or uninstall Kernel or something ).. or will need to install whole OS again…
Ravisays:
October 31, 2008 at 5:42 am
I followed the above steps in order to compile Linux kernel “linux-2.6.27” but when tried to boot my system from latest compiled kernel got the Kernel Panic error which says can’t find
file system /boot/root at the start.
please suggest
Jaredsays:
November 2, 2008 at 9:12 pm
This is a nice tutorial, but I have a note to make. On my installation, Ubuntu 8.04.1 64-bit, the command in Step # 6 is “mkinitramfs” instead of “mkinitrd”.
Can’t wait to try out my new kernel…
Abdulsays:
April 12, 2011 at 10:51 am
That helped me Thanks!!!!!!!
samesays:
November 2, 2008 at 10:45 pm
the same thing happened to me as ravi.
Romansays:
December 7, 2008 at 9:20 am
I have compiled custom kernel and I am missing in /boot directory config-2.6 file. What have I done wrong? I see config files from old kernel there. thanks in advance.
sagasays:
December 14, 2008 at 3:43 pm
you have compiled a upstream kernel.How should i compile distribution specific kernels,like if i install fedora it has its kernel source in /usr/src/, fedora community might have added its own patches.Will the steps described in this article work for distribution specific kernels?
anandsays:
December 21, 2008 at 4:06 am
Except for step where you create the initrd img file, rest of the steps explained here worked fine. The Kernel version I tried was 2.6.27.10 and the linux box had ubuntu 8.10 installed.
On ubuntu if you try to use mkinitrd you might get the message “No command found”. Try using mkinitramfs instead. It worked perfectly fine.
Makersays:
December 22, 2008 at 5:51 pm
There is no such thing as bz3.
Axonsays:
December 28, 2008 at 7:57 am
It’s cool.
Thanks alot NIXTCRAFT.
Carnessays:
December 29, 2008 at 9:53 am
I tried to cheat and copied over an older .config.. broke something and had to redo all the options by hand : /
Anyways, the instructions worked great with Gentoo. I had to emerge “mkinitrd” but otherwise everything went very quickly, maybe 20 min to compile everything (very short in Gentoo world).
I suggest everyone keep their old kernel and a lilo/grub option for it just incase Most of the problems in the comments seem to be from misconfiguring the kernel. If you aren’t sure what your hardware is or don’t have the time to run through every option. I suggest you pop in a live cd and copy “/proc/config.gz” to use as your base config (“gzip -d config.gz” will uncompress it).
If your system is already unusable, pop in a live cd and try the following as root:
“cd /”
“mkdir /mnt/fixme”
“mount /dev/ROOTDRIVE /mnt/fixme”
“mount /dev/BOOTDRIVE /mnt/fixme/boot”
“mount -t proc proc /mnt/fixme/proc”
“chroot /mnt/fixme /bin/bash”
That should put you back into your computer to compile/fix whatever.
benny lootenssays:
January 4, 2009 at 2:40 am
i’ve just build the 2.6.28 kernel on ubuntu 8.04 LTS and it’s working like a charm. It was required, as I had some troubles installing my 500 GB Samsung drive that was attached to a Trust eSATA IF-3300 card. Thanks for this great tutorial !!
Ottosays:
January 6, 2009 at 6:41 pm
You don’t need make modules anymore. I compiled a few times the last days and just make && make modules_install will do.
Akashsays:
January 7, 2009 at 12:59 pm
Following error occured during make command of compilation step for linux 2.6.23
make: *** [.tmp_vmlinux1] Error 1
Plz provide me solution for it.
Thanks
Akash
Akashsays:
January 7, 2009 at 1:06 pm
make command error:
make: *** [.tmp_vmlinux1] Error 1
Kindly suggest solution
regards
————-
Akash
Pekkasays:
January 14, 2009 at 11:47 am
Hi
On Debian the kernel compile is much more straightforward than this describes.
First you of course need to take the kernel source. Then:
1. make menuconfig (or whatever you want)
2. make-kpkg –revision kernel_image
3. Install the resulting .deb package using dpkg.
The debian package management system then knows about your custom kernel and it handles all needed actions to get the kernel properly working. For example initrd is done automagically if needed.
I compile the root file system and the way to access it directly into kernel and customize the kernel sharply to the computer. That way you wont need initrd anymore and the machine boots quite fast, because the chipset drivers are active from wery beginning of booting.
komalsays:
February 7, 2009 at 4:05 pm
I compiled the whole thing and then booted ..I see the updated version of fedora but when I try to run it ..it says kernal panic and doesn’t proceed any further
Anonymoussays:
February 17, 2009 at 9:04 am
If you have multiple CPU-kernels, you’d consider using the -j option for make, for example make -j5 , which will use 5 instance of make to built the process. This will speed up things, nice tip I got on IRC
kontinumassays:
February 18, 2009 at 7:37 pm
Hello!
got some problems while compiling new kernel using make. Error below:
{standard input}: Assembler messages:
{standard input}:745: Error: suffix or operands invalid for `mov'
{standard input}:746: Error: suffix or operands invalid for `mov'
{standard input}:950: Error: suffix or operands invalid for `mov'
{standard input}:951: Error: suffix or operands invalid for `mov'
{standard input}:1024: Error: suffix or operands invalid for `mov'
{standard input}:1025: Error: suffix or operands invalid for `mov'
{standard input}:1120: Error: suffix or operands invalid for `mov'
{standard input}:1121: Error: suffix or operands invalid for `mov'
{standard input}:1208: Error: suffix or operands invalid for `mov'
{standard input}:1220: Error: suffix or operands invalid for `mov'
make[1]: *** [arch/i386/kernel/process.o] Error 1
make: *** [arch/i386/kernel] Error 2
gcc version 4.1.2
debian etch
got some ideas? thanx
trevorsays:
February 19, 2009 at 9:10 am
a very good clarification about kernels,i’m impressed!
ondrgsays:
March 18, 2009 at 10:04 am
Thanks, it works perfectly.
nuggasays:
April 4, 2009 at 9:31 pm
hello when i try to boot my kernel it says error file not found.
i use the following command
title Debian GNU/Linux, kernel 2.6.25 Default
root (hd0,0)
kernel /boot/vmlinuz root=/dev/hdb1 ro
initrd /boot/initrd.img-2.6.25
savedefault
boot
im pretty noob i dont know what im doing wrong.
plzz contact me or post here.
nuggasays:
April 5, 2009 at 10:16 am
my mail is [email protected]
Hussain Jaffarsays:
May 5, 2009 at 3:16 am
37 ondrg, Which gcc version you used ?
Can any body tell that How to remove a previously compiled and installed kernel. So as to make space for compiling and installing a new kernel ?
Acevedosays:
May 7, 2009 at 6:17 pm
NIce step-by-step process, BUT Following error occured during make command of configuration step for linux 2.6.29.2
make[1]: *** [script/kconfig/dochecklxdialog] Error 1
make: *** [menuconfig] Error 2
Plz provide me solution for it.
Thanks
J.Acevedo
Anithasays:
May 12, 2009 at 10:22 am
Hi… Kindly help me please… i m in serious trouble…
I m trying to install RTLinux on Linux 2.6.xx
The installation guide specified to patch the linux 2.6.xx, configure and then compile. But
i m able to proceed til the configuration of the kernel…
When i give the make command, i m coming up with errors…
Also i tried to install linux 2.6.xx without patching it with RTLinux,again i m struck up while compiling……
Kindly help please…Wil be grateful to you…
chindamsays:
May 29, 2009 at 5:45 am
It’s good, but i need your help to compile;boot from a flash drive and configure options such that the size of the kernel is max 5Mb(minimum application like terminal,usb…)
mavgh1says:
July 7, 2009 at 12:09 am
Great Tutorial .I have E8200 , Gigabyte EP43-DS3L kernel 2.6.18 that does not recognize coretemp,I compiled 2.6.30.1 kernel and it’s working.Thanks
Max Bairdsays:
July 13, 2009 at 2:44 pm
Hey this was great, worked for me… I had some small issues where I was missing some files like ncurses etc, but after getting them it all flowed smoothly… thanks alot again
Kousiksays:
July 20, 2009 at 8:33 am
This is nice documentation. But I think some modification is required.
Step # 6: Create an initrd image
Type the following command at a shell prompt:
# cd /boot
# mkinitrd -o initrd.img-2.6.25 2.6.25
Instead of mkinitrd I use mkinitramfs in ubuntu 9.04
Step # 7 Modify Grub configuration file – /boot/grub/menu.lst
# update-grub
update-grub is not required in ubuntu 9.04
Ladysays:
September 10, 2009 at 9:47 am
Can any body describe to me next: about the process0, process0 which happened in Linux kernel 2.6,
1. describe how to greate it
2. describe what they do
Sivakumarsays:
September 23, 2009 at 1:08 am
Hi
I am using ubuntu distribution, I like to update my kernel , my present version kernel is 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux.
i downloaded latest kernel source from kernel.org “linux-2.6.31.tar.bz2” i followed the following steps to configure my kernel
1. i extracted the kernel source file in usr/src
2. I updated my gcc complier
root@sivakumar-desktop:/usr/src# apt-get install gcc
Reading package lists… Done
Building dependency tree
Reading state information… Done
gcc is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 228 not upgraded.
3. Then i tried to run make menuconfig, i got the following error
root@sivakumar-desktop:/usr/src# make menuconfig
make: *** No rule to make target `menuconfig’. Stop.
4. then i tried
root@sivakumar-desktop:/usr/src/linux-2.6.31# make menuconfig
*** Unable to find the ncurses libraries or the
*** required header files.
*** ‘make menuconfig’ requires the ncurses libraries.
***
*** Install ncurses (ncurses-devel) and try again.
***
make[1]: *** [scripts/kconfig/dochecklxdialog] Error 1
make: *** [menuconfig] Error 2
Akssays:
March 26, 2011 at 6:55 pm
Hi there,
To resolve this issue you have to first complete all update of you system then try this
“$ sudo apt-get install libncurses5-dev”
sakisays:
September 28, 2009 at 7:09 am
i am also getting the same problem …….plz suggest
Mukeshsays:
October 11, 2009 at 1:26 am
after extracting there is some error when i configure the kernel
that error is make: *** No rule to make target ‘menuconfig’, Stop.
Mukeshsays:
October 11, 2009 at 1:29 am
Hello,
Can Any One Solve My Problem That Is
after extracting there is some error when i configure the kernel
that error is make: *** No rule to make target ‘menuconfig’, Stop.
plz tell me the fast it is urgent friends….
plz
Reddsays:
October 13, 2009 at 2:37 pm
Mukesh – seems like you need to cd into the extarcted directory to run the make.
Reddsays:
October 13, 2009 at 2:39 pm
Has anyone made a suggestion as to how to fix the kernel panic issue that was pointed to several time here? I have the same issue. After installing the new kernel and trying to boot into it, I see the kernel panic since it doesn’t see any of my drives ( “/”, “/usr”, etc). Anyideas where I went amiss?
Rajsays:
October 30, 2009 at 4:10 am
Hi!!
i am using Redhat 4 – kernel 2.6.9 and now i build kernel 2.7.13. it was sucessfully and after reboot i can see my new kernel in the grub.. but when i select .and proceed . i am getting the following error:
“Enforcing mode requested but no policy loaded. Halting now.
Kernel panic – not syncing: Attempted to kill init!”
please tell me wht might the problem and suggest me how to load the kenel 2.7.13..
Thanx in advance….
GARGsays:
November 6, 2009 at 1:10 pm
problem occur on booting…
mount: unknown file system type ‘devfs’
Kernel panic – not syncing: Attempted to kill init!â€
bensays:
November 11, 2009 at 4:17 am
In the process make install .there are two files created in the direction /boot
Kernel image: /boot/vmlinuz-2.6.31.4-smp
Initrd image: /boot/initrd-2.6.31.4-smp
However,One file config is missed.
I update the menu.list
Then ,reboot.
On the way booting,there is no error.
but when I inter the X-window ,my keyboard and mouse doesn’t work.
mahdisays:
November 24, 2009 at 9:39 pm
Hi everybody,
I have followed all the steps above and succeeded in every step. But when I choose in the grub to run the 2.6.31.6 kernel I have the following message:
Unable to find a suitable fs in /proc/mounts, is it mounted ?
Use –subdomainfs to override.
I have installed the linux kernel from Ubuntu 9.10. I am not sure, but I think because I have installed ubuntu with ext4 file system, the kernel could not recognize it. The kernel is residing in /usr/src which is in the same partition as ubuntu.
Have anyone an idea out there ?
Thx,
bonzsays:
December 3, 2009 at 10:49 pm
if you want people to do your survey you should make it accessable for us lynx users
Noobersays:
December 6, 2009 at 6:12 am
I need help.I follow stepbystep all is done.And but at the reboot say “error 16: inconsistent filesystem structure” what wrong whit it? My kernel is 2.6.24-16 want to upgrade kernel 2.6.31.6 plz help me thx
Azadesays:
December 24, 2009 at 5:18 pm
Does it work for SUSE?
vaidya1says:
January 13, 2010 at 8:22 pm
hey guys…….can anyone help me……….in my /boot i am not getting config file for newly compiled and installed kernel and also after successful installation of kernel.2.6.32 , i am not able to boot from this kernel as it says file system not detected , /dev/hda not detected……..and kernel panic……….
princelibya14says:
April 14, 2010 at 12:31 pm
hi, bro , just try theses commend , cause i got the same problem when i used them every thing is going ok, i wish them helping u, (1. make mrproper
2.cp /boot/config-`uname -r` ./.config ,Then we run 3.make menuconfig) so these two commends use them before make menuconfig, and also do not use make only, just use (make all) . then continue as usual commend in this article, i wish them useful,
my regards,
BongoBongosays:
January 16, 2010 at 9:30 pm
Nice.
Came in handy as I needed to recompile kernel in order to remove KVM virtualization support. VirtualBox won’t run with KVM modules loaded.
Why am I telling you this?
DaVincesays:
January 28, 2010 at 3:12 pm
Some of the instructions are kind of outdated on modern systems, could you perhaps update the article?
– Some systems now use GRUB 2, which doesn’t have a menu.lst.
– Modern systems tend to use mkinitramfs or yaird, not mkinitrd.
Thanks a lot for the article, though. Off to test out my new kernel.
ahmedssays:
February 1, 2010 at 2:32 pm
This article actually very usefull. It helped me to kompile linux kernel after my resultles
attemtions for a long period. The only issue I had was creating initrd image.
My Ubuntu 8.10 interpid (also 8.4 hardy) do not have mkinitrd command so instead
I used next steps to compile linux kernel(2.6.27.7).Here they are.
1. first copy your /boot folder to somewhere , home folder
2. go to top of your linux source tree and run(root prev required)
#make-kpkg clean && make-kpkg –initrd –revision=custom.1.0 kernel_image
and after its finished with no errors run
#dpkg -i .deb
the latest command will update your /boot also /boot/grub/menu.lst file , but this is not what
do we want , and after reboot you may find your pc not booting at all.
what do we need is new kernel and new initrd image .
our new kernel is vmlinuz-2.6.27.7 and image is initrd.img-2.6.27.7
so we have to copy these files to some temp folder , then restore our old /boot folder
from backup and copy back again our fresh kernel and image from temp folder to /boot.
to finish we need edit /boot/grub/menu.lst file.
here we can simply copy our generic boot items and make no change except names
of kernel and image to new ones. reboot and enjoy.
vigsays:
February 1, 2010 at 11:20 pm
it really worked .. clean .. thanks .. a lot
Dannysays:
February 3, 2010 at 11:54 am
> Step # 2 Extract tar (.tar.bz3) file
I lol’d.
Anon13says:
March 9, 2010 at 4:06 am
Thanks! i was looking forward to use some source code for making a fake “compiling” terminal session, so i could slack on the job eventually (slow days make you wanna do something else, but boss doesnt understand the meaning of ‘I do my job so good nobody gets errors, therefore nobody needs IT support’) with the excuse that my code is compiling (thanks xkcd.com for the idea). All i do is run make on the source directory, and once im done with slackin’ i just run “make clean” to revert any changes :b
Tomsays:
March 14, 2010 at 5:13 am
This is after I’ve done step#2 and installed gcc.
When I use this command “make xconfig” I’m getting this error “No rule to make target”.
Any ideas on how to fix this?
tata1says:
March 16, 2010 at 2:56 am
you have to be inside linux folder,
go to yor home directory with cd und then type
pla@pla# cd /usr/src/linux
then type
pla@pla # make menuconfig or make xconfig
make sure that ncurses package is installed
all the best
princelibya14says:
April 18, 2010 at 10:32 pm
hi, i have done all these steps, but i got error when i enter to my new kernel there is network to connection to internet , so can any one help me to solve this problem, cause i am not expert in fedora 10( i mean in Linux )
my regards
ahmedssays:
April 22, 2010 at 3:15 pm
Could you please explain in more detail your error about connection?
Can you run programs with new kernel?
And did you use config file from previous kernel or new one?
princelibya14says:
May 4, 2010 at 11:35 am
hi, bro , i am sorry, i took long time to answer on your query, so my problem is (i can not access on internet) by using wire or less card, when i run commend (iwconfig i got message no wireless extension for eth1 )so sholud i got these from last kernel on my new kernel when i configure it, and also when i search i got article i have to install package for wireless chip . my chip num is b4312, i am already installed , but there is not thing , i wish to help me, cause i waste my time on in these for month , i attempt to solve it, but nothing.plz help me as soon as u can , cause i am in rush.
my regards bro.
Malay Gopanisays:
May 4, 2010 at 10:09 am
Hi,
i want to add the support of portuguese font in linux. i don’t know how to add this if anyone knows then please tell me.
princelibya14says:
May 4, 2010 at 11:41 am
hi, bro, how r u? i wish to help u, u can enter on 1.system then 2.administration 3. choose language from the menu. 5 enter ur password, at last choose Portuguese language ,
i hope this info it is useful to u,
my regards.
Malay Gopanisays:
May 5, 2010 at 6:02 am
Hi,
Thanks,
But i want something different. I have ported linux on the device. I have done “make menuconfig” to make on the portuguese character set ,but it shows this error.
HOSTLD -static scripts/kconfig/mconf
/usr/bin/ld: cannot find -lncursesw
collect2: ld returned 1 exit status
make[1]: *** [scripts/kconfig/mconf] Error 1
make: *** [menuconfig] Error 2
i have this ncursesw library installes also.
would you help me again?
anonsays:
May 9, 2010 at 12:30 pm
apt-get install libncurses5-dev
kishoresays:
May 10, 2010 at 5:12 am
Hi everybody,
I have followed all the steps above and succeeded in every step. But when I choose in the grub to run the 2.6.31.6 kernel I have the following message:
Unable to find a suitable fs in /proc/mounts, is it mounted ?
Use –subdomainfs to override.
I have installed the linux kernel from Ubuntu 9.10. I am not sure, but I think because I have installed ubuntu with ext4 file system, the kernel could not recognize it. The kernel is residing in /usr/src which is in the same partition as ubuntu.
Have anyone an idea out there ?
Thx,
Alexsays:
May 17, 2010 at 3:27 pm
Did you maybe load ext4 as a module and not compile it directly into the kernel
Also if nothing else works I think you could bootstrap it with an initrd to make it boot in ext4
pankyuboothasays:
May 23, 2010 at 11:14 am
hi kishore, i think enabling SYSFS_DEPRECATED in the config file i.e. “.config” and recompiling the kernel should resolve the issue. but this may lead to udev being adversely affected. also remember to enable LBDAF in the kernel profiling segment of the .config file. good luck. PankyuBootha.
Jagansays:
May 17, 2010 at 9:46 am
Hi All
Is there any changes needed during kernel configuration for USB boot support.
what are the steps required for USB boot, starting from the compilation.
any help would appreciated!!!!!
Regards
Jagan
ahmedssays:
May 25, 2010 at 3:24 am
Hi Jaqan. I guess for USB boot support no kernel conf needed. Because
your kernel and initrd.img is loaded by grub from hd, USB or net.
Just copy your boot folder from HD to USB and istall grub on USB.
Restart and see what happens. Good lucks.
Federicosays:
June 1, 2010 at 12:58 pm
I guys i have a problem when I try to generate the init image.. Using Debian 5.0 it says mkinitrd command not found.. Anyone can help me? D:
Thanks
ps: sorry for the english im italian
anonymoussays:
June 4, 2010 at 10:44 am
use ‘mkinitramfs’
ahmedssays:
June 7, 2010 at 3:45 am
Hi Federico. I also used debian and it actually a headache to find proper initrd.img for
new kernel, as mkinitrd doesn’t work on new distrs and a lot of other stuff.
I put here the answer that found
http://www.cyberciti.biz/tips/compiling-linux-kernel-26.html/comment-page-7#comments
lucks.
Jeffsays:
June 9, 2010 at 10:51 pm
Howdy y’all. I just wanted to ask about this process. We own a lot of RHEL/CentOS systems round here and I’m curious how the kernels built with this process will differ from the kernels shipped from the standard repositories. I’ve looked countless places for a guide to recompiling a kernel specifically with the source from those OSes, but something has always failed, or not been in the right location, etc. I’m currently building a kernel using the described process and it actually seems to be working, but I’m just wondering what functionality loss there will be.
Jeffsays:
June 10, 2010 at 12:29 am
Hi everyone. I just wanted to ask about this process. We own a lot of RHEL/CentOS systems round here and I’m curious how the kernels built with this process will differ from the kernels shipped from the standard repositories. I’ve looked countless places for a guide to recompiling a kernel specifically with the source from those OSes, but something has always failed, or not been in the right location, etc. I’m currently building a kernel using the described process and it actually seems to be working, but I’m just wondering what functionality loss there will be.
Jeffsays:
June 10, 2010 at 12:39 am
Weeell…
New kernel compiled, but either doesn’t have SATA or LVM support, as it’s failing to mount root at boot and kernel panicing. At least I got the darn thing compiled … all I really wanted to accomplish at the moment
Pankyu Boothasays:
June 10, 2010 at 6:00 pm
Hi Jeff, As I had said earlier, for RHEL, CentOS and such cognate systems, I have found that one has to enable SYSFS_DEPRECATED while compiling the kernel versions > 2.6.33. As for enabling SATA support, in the relevant section of the .config file one has to enable scsi/ide support while configuring the kernel. Pl first copy “.config” on desktop after uncompressing the tarball in your home directory-
$ bzip2 -dc linux-2.6.34.tar.bz2 | tar -xvf -. You can copy .config file by-
$ mv /home/jeff/linux-2.6.34/.config /home/jeff/Desktop/config.text. Then copy config.text in your home folder/directory.
Now read the config.text file carefully in gedit. you can search for SYSFS_DEPRECATED by using the interactivesearch available in the top window-bar of gedit. Also go through the scsi and ide drivers section.
To manually enable the required features do-
CONFIG SYSFS_DEPRECATED=y
Remember to uncomment the relevant by removing the ‘#’.
Affter you have thus enabled the relevant features, replace config.text to linux-2.6.34 by-
$ mv /home/jeff/Desktop/config.text /home/jeff/linux-2.6.34/.config
Now cd to linux-2.6.34 and do ‘make’
.
Any further queries are welcome. Good Luck. Pankyu Bootha
Rajgopalsays:
August 17, 2011 at 3:20 pm
@pankyu .. Hi.. how does one enable the LVM support ?
Rockysays:
July 26, 2010 at 7:01 am
Hi,
I followed this nice link for kernel compilation.Everything is done nicely.There is no any error while doing compilation process.But after step 5( Step # 5 Install kernel
# make install ) , I am not getting config file in /boot for new
kernel. I m getting systemmap,vmlinuz and initrd for new kernel.So as
per step 6 for mkinitrd, it shows already exists.
And when i rebooted machine with new kernel , getting kernel panic , /
dev/root fileystem not found.
OS: CENTOS 5.5
KERNEL : 2.6.34.1
ahmedssays:
July 27, 2010 at 4:13 am
Good day Rocky. I dont know what the issue was that config file missed for new kernel at /boot folder, but you can copy it manually from source directory of the new kernel that you compiled. At step 3 you have to configure your new kernel using make menuconfig, make oldconfig , or another one of your choise. This step will do nothing else but create
.config file at the top of your source dir. As usual all files in unix that begin with dot are hidden so .config file too. Just copy it to your /boot folder using
# cp .copnfig /boot/config-2.6.x.y
Regarding kernel panic you have to specify right root filesystem.
Either the problem is with your initrd file and sometimes it is becoming real headache
to get proper initrd for new kernel that doesn’t panic.
What I do really advice just try if it will work do make oldconfig. This will config your
kernel using configuration of currently running one. And dont use make initrd but rename
and use initrd file file of your currnetly running kernel for new one.
Rockysays:
July 28, 2010 at 10:21 am
Hi Ahmeds,
I followed your reply.But getting same.
Rocky
ahmedssays:
July 29, 2010 at 4:19 am
Hi Rocky. It is ok if your kernel again did panic. If you want to compile kernel
just for update your current system then I can’t help you. But if you want to
compile kernel so that you could start to kernel programming then just say hello
to bulk of the problems waiting you ahead. I spent 4 month for compiling my kernel
that didn’t panic. It was 2.6.27.7 . I also learned how to configure kernel to
compile all necessary drivers built in so that kernel loaded without headache initrd.
But with 2.6.34.xx things are a little bit different. I didn’t come yet to this level but
what I may advice you is next:
1. download kernel source code of the exact version that is currently running, so that make oldconfig doesn’t complain to anything and if it does say yes.
2. try again more and more.
3. specify RIGHT ROOT filesystem. i.e. root=/dev/sda5 or root=/dev/hda2
The list of filesystems and your root filesystem you can find by df command
for example my root file system(/) mounted on /dev/sda7
john@lnx:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda7 18482044 15095664 2447528 87% /
none 504828 304 504524 1% /dev
none 509044 212 508832 1% /dev/shm
4. If these wouldn’t help try compiling necessary drivers built in. To do this do next:
1. GET list of all of your modules loaded using lsmod.
john@lnx:~$ lsmod
Module Size Used by
binfmt_misc 6587 1
rfcomm 33421 4
…
get module information for each module using modinfo.
john@lnx:~$ modinfo binfmt_misc | grep filename
filename: /lib/modules/2.6.32-21-generic/kernel/fs/binfmt_misc.ko
Go to your kernel source code open fs/Makefile file. Find “binfmt_misc.o” string
(Note: .o not .ko).
obj-$(CONFIG_BINFMT_MISC) += binfmt_misc.o
Then open .config file of your kernel (off course after make oldconfig ) and find
“CONFIG_BINFMT_MISC”.
CONFIG_BINFMT_MISC=m
m means compile as module. If you want this driver to be compiled built in just change m here to y and save your .config file.
CONFIG_BINFMT_MISC=y
You dont have to compile all of your drivers as built in just those which is necessary for mounting root file system, i.e. hard disk drivers, scsi if present, ext3 or 4 if they are compiled as module. It is up to you. If df prints something like
/dev/sda4 … for (root fs,/) this means you have scsi disk. /dev/hda says you have ide disk.
Huh. It is not fun at the end. Good lucks.
Martensays:
July 31, 2010 at 10:41 am
Hello,
I have the exact same problem as Rocky: centos 5.5 with running kernel 2.6.18-194.3.1.el5 and I want to install 2.6.34.1. All teh steps went fine, no errors, but I had to manually copy .config into /boot/config-2.6.34.1. After reboot, same errors like Rocky and also “Volume group Volgroup00 not found” which is why / is not mounted.
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
71G 21G 46G 32% /
/dev/sda1 99M 35M 59M 37% /boot
tmpfs 950M 0 950M 0% /dev/shm
# cat /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=2
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.34.1)
root (hd0,0)
kernel /vmlinuz-2.6.34.1 ro root=/dev/mapper/VolGroup00-LogVol00 rhgb quiet
initrd /initrd-2.6.34.1.img
title CentOS (2.6.18-194.8.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.8.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-194.8.1.el5.img
title CentOS (2.6.18-194.3.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.3.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-194.3.1.el5.img
Any help?:)
Rockysays:
August 1, 2010 at 3:52 pm
Hi,
You can resolve this error.Follow this steps.
After menuconfig.open .config file and add CONFIG_SYSFS_DEPRECATED_V2=y and then compile the kernel.Your issue wiil be resolved.If you have any query, let me know.
Rocky
Martensays:
August 2, 2010 at 8:19 am
Hi Rocky,
Thanks for the help, it worked. I still get this strange error mesage:
insmod: error inserting ‘/lib/dm-region-hash.ko’: -1 File exists
but the system boots up ok, so I guess I can ignore it.
Kernel 2.6.34.1 running :
uname -rs
Linux 2.6.34.1
ragulsays:
August 16, 2010 at 2:32 pm
how to recompile linux kernal?
i am working on module programming . . so i ve to disable the versoning . . can any 1 help me
ahmedssays:
August 19, 2010 at 3:53 am
Hi ragul.
Pls write the command you use for compiling your module.
and also uname -r.
bye.
uuisays:
August 21, 2010 at 11:09 am
For step 2, I don’t think you’re suppose to do it in /usr/src when you’re installing.
deepak goelsays:
October 20, 2010 at 6:12 am
hiii
i am using kernel 2.6.33 but i want to compile 2.6.23
i get a error getline function conflict when i change the name of it i’ll get errors in make install command
ERROR: modinfo: could not find module garp
ERROR: modinfo: could not find module stp
plz suggest how i’ll proceed …
thnx in advance
goosays:
November 21, 2010 at 6:44 am
i am using kernel linux-2.6.36-21 and i want to update it to 2.6.36
everything is ok during compiling and installing
but after reboot my system it tell me “could not load /lib/modules2.6.36/modules.dep: no such file or directory”.
any one have met this problem?
please help me, thanx
subhashsays:
November 26, 2010 at 4:53 pm
i m using ubuntu 10.10…..completed upto step5…
In mkinitrd -o initrd.img-2.6.25 2.6.25 its giving command not found.
on trying to install initrd-tools getting the following error…..Unable to locate package initrd-tools….its very urgent….please can anyone tell what is getting wrong
ahmedssays:
November 29, 2010 at 4:41 am
Good day subhash. I also had the issue with initrd.img compiling linux.
I put my solution in above comment “ahmeds February 1, 2010”.
The only mistake in this solution is #dpkg -i .deb.
prior issuing this command you have to cd ..
and then run dpkg with the deb file prodced by
#make-kpkg clean && make-kpkg –initrd –revision=custom.1.0 kernel_image
Hammadsays:
December 6, 2010 at 3:43 am
Hi,
I followed these instructions and managed to compile the kernel on an ubuntu virtual box. I had some issues with installing the ncurses library, and then with the mkinitrd command, but managed to resolve both of them.
However, just the make step took nearly 6 hours to complete. I thought this was OK until I read in several places that it usually takes around the order of 20 minutes or so. What might I be doing wrong?
I am running ubuntu on a virtual machine, with 512 MB RAM and 10 GB HDD space. Any help would be greatly appreciated.
Thanks!
ananysays:
December 24, 2010 at 10:33 am
Hi
thanks dude.. you did a rocking job..
I Remembered what youhv written somewhere.
Dont send a boy to do a Mens job..
CFBsays:
January 20, 2011 at 8:55 pm
Listen people, do not use this post to build a 2.6 kernel in debian stable or testing. The post is from 2005 and much has changed since then.
I am writing up hos to do it and will follow up with a post.
This is where the internet fails, keeping old, useless information around for too long.
Maheshsays:
February 18, 2011 at 12:18 pm
Guys,
I am newbie to linux kernel build, downloaded linux-2.6.36 from kernel.org and gcc version is 4.4,
uname -a gives msgs
Linux A2MD15118 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 i686 GNU/Linux
I am trying to build the kernel, but make command is gives me below error,
ubuntu/linux-2.6.36/arch/x86/Makefile:81: stack protector enabled but no compiler support
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CC kernel/bounds.s
cc1: error: unrecognized command line option “-mregparm=3”
kernel/bounds.c:1: error: bad value (i586) for -march= switch
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
Please kindly help me to avoid this error…
Thanks in advance..
Mahesh
Maheshsays:
February 18, 2011 at 12:30 pm
Thanks solved the problem by giving full details to make cmd
$make KERNELDIR=/home/ubuntu/linux-2.6.36 CROSS_COMPILE=/usr/bin/
R4to0.exesays:
February 21, 2011 at 2:26 am
Step # 2 Extract tar (.tar.bz3) file
bz3
I lol’d
Neal Andersonsays:
March 23, 2011 at 6:44 am
I found something and thought to share it with you people.
I was compiling the kernel on fedora 13 when i issued make makeconfig command i got some errors same as make*** . Thats ok , the solution is install ncurses-devel
… fine enough??
ok now shoot yum clean alll….
thats it….
now again run make makeconfig here you go
deadmansays:
April 10, 2011 at 7:27 am
hey
i’m having problems while doing make for 2.6.38
its shows 44 sections mismatch(es)
i ignored it and installed the thing
but on loading its shows kernel panic
plz help
Garfieldsays:
April 14, 2011 at 11:35 am
Just want to share something that I found useful.
Autokernconf can probe your hardware for necessary drivers and creates a config file.
Depending on your distro, you might also have to add a few other kernel options like CONFIG_TMPFS for /dev
Take a look at: http://cateee.net/autokernconf/
Mike Shahsays:
April 14, 2011 at 9:50 pm
Hello,
Where can I get development tools (gcc compilers and related tools) (not source)(binary form) (free)(download)? Can you send me URL or link?
I would like the build Linux Kernel but I need make, gcc, linker etc?
Thanks for your help!
Mike
Tanishsays:
May 2, 2011 at 5:06 pm
Hi,
I am trying to build the new kernel (2.6.38) and facing the similar issue as in the comment # 97. I followed the instructions in comment #98 but not able to fix the problem. As I start the make, the .config file is renamed to .config.old and the changes is lost. Can you help me fixing the issue? I am using CentOS 5.5.
-regards,
Tanish S.
vo tuan anhsays:
June 14, 2011 at 4:58 am
hi all,
I have a new PC. I want install kernel linux for it.
pls guide me create and install kernel linux [kernel.org – linux-3.0-rc3.tar.bz2]
Thank you
vinodsreeharisays:
July 7, 2011 at 4:19 pm
Hi ,
Nicely explained. Worked for me like a charm. But I didn’t have to apply teh last two steps ,ie, creating initrd image and editing the boot loader. Those steps ahev been automatically done . Btw, I performed it in SuSe 11.3. Will it be the same in other distros also ?? Curios !!
NB: I upgraded 2.6.34 to 2.6.39 …
Grzezieksays:
July 18, 2011 at 10:56 am
Kernel panic – not syncing: VFS: Unable to mount root fs ..
I’ve solved this problem by creating an initrd image with mkinitramfs function.
mkinitramfs -o initrd.img-2.6.39.3 2.6.39.3
Tried to use mkinitrd but there were no such command in Debian (even after installing kernel-package)
now everything works fine, thx for tutorial.
xyzsays:
July 27, 2011 at 7:27 pm
hello…
i tried all the steps mentioned above….
but while using make command following error is occuring….
make: *** No rule to make target `menuconfig’. Stop.
also i have tried….
sudo apt-get install libncurses5-dev
but following error is occuring….
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Couldn’t find package libncurses5-dev
plz..plz.. reply soon….
vinodbhasisays:
July 28, 2011 at 2:21 am
@XYZ
I guess you are trying to “make” outside the linux directory. change directory to linux (cd /usr/src/linux )
Mayanksays:
August 25, 2011 at 6:22 am
hi
I am using RHEL6 kernel version 2.6.32-71.el6.x86_64
and recompile on kernel version 3.0.3
upto this “make install” step everything going smoothly
after doing this i am not getting that three files
* System.map-3.0.3
* config-3.0.3
* vmlinuz-3.0.3
so i am not be able to make initramfs.img file with this version
so now what i can do
is there any compitablity problem…
plz help me out
PCsays:
September 1, 2011 at 7:58 pm
Make sure you are root when you do the install. Or it will fail.
Tomsays:
September 9, 2011 at 4:36 pm
Thanks. There’s a mistake in the “Step # 2” title. It should be “.bz2” not “.bz3”.
Vasavisays:
September 18, 2011 at 8:54 am
Hi,
Open file using vi:
# vi /boot/grub/menu.lst
title Debian GNU/Linux, kernel 2.6.25 Default
root (hd0,0)
kernel /boot/vmlinuz root=/dev/hdb1 ro
initrd /boot/initrd.img-2.6.25
savedefault
boot
I tried to open the menu.lst file but it is being opened in vi as a new file. So, I just updated grub and rebooted but in the boot loader list I don’t have the kernel I installed to select it. Please help.
Thanks in advance.
Gayathrisays:
November 14, 2011 at 8:14 pm
I am facing the same problem. Any solutions ?
xenosays:
December 5, 2012 at 6:58 am
I’m using Ubuntu 12.04.1 LTS. There is not menu.lst in it either. I ignored the menu.lst and just ran update-grub and restarted the system, it worked fine for me. Try uname -a to see if you already have the kernel.
I update from 3.2.x to 3.7.0
mubariksays:
October 8, 2011 at 9:54 pm
there is an error in sudo make. i am using 64 bit ubuntu 11.4.
arch/x86/kernel/entry_64.S: Assembler messages:
arch/x86/kernel/entry_64.S:1558: Error: .size expression for do_hypervisor_callback does not evaluate to a constant
make[2]: *** [arch/x86/kernel/entry_64.o] Error 1
make[1]: *** [arch/x86/kernel] Error 2
make: *** [arch/x86] Error 2
Kevin Kirkwoodsays:
January 4, 2012 at 7:45 pm
I am having the identical problem.
have you found a solution to the problem yet?
This is something I need resolved ASAP.
If so I would really appreciate the fix.
Thanks
Thanx
Kevin
lambdasays:
October 16, 2011 at 7:24 pm
can anyone tell me how to load an kernel image without modules and gui.
i just want to load a kernel image without any configuration.
bhavinsays:
December 3, 2011 at 2:30 am
hey,
I used this method to compile kernel 3.1.2 on my PC.
but I’m stuck with samples/hidraw/hid-example.c
Its is like this
”
samples/hidraw/hid-example.c:49: warning: unused variable ‘info’
samples/hidraw/hid-example.c:48: warning: unused variable ‘rpt_desc’
samples/hidraw/hid-example.c: In function ‘bus_str’:
samples/hidraw/hid-example.c:171: error: ‘BUS_VIRTUAL’ undeclared (first use in this function)
make[2]: *** [samples/hidraw/hid-example] Error 1
make[1]: *** [samples/hidraw] Error 2
make: *** [vmlinux] Error 2
”
So can anyone tell me what I should do. All other steps are going fine.
Thanks
Bhavin
Anisha Kaulsays:
January 20, 2012 at 5:36 am
Do,
# cd /boot/grub
# ls
Do you find menu.lst there? If yes, the do
# cat /boot/grub/menu.lst
This will show you what all is already present there.
You can open it through a text editor, and add the new and the old kernels, as shown here.
Amit Shawsays:
January 20, 2012 at 8:02 am
NICE TO SEE THE DEFINE ITS AWESOME. Thanks.
Sakibsays:
January 20, 2012 at 4:18 pm
Confirmed …Working on rhel-5.6 32bit. No need to use “mkinitrd -o initrd.img-2.6.25 2.6.25” command.
Today I have install 2.6.30.5 kernel.
Thanks
Sakib
moulisays:
February 7, 2012 at 3:48 am
I followed the tutorial till step 7. On step 7 Modify Grub configuration file – /boot/grub/menu.lst, I am not able to find menu.lst.
I am using ubuntu 10.04, how do I go from here to edit menu.lst?
Thanks,
Mouli
moulisays:
February 7, 2012 at 4:03 am
Ok, this command worked perfectly fine: update-grub
I see the new kernel after reboot
vinod bhasisays:
May 4, 2012 at 9:05 am
Yes, even I did successfully in Debian . update-grub did the job.
tmsays:
February 27, 2012 at 11:55 am
when i type sudo make :
tm@ubuntu:/usr/src/linux-2.6.27.12$ sudo make
CHK include/linux/version.h
CHK include/linux/utsrelease.h
CALL scripts/checksyscalls.sh
CHK include/linux/compile.h
VDSO arch/x86/vdso/vdso32-int80.so.dbg
gcc: error: elf_i386: No such file or directory
make[1]: *** [arch/x86/vdso/vdso32-int80.so.dbg] Error 1
make: *** [arch/x86/vdso] Error 2
can you guys help me about this error !!!
btw i dont know what shall i do when u type make menuconfig and i have already 3.0.0-16-generic
thiyagisays:
March 8, 2012 at 6:13 pm
thanks for info, very useful..
blueseansays:
May 13, 2012 at 8:45 pm
#….after
$sudo make modules_install install
#initramfs for ubuntu eg:-
$sudo update-initramfs -u -k 3.3.6
$sudo update-grub
PS: 3.3.6 is my kernel version &
fyi
$ ls -rt /boot/ | tail -n 5
vmlinuz-3.3.6
System.map-3.3.6
config-3.3.6
initrd.img-3.3.6
grub
ramanasays:
July 4, 2012 at 6:04 pm
hi all,
i have a facing some issue like:
iam currently using ubuntu 11.04 linux 2.6.35 verison.
now i want to add the linux 2.6.27 sources, the compilation and installation is success but after reboot it was going to initird$ promt, but i want GUI to login .can any one please tell me the proceser for how to bring up the board to GUI…..
Handrasays:
July 20, 2012 at 1:31 am
Hi, thanks mate….. I follow your tutorial. It works like a charm. Kernel version 3.4.5 is now Running on my Ubuntu 12.04. Great….. Keep up the good work….
paulsays:
July 30, 2012 at 9:17 pm
hi i can run make menuconfig but when i run make afterwards i get the following error
root@paul-MS-N014:/usr/src/linux-headers-3.2.0-26-generic-pae# make
make[1]: *** No rule to make target `arch/x86/tools/relocs.c’, needed by `arch/x86/tools/relocs’. Stop.
make: *** [archscripts] Error 2
i am running ubuntu 12.04ls
Handrasays:
August 4, 2012 at 10:28 am
Hi Paul,
Are you sure you are compiling using the full source code? I see from the directory name, it is just the header files. Make sure that you download the full source code first before compilation.
Cheers…
ketansays:
August 7, 2012 at 3:20 pm
how to print any simple message on login screen on Linux.
Shubham Saraswatsays:
August 17, 2012 at 12:07 pm
wow i didn’t knew compiling linux kernel 2.6 was so easy…vivek man you have explained it well in just 8 steps..
Pankajsays:
August 27, 2012 at 8:48 am
When i am giving the command “make menuconfig”
i am getting an error below
No rule to make target `menuconfig’. Stop.
please anybody can help
Akashsays:
September 3, 2012 at 1:57 pm
type cd /usr/src/linux-3.6-rc4 and then use make command.
Srinisays:
November 6, 2012 at 2:03 pm
It is not working for me giving errors while compiling kernel.
follow these steps.
make menuconfig
make clean
make bzImage
make modules
make modules_install
make install
these steps worked for me…
adityasays:
January 8, 2014 at 9:36 am
[aditya@localhost linux-3.12.6]$ make menuconfig
Makefile:323: /home/aditya/linux-3.12.6/scripts/Kbuild.include: No such file or directory
make: *** empty variable name. Stop.
make: *** [scripts_basic] Error 2
please help
M Khansays:
February 4, 2014 at 5:09 am
I downloaded this from this site. Now I simply want to unzip it. I am practicing how to build a Kernel. can someone tell me how I can unzip it and should it go to /src.
stable: 3.13.1 2014-01-29 [tar.xz] [pgp] [patch] [view patch] [cgit] [changelog]
Akshaysays:
March 18, 2014 at 9:43 am
How do i make my grub to load a different kernel image? It loads 3.8.13 now. but i want it to load 2.6.10 which is also present in the /boot folder.
NIX Craftsays:
March 18, 2014 at 2:00 pm
May I know your Linux distro name and version (e.g. CentOS v6.4)?
Akshaysays:
March 18, 2014 at 4:58 pm
NAME=”Ubuntu”
VERSION=”12.04.4 LTS, Precise Pangolin”
NIX Craftsays:
March 19, 2014 at 5:17 am
Edit /etc/default/grub file and set GRUB_DEFAULT
GRUB_DEFAULT=
See this help page for more info on GRUB_DEFAULT.
Akshaysays:
March 19, 2014 at 8:32 am
When I run “make” it shows the following error:
No rule to make target /usr/src/linux-headers-3.8.0-generic/arch/x86/syscalls/syscalls_32.tbl, needed by arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h. Stop
sandipsays:
April 21, 2014 at 3:18 pm
I am getting the following error after running make while upgrading my kernel 3.8.0.35 to new kernel 3.9:
sdp@sdp-Dell-System-Vostro-3450:/usr/src/linux_latest_dev_src_tree/linux-git$ make
make[1]: Nothing to be done for `all’.
make[1]: Nothing to be done for `relocs’.
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
CHK include/generated/compile.h
GEN usr/initramfs_data.cpio
/usr/src/linux_latest_dev_src_tree/linux-git/scripts/gen_initramfs_list.sh: line 51: ${output}: ambiguous redirect
make[1]: *** [usr/initramfs_data.cpio] Error 1
make: *** [usr] Error 2
sdp@sdp-Dell-System-Vostro-3450:/usr/src/linux_latest_dev_src_tree/linux-git$
The ${output} is “” in the shell script. Can I get any help?
n.a.ssays:
May 1, 2014 at 1:54 pm
Hi,
After make , I got this error:
ld: block: No such file: File format not recognized
make: *** [vmlinux.o] Error 1
I’m using kernel 2.6.32
How to solve this?
Thanks
razansays:
October 8, 2014 at 8:40 am
when i try to download latest source kernel from kernel .org i have this error message :unable to establish ssl connection ,,,,,, i am working on virtual machine (redhat)
kusuma sureshsays:
October 13, 2014 at 12:03 pm
Hi,
I’m compiling kernel 2.6.32-431.29.2.el6.x86_64 to 3.17.
Did all the steps, everything is fine,
When ran make install getting error as follows
[root@server linux-3.17]# make install
sh ./arch/x86/boot/install.sh 3.17.0 arch/x86/boot/bzImage
System.map “/boot”
ERROR: modinfo: could not find module kcare
ERROR: modinfo: could not find module scsi_tgt
ERROR: modinfo: could not find module snd_page_alloc
Can any one please suggest how to get rid of this issue.
Regards
Kusuma Suresh
Anonymsays:
November 22, 2014 at 12:38 pm
After running “make”…… below is last few lines showing error
AR arch/x86/lib/lib.a
LD vmlinux.o
MODPOST vmlinux.o
WARNING: modpost: Found 4 section mismatch(es).
To see full details build your kernel with:
‘make CONFIG_DEBUG_SECTION_MISMATCH=y’
GEN .version
CHK include/linux/compile.h
UPD include/linux/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
kernel/built-in.o: In function `mutex_unlock’:
/home/thrikasa/Desktop/Linux2.6.27/linux-2.6.27/kernel/mutex.c:118: undefined reference to `__mutex_unlock_slowpath’
kernel/built-in.o: In function `mutex_lock’:
/home/thrikasa/Desktop/Linux2.6.27/linux-2.6.27/kernel/mutex.c:93: undefined reference to `__mutex_lock_slowpath’
make: *** [.tmp_vmlinux1] Error 1
Please Help….
Stéphane Thirionsays:
September 14, 2015 at 6:14 am
Thank you very much for your explanations