Professional Documents
Culture Documents
======================================================================
==========
$ sudo fdisk /dev/sdb
======================================================================
==========
Command (m for help): p
======================================================================
==========
Command (m for help): x
======================================================================
==========
Now we want to set the geometry to 255 heads, 63 sectors and calculate the number of
cylinders required for the particular SD/MMC card:
======================================================================
==========
Expert command (m for help): h
Number of heads (1-256, default 4): 255
NOTE: Be especially careful in the next step. First calculate the number of cylinders as follows:
B = Card size in bytes (you got it before, in the second step when you printed the info out)
C = Number of cylinders
C=B/255/63/512
When you get the number, you round it DOWN. Thus, if you got 108.8 you'll be using 108
cylinders.
======================================================================
==========
Expert command (m for help): c
Number of cylinders (1-1048576, default 1011): 15
======================================================================
==========
In this case 128MB card is used (reported as 128450560 bytes by fdisk above), thus
128450560 / 255 / 63 / 512 = 15.6 rounded down to 15 cylinders. Numbers there are 255 heads,
63 sectors, 512 bytes per sector.
So far so good, now we wanna create two partitions. One for the boot image, one for our distro.
Let's check what another wiki page has to say about it:
Create the FAT32 partition for booting and transferring files from Windows. Mark it as bootable.
======================================================================
==========
Expert command (m for help): r
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-245, default 1): (press Enter)
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-245, default 245): +50
======================================================================
==========
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (52-245, default 52): (press Enter)
Using default value 52
Last cylinder or +size or +sizeM or +sizeK (52-245, default
245):(press Enter)
Using default value 245
======================================================================
==========
======================================================================
==========
Command (m for help): p
NOTE: If the partitions (/dev/sdc1 and /dev/sdc2) does not exist, you should unplug the card
and plug it back in. Linux will now be able to detect the new partitions.
======================================================================
==========
$ sudo mkfs.msdos -F 32 /dev/sdc1 -n LABEL
mkfs.msdos 2.11 (12 Mar 2005)
All done!
NOTE: For convenience, you can add the -L option to the mkfs.ext3 command to assign a
volume label to the new ext3 filesystem. If you do that, the new (automatic) mount point
under /media when you insert that SD card into some Linux hosts will be based on that label. If
there's no label, the new mount point will most likely be a long hex string, so assigning a label
makes manual mounting on the host more convenient.
First of all, let's download the files we're going to need from:
For certain images (such as the images generated by the Narcissus build system), no separate
uImage exists. You can find the uImage in the /boot directory of the root filesystem. Just copy
the uImage-x.xx... to the vfat partition and rename it.
Now you must copy MLO, u-boot.bin and uImage into the first partition (the FAT32 one) of your
SD card. Do it in this strict order, since MLO must be in the first sectors of the card.
Mount both partitions somewhere -- I'll assume they're mounted in /mnt/sda1 and /mnt/sda2,
respectively.
$ cp MLO /mnt/sda1
$ cp u-boot.bin /mnt/sda1
$ cp uImage /mnt/sda1
Now let's copy the root filesystem into the other partition (the ext3 one):
and untar it. (IMPORTANT: You must untar directly onto the SD card. Do not untar somewhere
else and then copy to the SD):
$ cd /mnt/sda2
$ sudo tar -jxvf Angstrom-Beagleboard-demo-image....
(If you get "permission denied" errors while copying or untarring it to the SD Card then issue
that command using 'sudo' e.g "sudo cp Angstrom-Beagleboard-demo-image..... /mnt/sda2")
$ sudo rm Angstrom-Beagleboard-demo-image....
If you downloaded the modules-2.6.X-rX-beagleboard.tgz modules file you'll need to copy and
untar it:
$ sudo rm modules-2.6.X-rX-beagleboard.tgz
If you are running a current version of U-boot you can skip to the next section. The newer
versions have bootargs and bootcmd set to the correct values. Note the newest version
requires kernel parameters to be passed to the g_ether module:
Ok, we're almost done. Now we need to tell our BeagleBoard that we want it to boot from the
SD card. Let's go back to our almost-forgotten minicom shell:
OMAP3 beagleboard.org #
You might also want to configure your screen resolution at this time.
Now we want to save these variables into the NAND Flash so we don't have to type them in
every time we reboot:
# saveenv
#cd /lib/modules/2.6.29-omap1/kernel/drivers/usb/gadget
#modprobe g_ether host_addr=16:0F:15:5A:E1:21
dev_addr=16:0F:15:5A:E1:20
Configure networking
The beagleboard will now show up as Auto usb0 on Ubuntu. You can add it automatically by
making some udev rules.
#!/bin/sh
(
busNum=$( printf %.2d $( expr match "$1" "usb\([0-9]*\)") )
ip link set "$1" address 16:0F:15:5A:E1:21:$busNum &> /dev/null
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -P FORWARD ACCEPT
) &
exit 0
You can now connect to your beagleboard using any VNC viewer and you should be able to
access the internet from your beagleboard.
Note: if your beagleboard can't resolve external URLs (#ping elinux.org) you might need to
replace the resolv.conf settings with those from your host. From Ubuntu:
Note: if you fail to ping host or beagle and is on revision C4 you might want to try adding
'g_ether.use_eem=0' as a boot argument
(See BeagleBoardBeginners#Setting_up_the_boot_args)