LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-01-2014, 04:01 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,649

Rep: Reputation: 255Reputation: 255Reputation: 255
How to compile a debian kernel?


Hi,

I would like to share my process to compile:
which hangs after ...

1)
Code:
apt-get install linux-source 
apt-get install build-essential
apt-get install kernel-package  --no-install-recommends
  (for kpkg)
2)
Code:
cd /usr/src
tar xfvj /usr/src/linux-*tar.bz2
3) vanilla?? what to do because I have no boot directory and nothing to start
Code:
cp /boot/config-`uname -r` .config

4)
Code:
make clean
make nconfig
make
5) wait 20 hours, and take a cup of coffee or several to wait...

6)
Code:
fakeroot make-kpkg --append-to-version=mycustomkernel --initrd buildpackage
7)
Code:
mount /dev/sda1 /mnt/sda1
cp vmlinu[***] /mnt/sda1/boot/vmlinuz
cp init[***] /mnt/sda1/boot/initrd.gz
... and now reboot and pray
 
Old 05-01-2014, 09:38 PM   #2
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,048
Blog Entries: 21

Rep: Reputation: 3470Reputation: 3470Reputation: 3470Reputation: 3470Reputation: 3470Reputation: 3470Reputation: 3470Reputation: 3470Reputation: 3470Reputation: 3470Reputation: 3470
Maybe compare notes using

http://www.howtoforge.com/roll_a_ker...ian_ubuntu_way
 
Old 05-01-2014, 11:24 PM   #3
k3lt01
Senior Member
 
Registered: Feb 2011
Location: Australia
Distribution: Debian Wheezy, Jessie, Sid/Experimental, playing with LFS.
Posts: 2,900

Rep: Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637
This is the method I used to use. I don't do it anymore as I find the Liquorix kernel is fine for my non stable installations.
 
1 members found this post helpful.
Old 05-05-2014, 06:27 AM   #4
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
In Debian it's best to do the whole thing in a fakeroot and built deb packages for the image and headers:

Make a build directory
Code:
$ mkdir ~/build && cd ~/build
Get your kernel source (example is 3.14.2) and extract
Code:
$ wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.2.tar.xz
Code:
$ tar Jxvf linux-3.14.2.tar.xz && cd linux-3.14.2
Get the config from the running kernel
Code:
$ cp /boot/config-`uname -r` .config
Code:
$ make oldconfig
(it's usually safe to hold down enter here and accept the defaults - if there is a huge jump in versions, the kernel source of the newest kernel from unstable will have a newer debianised config).

Next run the config tool of choice and make changes as required
Code:
$ make xconfig
or
Code:
$ make menuconfig
etc

Clean the source directory
Code:
$ make-kpkg --rootcmd fakeroot clean
Build the kernel, initrd and headers
Code:
$ make-kpkg --rootcmd fakeroot --initrd kernel_image kernel_headers
Install the resulting deb packages (no need for manual installation/copying of bzImage or modules)
Code:
# dpkg -i *.deb
Configure the bootloader and reboot.
 
1 members found this post helpful.
  


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
[SOLVED] Cannot compile a custom 3.0.0 debian kernel utanja Debian 11 08-11-2011 06:33 AM
Debian 6.0 - custom kernel compile Kernel panic - not syncing: VFS: Unable to mount Bono Debian 5 05-06-2011 06:18 PM
How to compile debian kernel source into a generic kernel? linus72 Debian 3 04-29-2010 08:50 PM
Why can't I compile this kernel module? (kernel: 2.6.8-powerpc Debian sarge) Lannix Linux - Hardware 5 05-01-2007 12:29 PM
compile kernel - Debian Way Xreagan Linux - Distributions 1 08-26-2002 12:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:56 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