You can generate a good starting .config with make localconfig which creates a .config which prepares the modules which are in use by your system at that point. You can also get the old kernel config from /proc/config.gz which is probably a better approach.
I would guess that the approach described here is pretty much distro-agnostic.
Anyway, compiling the kernel:
mkdir ~/tmp cd ~/tmp wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.8.2.tar.bz2 tar xvf linux-3.8.2.tar.bz2 cd linux-3.8.2/ cp /proc/config.gz . gunzip config.gz mv config .config make oldconfig make -j2 make -j2 modules sudo make modules_install sudo make headers_install INSTALL_HDR_PATH=/usr/src/linux-3.8.2 sudo cp arch/x86_64/boot/bzImage /boot/vmlinuz-3.8.2 sudo cp System.map /boot/System-3.8.2.map sudo mkinitcpio -k 3.8.2-ARCH -c /etc/mkinitcpio.conf -g /boot/initramfs-3.8.2.img
NOTE: the naming isn't random. In order for grub-mkconfig to discover both the vmlinuz and initramfs files they need to be named vmlinuz-IDENTIFIER and initramfs-IDENTIFIER.img. The identifier can be anything.
Generate your grub.cfg:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Reboot, and do
uname -a
Linux titanium 3.8.2 #1 SMP Mon Mar 4 20:17:17 EST 2013 x86_64 GNU/Linux
Little , can not be recognized.
ReplyDeleteNote sure I understand...
Deletelinux-3.8.2,tar.bz2
Deleteand it says ==> ERROR: '/lib/modules/3.8.2' is not a valid kernel module directory
What command?
DeleteOK, it looks like you tried to run
Deletetar xvf linux-3.8.2,tar.bz2 ?
Anyway, turns out that there's a typo -- the , should be a . i.e
tar xvf linux-3.8.2.tar.bz2
When I say
Deletesudo mkinitcpio -k 3.8.2 -c /etc/mkinitcpio.conf -g /boot/initramfs-3.8.2.img
it said
==> ERROR: '/lib/modules/3.8.2' is not a valid kernel module directory
thanks for the help :)
Did all the previous steps work properly? Did the kernel build and install successfully? Is there a /lib/modules/3.8.2 directory?
DeleteNone of them displayed a problem. Kernel builded. It take about one hour. yes that folder has a kernel folder and "modules" files.
DeleteI'll see if I can have a look at it over the weekend.
DeleteFixed it. Do
Deletesudo mkinitcpio -k 3.8.2-ARCH -c /etc/mkinitcpio.conf -g /boot/initramfs-3.8.2.img
/usr/src/linux is not used anymore. They recommend the home directory. I think the old way is better but I just wanted to share that because it will be a source of problems.
ReplyDeleteThanks for the feedback/warning.
DeletePresumably like you, I don't see why a random home directory should be preferable to a standardised location though.