Skip to main content

Build linux kernel


Today, I will show you the way to build kernel for linux from linux source code. We can run linux from something you created from source code




I. Prepare for building linux kernel:
1. Compilation Requirements
a. Linux x86 and NetBSD Systems
  • gnu make Upgrade to version 3.80. Check your version by follow command
    $make -v
  • gcc upgrade to version 2.95, 3.x or 4.x. Check your version by follow command
    $gcc -v
  • autoconf upgrade to version 2.54
II. Build linux kernel
1. Download kernel:
  • Download kernel and put both linux kernel and ZebOS into /use/src:
    $cd /use/src
    $wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.27.21.tar.bz2

  • Extract the linux kernel code:
    $tar -xjvf linux-2.6.27.21.tar.bz2

2. Make configure

  • Run menu configuration:
    $make menuconfig
    If error ncurses: you should update the libncurses:
    $sudo apt-get install libncurses-dev
  • Enable or disable the various Linux kernel Networking option for the patch

3. Recompile the kernel:
  • $make
  • $make modules_install
  • Use sudo for command:
    $make install
4. Create initrd (if need)

  • $update-initramfs -c -k [version]

  • $update-grub
5. Reboot kernel

  • $reboot

Comments

Popular posts from this blog