Actions

EmSys

Difference between revisions of "Build Linux Kernel For BeagleBone Black"

From EdWiki

m
m
Line 9: Line 9:
  
 
  cd linux
 
  cd linux
  git checkout 4.9.147-ti-rt-r121 -b 4.9.147-ti-rt-r121
+
  git checkout am33x-rt-v5.4 -b am33x-rt-v5.4
  
 
Since we have cloned the official BeagleBoard source, we can call the default configuration straight from the sources. The following command initialises the kernel sources by copying the default BeagleBoard kernel configuration to the base directory of the kernel sources - and renames it '''.config'''.
 
Since we have cloned the official BeagleBoard source, we can call the default configuration straight from the sources. The following command initialises the kernel sources by copying the default BeagleBoard kernel configuration to the base directory of the kernel sources - and renames it '''.config'''.

Revision as of 15:17, 28 November 2020

Build Linux Kernel for BeagleBone Black

Our host should now be ready to cross-compile a kernel, all that is required is to download the kernel. There are a number of ways we can do this for the BeagleBone platform but here we will concentrate on the official kernel release which can be found on the BeagleBoard github repo and can be "checked out" using Git with the following command - note that this does take a good while:

cd ~/bbb_linux/
git clone git://github.com/beagleboard/linux.git

Once complete change to the newly checked out directory. This kernel should feature the latest configuration files and patches for the various BeagleBone Black platforms. Now, we need to configure the kernel, then build it and finally deploy it. Let's start with the configuration.

cd linux
git checkout am33x-rt-v5.4 -b am33x-rt-v5.4 

Since we have cloned the official BeagleBoard source, we can call the default configuration straight from the sources. The following command initialises the kernel sources by copying the default BeagleBoard kernel configuration to the base directory of the kernel sources - and renames it .config.

armmake bb.org_defconfig

If we need to fine-tune this configuration we can do so using 'menuconfig' i.e. we simply run:

armmake menuconfig

Now the sources are configured, we should be able to build the kernel. As with the configuration command we also specify the ARCH and CROSS_COMPILE flags but also we need to tell the build system the target kernel image type required - uImage along with specifying the address that the kernel should be located with the LOADADDR argument. We also specify that we want the device tree to be compiled too, as follows:

armmake uImage dtbs modules LOADADDR=0x80008000

We have now built a kernel for the BeagleBoard platform and if we intend to make any changes to the kernel modules, we need to build these modules by simply adding the arguments to the 'make modules' command as follows:

armmake modules

That is it!