latest kernel compile in ubuntu step by step

latest kernel compile in ubuntu step by step


Q : How to Compile Kernel in Ubuntu 

Q : Latest Kernel Compilation step's in Ubuntu

Q : Atheros 5Ghz AP Channel Enable 

Q : Kernel Compile for Artheros Wifi Card to Allow 5Ghz Frequency on AP Mode


Step 1 

Install compulsory packages 
sudo apt-get update
sudo apt-get install linux-source fakeroot kernel-wedge build-essential
Step 2 Install Dependency
sudo apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc
sudo apt-get install binutils-dev crash kexec-tools makedumpfile kernel-wedge
  sudo apt-get install libssl-dev bc debhelper kernel-package libc6-dev
Step 3 

Download Kernel for kernel.org ( you can download latest kernel )
cd /usr/src
wget ftp://ftp.kernel.org/pub/linux/kernel/v4.x/linux-4.8.4.tar.gz tar xvf linux-4.8.4.tar.gz
Optional Steps : It's Required a approx 30-60GB disk space, if you don't have just mount external disk by following steps, best to create directory with kernel name
mkdir /usr/src/linux-4.8.4
mount /dev/sdb2 /usr/src/linux-4.8.4
here /dev/sdb2 is external hdd, and extract tar on it
tar xvf linux-4.8.4.tar.gz -C /usr/src/linux-4.8.4/
Step 4 and 5, if you don’t need 5ghz access point channel for Atheros WIFI
Card, avoid step 4 and 5 

Step 4 

Download Patch for wifi 5ghz frequency 
cd /usr/src/linux-4.8.4/drivers/net/wireless/ath/ wget --no-check- certificate https://dev.openwrt.org/export/32952/trunk/ package/mac80211/patches/403-ath_regd_optional.patch
Step 5 Apply Patch
patch -Np5 -i 403-ath_regd_optional.patch echo "#define ATH_USER_REGD 1"|cat - regd.c > /tmp/out && mv /tmp/out regd.c
 Step 6 Create .config file and make oldconfig
cd /usr/src/linux-4.8.4/ cp /boot/config-$(uname -r) .config make oldconfig
Note: choose default option just hit the enter on every prompt or choose according your need..

Step 7 

Compile, make and create .deb file
fakeroot make-kpkg --initrd --append-to-version=-linuxtopic kernel-image kernel-headers
OR

     fakeroot make -j5 deb-pkg LOCALVERSION=-linuxtopic KDEB_PKGVERSION=1

Note: Wait approx 1 to 10 hour 

Step 8 

check .deb and Install Kernel
ls ../*.deb dpkg -i ../*.deb




Previous
Next Post »