Difference between revisions of "Debian-kernel"
From Bashlinux
Line 1: | Line 1: | ||
__NOTOC__ |
__NOTOC__ |
||
− | = |
+ | = GNU/Debian Kernel setup = |
+ | == Kernel from Debian repositories == |
||
⚫ | |||
+ | |||
+ | === Get the sources and setup the environment === |
||
+ | # Install the proper packages to build the kernel |
||
+ | |||
+ | <pre><nowiki> |
||
+ | apt-get install ncurses-dev fakeroot kernel-package build-essential devscripts |
||
+ | </nowiki></pre> |
||
+ | |||
+ | # Build kernel dependencies |
||
+ | |||
+ | <pre><nowiki> |
||
+ | apt-get build-dep linux-2.6 |
||
+ | </nowiki></pre> |
||
+ | |||
+ | # Get Debian kernel sources |
||
+ | |||
+ | <pre><nowiki> |
||
+ | apt-get source linux-2.6 |
||
+ | </nowiki></pre> |
||
+ | |||
+ | * Note that `deb-src` must be present on `/etc/apt/sources.list` file |
||
+ | |||
+ | === Build Debian Kernel === |
||
+ | # If kernel is patched, check it twice as follows |
||
+ | |||
+ | <pre><nowiki> |
||
+ | make -f debian/rules source-all |
||
+ | </nowiki></pre> |
||
+ | |||
+ | * First time must fail |
||
+ | * If building all kernel related packages, then do as follows. It takes almos 40GB on Hard drive. |
||
+ | |||
+ | <pre><nowiki> |
||
+ | ~/src/linux-2.6-2.6.24~rc6$ debuild -e DEBIAN_KERNEL_JOBS=${NR_CPUS} |
||
+ | </nowiki></pre> |
||
+ | |||
+ | * If building an specific architecture, then |
||
+ | |||
+ | <pre><nowiki> |
||
+ | fakeroot make -f debian/rules.gen setup_i386_none_k7 |
||
+ | </nowiki></pre> |
||
+ | |||
+ | * This will build the packages for AMD K7 |
||
+ | * If there is any change to apply, then go the the `k7` folder and config the kernel |
||
+ | |||
+ | <pre><nowiki> |
||
+ | debian/build/build_i386_none_k7 |
||
+ | make menuconfig |
||
+ | </nowiki></pre> |
||
+ | |||
+ | * Build the kernel |
||
+ | |||
+ | <pre><nowiki> |
||
+ | fakeroot make -f debian/rules.gen binary-arch_i386_none_k7 binary-indep DEBIAN_KERNEL_JOBS=${NR_CPUS} |
||
+ | </nowiki></pre> |
||
+ | |||
+ | |||
+ | === Install Debian Kernel === |
||
+ | Kernel packages will be created in `/usr/src` folder. Install them as any other ''deb'' package |
||
+ | |||
+ | <pre><nowiki> |
||
+ | dpkg -i linux*.deb |
||
+ | </nowiki></pre> |
||
+ | |||
+ | |||
+ | == Real-Time Vanilla Kernel == |
||
+ | |||
⚫ | |||
# Create `vanilla` folder in `/usr/src` and change directory to such location |
# Create `vanilla` folder in `/usr/src` and change directory to such location |
||
Line 34: | Line 102: | ||
− | == Build Kernel == |
+ | === Build RT Kernel === |
# Go to the linux source folder |
# Go to the linux source folder |
||
# Configure the kernel, if necessary `make menuconfig` |
# Configure the kernel, if necessary `make menuconfig` |
||
Line 52: | Line 120: | ||
</nowiki></pre> |
</nowiki></pre> |
||
+ | |||
+ | === Install RT Kernel === |
||
* If only modules are needed, then use `make modules` |
* If only modules are needed, then use `make modules` |
||
* Install the modules |
* Install the modules |
Revision as of 08:10, 17 October 2010
GNU/Debian Kernel setup
Kernel from Debian repositories
Get the sources and setup the environment
- Install the proper packages to build the kernel
apt-get install ncurses-dev fakeroot kernel-package build-essential devscripts
- Build kernel dependencies
apt-get build-dep linux-2.6
- Get Debian kernel sources
apt-get source linux-2.6
- Note that `deb-src` must be present on `/etc/apt/sources.list` file
Build Debian Kernel
- If kernel is patched, check it twice as follows
make -f debian/rules source-all
- First time must fail
- If building all kernel related packages, then do as follows. It takes almos 40GB on Hard drive.
~/src/linux-2.6-2.6.24~rc6$ debuild -e DEBIAN_KERNEL_JOBS=${NR_CPUS}
- If building an specific architecture, then
fakeroot make -f debian/rules.gen setup_i386_none_k7
- This will build the packages for AMD K7
- If there is any change to apply, then go the the `k7` folder and config the kernel
debian/build/build_i386_none_k7 make menuconfig
- Build the kernel
fakeroot make -f debian/rules.gen binary-arch_i386_none_k7 binary-indep DEBIAN_KERNEL_JOBS=${NR_CPUS}
Install Debian Kernel
Kernel packages will be created in `/usr/src` folder. Install them as any other deb package
dpkg -i linux*.deb
Real-Time Vanilla Kernel
Get sources and setup environment
- Create `vanilla` folder in `/usr/src` and change directory to such location
mkdir -p /usr/src/vanilla cd !$
- Download the latest rt patch
http://www.kernel.org/pub/linux/kernel/projects/rt/
- Download the matched kernel for the proper patch downloaded in previous step
http://www.kernel.org/pub/linux/kernel/v2.6/
- Decompress both, the linux kernel sources and the patch
tar jxvf *.bz2
- Patch the kernel
cd linux-2.6.AA.BB patch -p1 <../patch-2.6.AA.BB-rtNN
- Create a link `linux` which points to the linux kernel sources
ln -s /usr/src/vanilla/linux-2.6.AA.BB /usr/src/linux
Build RT Kernel
- Go to the linux source folder
- Configure the kernel, if necessary `make menuconfig`
- Backup the old config file
cd /usr/src/linux cp .config config.yy-mm-dd
- When finish save your changes
- Build the bzImage
cd /usr/src/linux make
Install RT Kernel
- If only modules are needed, then use `make modules`
- Install the modules
make modules_install
- Install the kernel, usually locate on `arch/MY_ARCH/boot` in kernel sources
cp arch/MY_ARCH/boot/bzImage /boot/vmlinuz-2.6.AA.BB-rtNN
- Create initial root filesystem
cd /usr/src/linux update-inintramfs -c -k 2.6.AA-BB-rtNN
- Add the proper entry to grub in `/boot/grub/menu.lst`
title RT kernel 2.6.AA.BB-rtNN root (hd0,0) kernel /boot/vmlinuz-2.6.AA.BB-rtNN root=/dev/hda1 ro initrd /boot/initrd.img-2.6.AA.BB-rtNN
- TIP: if `default` parameter is set to `0` at the beginning of the `menu.lst` file, then try to put this entry at the top of the entries list.