Difference between revisions of "EBC Updating the Beagle OS"

From eLinux.org
Jump to: navigation, search
m (Added eMMC flasher instructions)
m (Installing a minimal image on the eMMC)
Line 25: Line 25:
 
Select the SD Drive then unmount any partitions that have mounted. Note at the top of the Disks window is the path to the device. In my case it’s '''/dev/sdb'''. We’ll use this path in a moment
 
Select the SD Drive then unmount any partitions that have mounted. Note at the top of the Disks window is the path to the device. In my case it’s '''/dev/sdb'''. We’ll use this path in a moment
  
Go to http://rcn-ee.net/deb/testing and select the newest date and click on it. You now have the option to select '''console''' or '''lxde'''. '''console''' is the minimal image, so select it.  You now have four choices, pick the one that starts with '''BBB-eMMC-flasher'''. It should be a quick download since it's only 58M or so. Download it.
+
Go to http://rcn-ee.net/deb/testing and select the newest date and click on it. You now have the option to select '''console''' or '''lxde'''. '''console''' is the minimal image, so select it.  You now have four choices, pick the one that starts with '''BBB-eMMC-flasher-'''. It should be a quick download (a minute or so on a quick connection) since it's only 58M or so. Download it. Your file name may look different than mine, but that's OK if it starts with BBB-eMMC-flasher. Next, unzip it with:
  
 +
host$ '''unxz BBB-eMMC-flasher-debian-7.6-console-armhf-2014-08-05-2gb.img.xz'''
  
 +
This takes about a minute.  Then copy it to the SD card. Make sure your '''of=/dev/sdb''' matches what you noted above since it may differ from mine.
  
host$ '''unxz BBB-eMMC-flasher-debian-7.6-console-armhf-2014-08-05-2gb.img.xz'''
 
 
  host$ '''sudo dd if=BBB-eMMC-flasher-debian-7.6-console-armhf-2014-08-05-2gb.img of=/dev/sdb bs=8M'''
 
  host$ '''sudo dd if=BBB-eMMC-flasher-debian-7.6-console-armhf-2014-08-05-2gb.img of=/dev/sdb bs=8M'''
  
Downloading takes about a minute on a fast connection, the '''unxz''' command takes an other minute and the '''dd''' takes 5 to 10 minutes.
+
The '''dd''' takes 5 to 10 minutes.
 +
 
 +
Once you have your SD card flashed, put it in the Bone and while holding down the '''S2''' button (the one nearest the SD card slot) and power it up.  The USER LEDs should start flashing. What's happening is the Bone is booting off the SD card and then copying itself to the eMMC.
  
Once you have your SD card flashed, put it in the Bone and power it up.  The USER LEDs should start flashing.  After a 10 minutes or so they will stop flashing and all turn off. Once this happens, power off the Bone, and eject the SD card.  
+
After 10 minutes or so the LEDs will stop flashing and all turn off. Once this happens, power off the Bone, and eject the SD card.  
  
 
You Bone is ready to boot from the new image in the eMMC, but let's not boot from it yet.
 
You Bone is ready to boot from the new image in the eMMC, but let's not boot from it yet.

Revision as of 17:35, 6 August 2014

thumb‎ Embedded Linux Class by Mark A. Yoder

Openlogo-50.png


In this class we run The Debian Distribution on BeagleBone Black. Debian now ships on the eMMC of the Bone. Here's how to tell what version you are running and how to update it.

Finding the version of the running OS

Attach your Bone to your Linux host via the USB cable. Once it's booted, on your host run:

host$ ssh -X 192.168.7.2
Warning: Permanently added '192.168.7.2' (ECDSA) to the list of known hosts.
Last login: Wed Aug  6 11:24:41 2014 from yoder-linux.local
bone$ cat /etc/dogtag
BeagleBoard.org BeagleBone Debian Image 2014-08-05

I'm running the 5-Aug-2014 version Debian. If /etc/dogtag doesn't exist, or is older than shown here, you need to update your image.

Updating your SD image

The Bone can boot from either the built in eMMC (either 2G or 4G depending on which version of BeagleBone Black you have), or from the micro SD card. For this class we'll be booting from the SD card. It's faster to flash, and if you mess up something it's easier and quicker to recover. Booting to newer versions of the OS on the SD card require the eMMC be updated. Yup, that's right, to boot from the SD card you need to update the eMMC. Here's I'll show you how to install a minimal image on the eMMC and then a full image on an SD card.

Installing a minimal image on the eMMC

Plug your SD card into a reader on your Linux host and run Disks.

Unmounting the SD card

Select the SD Drive then unmount any partitions that have mounted. Note at the top of the Disks window is the path to the device. In my case it’s /dev/sdb. We’ll use this path in a moment

Go to http://rcn-ee.net/deb/testing and select the newest date and click on it. You now have the option to select console or lxde. console is the minimal image, so select it. You now have four choices, pick the one that starts with BBB-eMMC-flasher-. It should be a quick download (a minute or so on a quick connection) since it's only 58M or so. Download it. Your file name may look different than mine, but that's OK if it starts with BBB-eMMC-flasher. Next, unzip it with:

host$ unxz BBB-eMMC-flasher-debian-7.6-console-armhf-2014-08-05-2gb.img.xz

This takes about a minute. Then copy it to the SD card. Make sure your of=/dev/sdb matches what you noted above since it may differ from mine.

host$ sudo dd if=BBB-eMMC-flasher-debian-7.6-console-armhf-2014-08-05-2gb.img of=/dev/sdb bs=8M

The dd takes 5 to 10 minutes.

Once you have your SD card flashed, put it in the Bone and while holding down the S2 button (the one nearest the SD card slot) and power it up. The USER LEDs should start flashing. What's happening is the Bone is booting off the SD card and then copying itself to the eMMC.

After 10 minutes or so the LEDs will stop flashing and all turn off. Once this happens, power off the Bone, and eject the SD card.

You Bone is ready to boot from the new image in the eMMC, but let's not boot from it yet.

Installing a full image on the SD card

We need to repeat the above steps with a different image for the SD card.

Once you have your SD card flashed, put it in the Bone and power it up. The USB drive, etc. should appear as before. Open up Cloud9 (“Edit a file using Cloud9 IDE”) and in the bash tab enter:

root@beaglebone:/var/lib/cloud9# df -h Filesystem Size Used Avail Use% Mounted on rootfs 3.5G 1.9G 1.5G 57% / udev 10M 0 10M 0% /dev tmpfs 100M 896K 99M 1% /run /dev/mmcblk0p2 3.5G 1.9G 1.5G 57% / tmpfs 249M 0 249M 0% /dev/shm tmpfs 249M 0 249M 0% /sys/fs/cgroup tmpfs 100M 0 100M 0% /run/user tmpfs 5.0M 0 5.0M 0% /run/lock /dev/mmcblk0p1 96M 72M 25M 75% /boot/uboot /dev/mmcblk1p2 1.7G 1.3G 322M 81% /media/Angstrom /dev/mmcblk1p1 70M 54M 16M 78% /media/BEAGLEBONE This prints out how much disk is free. The first line is the one we’re interested in. If the Size is much smaller than the size of your SD card, you need to resize your partition. Just enter:

root@beaglebone:/var/lib/cloud9# cd /opt/scripts/tools/ root@beaglebone:/opt/scripts/tools# ./grow_partition.sh root@beaglebone:/opt/scripts/tools# reboot This clever script will figure out how big the partition can be and grow it to that size. A reboot is necessary.




thumb‎ Embedded Linux Class by Mark A. Yoder