Saturday, October 5, 2013

How to pass command line arguments via the device tree



Need to append kernel boot arguments that are provided within the kernel image

Why would this be needed?

u-boot can pass device tree, boot arguments for the Linux kernel, load the Linux image from a sdcard or flash chip via the boot script.  Very flexible and powerful idea.  But, if changes need to be done of enhancing the kernel arguments due to some new feature, then u-boot environment needs change.  

To simplify this process, the kernel can provide a default boot arguments, so, if a kernel feature or some feature then the can be added.  But here is the issue, if the device tree is appended image then the boot arguments need to come from the device tree not the compiled in aurgments. 

For example:

chosen {
  bootargs = "console=ttyS0,115200 loglevel=8";
  
 }
Status of Beaglebone (White) and Micro
- The Micro has support in buildroot
- Buildroot is getting support The BeagleBone (white) and black.  It is in process; in the mean time, here is a simple way to get it working

  1. create a directory bealgebone
  2. git clone git://git.buildroot.net/buildroot
    This will create a directory buildroot
  3. For the kernel use https://github.com/beagleboard/kernel/tree/3.8 I download load via the zip link on the far right of the web page
  4. unzip the file
  5. run the ./patch.sh
  6. Create a tar file: tar zvcf kernel linux-3.8.tar.gz 
  7. copy the linux-3.8.tar.gz into the buildroot/dl directory.  This "stuffs" the kernel into the buildroot download tree
  8. mkdir bld
  9. cd bld
  10. make -C ../buildroot/ O=$PWD beaglebone_defconfig
  11. make
  12. wait few hours
On of the issues when copying the image the most of the sdcard is not used.  To fix that do the following:
sudo resize2fs /dev/xxxx

the xxxx is the partition of the sdcard   this will expand the image until to space is filledd