How to compile latest mainline kernel for beaglebone black

by 20:05 0 comments
In this post, I will explain how to setup beaglebone black to boot from tftp. This  saves us time in programming the SDcard every time we need to change the image. For baremetal programming, we may need to change the image frequently and this method will be of real help. For this method you need serial console access.

I found a very good article on the same topic in the following website
http://wiki.beyondlogic.org/index.php/BeagleBoneBlack_Building_Kernel
This article provides some extra points.

1. How to compile latest mainline kernel for beaglebone black
2. NFS root issues while booting

All the steps mentioned are for UBUNTU. Seriously, your life will be easier , if you use ubuntu.

This is what we are going to do

1. Build an image
2. start tftp server
3. Stop in uboot prompt.
4. Set up environment variables
5. Use NFS file system for ramdisk

BUILD THE IMAGE:
               In many of the articles available in the net, they will ask you to use a arch linux based kernel. We need to download it , compile and boot it. But we need the latest linux kernel and not a distro. This is important beacuse, we need the mainline kernel which has all the latest changes to the linux kernel. Secondly, if you want to  learn Linux system/driver programming it is always better to have the latest version. For instance, the kernel mentioned in beagleboard website, the version is 3.12. The  latest version as i write this blog is 3.18.

1. Download the latest kernel from kernel.org and unzip it.
https://www.kernel.org/

2. We are going to use a cross compiler to compile our image. I am using ubuntu 14.04LTS OS. You need to install arm-linux-gnueabi tools for cross compilation.
apt-get utility can help you.

3. After installing we are ready for compilation.
    We need to use a default config file. For this use, arch/arm/configs/omap2plus_defconfig

4. compilation steps
    
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-  omap2plus_defconfig -j4
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage dtbs LOADADDR=0x80008000 -j4
 
5. For setting up the tftp server and nfs root follow the link 
provided.

6. While setting up the server, you need to give dhcp command 
in uboot prompt. It will tell you an available ip address.
 
7. You need to mention this in your /etc/exports file in the 
following format. Otherwise, nfs mount will fail
/home/ragu/work/linux/busybox/src/busybox-1.21.0/arm_install/ 10.117.83.172(rw,sync,no_root_squash,no_subtree_check)
/home/ragu/work/linux/busybox/src/busybox-1.21.0/arm_install/ 10.117.83.175(rw,sync,no_root_squash,no_subtree_check) 

Follow the instructions mentioned in the reference article for
booting.

We use busybox for ramdisk. Thats all i wanted and it is good enough for me.



 

  


Unknown

Developer

Open Source Ethusiast.

0 comments:

Post a Comment