Difference between revisions of "ECE497 Project: Multiple Partitions via U-boot"

From eLinux.org
Jump to: navigation, search
(User Instructions)
(User Instructions)
Line 76: Line 76:
 
Before you can dual-boot your Beagle Board, you will need an mmc card with multiple partitions.  Surprisingly, a Google search reveals that there are few, if any people who have accomplished this.  (Please note that the SuperJumbo package for the Beagle Board by Always Innovating uses a different method to switch between OS's while the board is powered on).  To remedy this issue, we have created a script that will set up an mmc card with U-boot and multiple Angstrom partitions.  We based our script on the OMAP3 SD Booting script created by Slim Logic Ltd. which can be found at the following url: [http://www.slimlogic.co.uk/2011/05/omap3-sd-booting/ http://www.slimlogic.co.uk/2011/05/omap3-sd-booting/].  If you would like to see the modifications we made to achieve multi-boot, please view the 'Theory of Operation' section below.
 
Before you can dual-boot your Beagle Board, you will need an mmc card with multiple partitions.  Surprisingly, a Google search reveals that there are few, if any people who have accomplished this.  (Please note that the SuperJumbo package for the Beagle Board by Always Innovating uses a different method to switch between OS's while the board is powered on).  To remedy this issue, we have created a script that will set up an mmc card with U-boot and multiple Angstrom partitions.  We based our script on the OMAP3 SD Booting script created by Slim Logic Ltd. which can be found at the following url: [http://www.slimlogic.co.uk/2011/05/omap3-sd-booting/ http://www.slimlogic.co.uk/2011/05/omap3-sd-booting/].  If you would like to see the modifications we made to achieve multi-boot, please view the 'Theory of Operation' section below.
  
First, download the our script [
+
First, download our script [http://www.rose-hulman.edu/~yuhasmj/embedded_linux/partitioning.sh here].
 +
 
 +
Before you can run the script, you will have to change the permissions so that it will be executable:
 +
 
 +
<pre>
 +
host$ sudo chmod 777 parititioning.sh
 +
</pre>
 +
 
 +
Now run the script with no arguments.  You should receive the below output message:
 +
 
 +
<pre>
 +
host$ sudo ./partitioning.sh
 +
</pre>
  
 
== Highlights ==
 
== Highlights ==

Revision as of 17:01, 19 February 2012


Team members: Michael J. Yuhas, Jack Ma

Executive Summary

The goal of this project is to give the U-boot boot-loader the ability to mount different partitions on start-up. This would allow the user to dual-boot the beagle board by controlling the boot sequence with a user button or RS-232 link.

There are two principal parts to this project: finding a method to create a multiboot mmc card, and creating a command in U-Boot to simplify the process of booting multiple partitions for the user. We have successfully completed both parts in this project and have found a method create and boot from a multi-partition mmc card on the Beagle Board.

If we had more time, we would like to research further into booting from USB devices. Initially, our projects scope included booting from external USB devices, but we were not able to make any progress with this goal.

We feel that this project was successful in that we achieved the primary goals we set out to accomplish. In addition, we learned many new things about the inner workings of boot-loaders, solid state storage devices, and the way the kernel boots during startup.

Installation Instructions

These instructions will guide you through the installation of our modified U-boot boot-loader.

If you do not yet have git installed see the instruction on EBC Exercise 07.

Open a terminal on your host machine and pull our git repository:

host$ git clone git@github.com:albertlee5/project.git
host$ cd project/

To compile the code for our project you will have to source two shell scripts that set certain environmental variables and the cross-compiler toolchain:

host$ source ~/.oe/environment-oecore
host$ source ~/.oe/crossCompileEnv.sh

Before you can build our installation, you will need to configure some variables so that the make file knows exactly what platform U-boot will use. First you need to unconfigure any previous settings and then have make configure itself for the Beagle Board.

host$ make unconfig
host$ make omap3_beagle_config

Now you should be able to make our project:

host:/project$ make

Next copy the resulting MLO, uboot.img, and uboot.bin to the boot partition of your mmc-card and rename the corresponding existing files so they don't interfere at startup. The beagle should now boot with our modified bootloader.


Note: follow the instructions in the section below if you ran into some problems during make. The errors described are caused by a problem in the files we pushed to the repository. Although we believe we fixed the problem, we only have two machines with which to test this, so we included the remedy below as a precaution.


If make fails with an error such as "System not Configured" or the like, there are several commands you will have to run to fix this. This is caused because the copy on the repository may contain some temporary files that were native to the editors host machine, but will not work with your configuration. We will have to remove several files so that make will re-generate them for your machine. In the terminal type:

host:/project$ rm -rf include/autoconf.mk
host:/project$ rm -rf include/autoconf.mk.dep

This removes some auto-configuration files from the include directory. We will also need to remove a number of .depend files created by make. (Note that simply typing make clean will not remove these since they were not created with your Makefile). The following commands perform a batch remove of these files, and then check to see if the removal was successful:

host:/project$ find . -name .depend | xargs rm -rf
host:/project$ find . -name .depend.* | xargs rm -rf
host:/project$ find . -name .depend
host:/project$ find . -name .depend.*

The last two commands should return no output. Now try using make to compile U-boot.

User Instructions

The Multi-Partition Creator Script

Before you can dual-boot your Beagle Board, you will need an mmc card with multiple partitions. Surprisingly, a Google search reveals that there are few, if any people who have accomplished this. (Please note that the SuperJumbo package for the Beagle Board by Always Innovating uses a different method to switch between OS's while the board is powered on). To remedy this issue, we have created a script that will set up an mmc card with U-boot and multiple Angstrom partitions. We based our script on the OMAP3 SD Booting script created by Slim Logic Ltd. which can be found at the following url: http://www.slimlogic.co.uk/2011/05/omap3-sd-booting/. If you would like to see the modifications we made to achieve multi-boot, please view the 'Theory of Operation' section below.

First, download our script here.

Before you can run the script, you will have to change the permissions so that it will be executable:

host$ sudo chmod 777 parititioning.sh

Now run the script with no arguments. You should receive the below output message:

host$ sudo ./partitioning.sh

Highlights

Not yet availble

Theory of Operation

This project takes

Work Breakdown

Task Completion Date User
Create Project Page Jan 23, 2012 Yuhas
Research loading multiple partitions / u-boot scripting language Feb 6, 2012 Yuhas & Ma
Determine schedule for project Feb 6, 2012 Yuhas & Ma
Create SD card with multiple root partitions Feb 7, 2012 Yuhas & Ma
Test U-boot to multiboot using command-line Feb 7, 2012 Ma

Conclusions

Not yet available.