The Linux kernel is booted with a series of parameters known as the ''kernel command line''. On the BeagleBoard, the uBoot bootloader handles both the booting and the passing of parameters. A typical command line on the BeagleBoard might look something like this:

−

The linux kernel is booted with a series of parameters known as the ''kernel command line''. On the BeagleBoard, the uBoot bootloader handles both the booting and the passing of parameters. A typical command line on the BeagleBoard might look something like this:

Revision as of 20:13, 28 April 2011

The Linux kernel is booted with a series of parameters known as the kernel command line. On the BeagleBoard, the uBoot bootloader handles both the booting and the passing of parameters. A typical command line on the BeagleBoard might look something like this:

Contents

Modifying Boot.scr

When uBoot finishes its initilization phase, it looks for a file called boot.scr
This is a binary file which is read by uBoot before it loads uImage which allows us to modify environment variables such as 'bootargs' (the kernel command-line) before we boot.

Boot.cmd

Boot.cmd is the plain text, uncompiled version of boot.scr. A standard BeagleBoard boot.cmd might look like:

This is the kernel command line, any additional parameters added on this line will be passed to the kernel when it is booted.

Compiling with mkimage

Once the boot.cmd file has been authored, we need to compile it to produce a boot.scr file. This is done with the mkimage program.
On Ubuntu, this program is available through the package 'uboot-mkimage'. It should be similarly available for most distributions.

Once mkimage is installed, you'll want to run it on boot.cmd to create boot.scr:

Replacing the old boot.scr

Once the new boot.scr file has been created, place it in the root directory of the BeagleBoard's SD card (the same directory as uImage).

Next time you boot, the kernel will be passed your newly added parameters!

If you have ssh access to your BeagleBoard, you can install your newly created boot.scr with the following command:

scp boot.scr root@beagleboard:/media/mmcblk0p1/

just be sure to replace 'beagleboard' with your BeagleBoard's hostname or IP address

User.scr

If the USER button is held while the BeagleBoard boots, uBoot will look for the file user.scr instead of boot.scr. This gives us the chance to boot the kernel with two different command lines (or even boot another kernel all together).

The process for modifying or creating a user.scr file is the same as boot.scr, just change the filename.

Makefile version

In order to simplify this overly complex process, we can use a Makefile like the one below: