Prepare a bootable SD card to run Balsa

From LSDevLinux
Revision as of 09:29, 16 August 2010 by Mayhewn (talk | contribs) (Step 1: Build or download a BALSA Tarball: Typo)

Jump to: navigation, search


This set of instructions tells you how to install a BALSA Prototype onto a SD card.

The BALSA build finishes with the set of BALSA files in a bzip2 tarball in the .../balsa-results/build directory. Alternately, you can download a BALSA tarball and store it in that directory. These are instructions for decompressing the tarball and loading the files onto an SD card. The goal is to build an SD card that will boot to BALSA. BALSA currently requires a 4 Gig or larger SD card.

These steps must be done on a Linux computer, and the user must have access to sudo privileges.

In the case of preparing multiple SD cards to run BALSA, Steps 1 and 2 below only need to be performed once.

The Procedure

Step 1: Build or download a BALSA Tarball

See the BALSA Prototype instructions to build a BALSA system from scratch.

Or download the current BALSA tarball from the link on this page. The commands in Step 2 below assume that the tarball is in the same directory it would be in if you had built it. To put it in that directory do this:

  1. open a terminal
  2. create the subdirectory with this command:
mkdir -p balsa-results/build

Place the downloaded tarball into the directory you've just made: ~/balsa-results/build/[balsa-filename].tbz2. (Or substitute your own path/directory).

Step 2: Decompress the BALSA tarball

This step decompresses the BALSA tarball into an intermediate directory. The intermediate directory must be on a Linux filesystem (e.g. ext2 or ext3; not FAT or NTFS). The code below assumes that the intermediate directory is named balsa-card and is a sibling directory to the balsa-results directory. If you want to put it elsewhere, replace balsa-card and ../balsa-results/build/ with a paths/directories of your choice.

Open a terminal and use cd to get to the parent of the balsa-results directory you made in Step 1. Run these commands:

mkdir balsa-card
sudo chown root:root balsa-card
cd balsa-card
sudo tar --numeric-owner -xpjf ../balsa-results/build/[latest].tbz2

If you have built your own BALSA image using balsa-builder, the tarball will be named latest.tbz2. If you have downloaded a tarball substitute the correct filename as in Step 1 [balsa-filename].tbz2.

Step 3: Initialize the SD card

If the SD card has a BALSA build (from August 2010 or more recent) on it already, this step can be omitted.

You will need a Linux system with gparted installed that can read a SD card.

WARNING!! gparted is a partition editor. It is a powerful and dangerous tool. If you don't know what a partition is, you shouldn't be doing this. Read the instructions below and understand them. Follow them closely.

  1. This procedure will destroy all the data on the SD card. Back up any data on it you want to keep.
  2. Plug in the SD card.
  3. Start gparted. You will see a screen that looks like this:
  4. Select the SD card in gparted device window. (Red Circle 1)
  5. In the menu, select View|Device Information and make sure that you're working on the right device. (Blue Circle 2)
  6. Click on the mounted partition. (Green Circle 3)
  7. In the menu, select Partition|Unmount
  8. If there is more than 1 partition on the SD card, use the previous two instructions to unmount them all.
  9. The next command cannot be undone. Make sure you are working on the right device.
  10. In the menu, select Device|Create Partition Table.
    By default, gparted will make an msdos partition table. This is correct. Click the Create button.
  11. gparted will return with the SD card completely unallocated.
  12. Click on the unallocated area (the same place the partition used to be).
  13. In the menu, select Partition | Create New Partition. You will see this dialogue box. Fill it out as specified below:
    Create as: Primary Partition (Red Circle 1)
    File System: ext3 (Blue Circle 2)
    Label: BalsaRoot (Green Circle 3)
  14. Click on the Add button.
  15. The main gparted screen will come back. It won't create the partition until you click the green check mark (Red Circle below)
  16. gparted will create the partition with an empty file system. When you mount the SD, it should look like this:

Step 4: copy/update the BALSA build onto the SD card

Mount the SD card and cd into to the balsa-card directory you created in step 2.

The following commands assume that the SD card is mounted as /media/BalsaRoot. If it's not, replace /media/BalsaRoot in the next command with the mount point from your system.

sudo rsync --delete -axHAX ./ /media/BalsaRoot

If you want to monitor the progress of the rsync replace the last command above with:

sudo rsync --delete -axHAX --progress ./ /media/BalsaRoot

Boot into Balsa and configure it for a language project

Follow the steps here Set up a computer to boot into Balsa

and then here: First time you boot into Balsa

To do