In order to install Ubuntu on the BeagleBone Black, essentially two steps need to be taken. The first step is imaging an SD card with Ubuntu because in order to flash the eMMC memory with Ubuntu, you CANNOT be booted to the eMMC, you need to be booted off of an external source (i.e. an SD card).
Install Ubuntu to the SD Card
On your computer (not on the Beaglebone Black) you need to image an SD card with the Ubuntu image. Luckily a man named Robert Nelson has created an amazing shell script that images SD cards for you and makes them bootable. Note: you must use this method to create the Ubuntu image, I tried using Win32DiskImager and flashnul to image my SD card and both did not work.
On your Linux computer (if you do not have Linux, try Cygwin):
First download the image from RCN-EE:
$ wget [Edit: get an image from the link above, they remove old images.]
Then, unpack the TAR file and change directory into the directory automatically created:
$ tar xJf ubuntu-13.04-console-armhf-2013-04-26.tar.xz
$ cd ubuntu-13.04-console-armhf-2013-04-26
Now probe your computer to find where the SD card is located (assuming you have plugged in the SD card already) and then run the command to start the setup_sdcard.sh script on the selected SD card (in my case /dev/sdc):
$ sudo ./setup_sdcard.sh --probe-mmc
$ sudo ./setup_sdcard.sh --mmc /dev/sdc --uboot bone_dtb
Once the SD card is successfully imaged, you now have a bootable Ubuntu SD card for the Beaglebone Black. Take out the SD card, plug it into the Beaglebone Black's SD card reader and boot the device while holding down the USER/BOOT button (located right next to the SD card reader) to boot to the Beaglebone Black from the SD card.
Installing Ubuntu on the BeagleBone Black's internal eMMC (optional)
Once you have Ubuntu on the SD card, you do not need to image the BeagleBone Black's internal eMMC with the same image, you can just simply use the SD card. I recommend using the eMMC portion because it is much faster than using an SD card.
On the BeagleBone Black:
While booted into the BeagleBone Black on an SD card (NOT on the eMMC!) download the Ubuntu image again:
$ wget http://rcn-ee.net/deb/rootfs/raring/ubuntu-13.04-console-armhf-2013-04-26.tar.xz
Then, unpack the TAR file and change directory into the directory automatically created:
$ tar xJf ubuntu-13.04-console-armhf-2013-04-26.tar.xz
$ cd ubuntu-13.04-console-armhf-2013-04-26
Now probe your BeagleBone Black to verify that the eMMC is located in /dev/mmcblk1 and then run the command to start the setup_sdcard.sh script on the eMMC portion (if you receive a probe readout after running the setup_sdcard.sh file that means you need to edit the shell file like I had to, see below):
$ sudo -s ./setup_sdcard.sh --probe-mmc
$ sudo -s ./setup_sdcard.sh --mmc /dev/mmcblk1 --uboot bone_dtb
Now when I was running the shell file on the mmcblk1 portion, I was unable to get it to work, it kept giving me a probe readout saying it was unable to find mmcblk1. In order to fix this, I had to edit the shell file. Remove this portion of code from the setup_sdcard.sh file in the check_mmc() function:
else
echo ""
echo "Are you sure? I Don't see [${MMC}], here is what I do see..."
echo ""
echo "$FDISK_EXEC -l:"
LC_ALL=C $FDISK_EXEC -l 2>/dev/null | grep "Disk /dev/" --color=never
echo ""
echo "mount:"
mount | grep -v none | grep "/dev/" --color=never
echo ""
exit
Now rerun the same command as before, and now instead of giving you a probe readout, it should begin formatting the eMMC memory. Once that is done, shutdown the BeagleBone Black, unplug the SD card (NOTE: you CANNOT leave an SD card in the BeagleBone Black that contains an .img file, as it will prioritize boot to the SD card!), and boot the device up as normal.
Once the device boots up without the SD card, you should be running Ubuntu now and not Angstrom.
Update: some users have reported some dependencies are needed to complete the install process. Check the comments for more information.
Sept. 17, 2012, 10:42 p.m.
Yesterday, I added a new feature to the site, an RSS feed of my blog. This feature was really easy to implement thanks to Django. Django comes with an RSS feed function which consists of a class:
from django.contrib.syndication.views import Feed
which you use to subclass with your Feed class. When you do this, it allows you to inject defined content and then Django will construct the RSS feed consisting of the given information. For more details on the ins-and-outs of the syndication feed framework visit the django documentation.
What this post is assuming is that you have already become familiar with how the syndication feed framework works and you are looking to begin creating your RSS feed with the Feed subclass.
Getting Started
I first created a django app called "feeds", the reason I did this was because you need a place to store the feeds.py file and this was the best solution in my opinion.
I then created my Feeds subclass file called "feeds.py" and placed it into my feeds app folder.
Here is what my feeds.py file consists off:
// Importing the syndication feed and my Article class from my blog model.
from django.contrib.syndication.views import Feed
from blog.models import Article
class BlogFeed(Feed):
// Here I am setting the default RSS information that gets shown at the top of the feed.
title = "ZachRohde.com"
link = "/blog/" // See the last portion of this post for information on this part
description = "Recent Blog Entries on ZachRohde.com"
// These are my "hard-coded" author information.
author_email = 'zach@zachrohde.com'
author_link = 'http://zachrohde.com'
// Here I am pointing to my custom templates for the blog title and blog description, I will talk about these in a little.
title_template = '_feeds/blog_title.html'
description_template = '_feeds/blog_description.html'
// This pulls the blog.model's charfield "author" so that the author's name can be dynamic (I just did this to future proof).
def item_author_name(self, item):
return item.author
def items(self):
return Article.objects.filter(enabled=True).order_by('-created')[:10]
// This pulls the blog.model's datefield "created" which just shows when the blog post was made.
def item_pubdate(self, item):
return item.created
Now you are probably wondering what that title_template and title_description stuff was, now I will tell you! So Django allows you to customize the look and feel of the RSS feed by just simply creating a couple templates. I will go into more detail when I show the two below.
Here is my blog_template file:
// I currently have no customizations on the title, so it just simply outputs the blog.model's charfield "title" which contains the blog posts' title.
{{ obj.title }}
Here is my blog_description file:
// Since I have no "summary" field or the like in my blog model I just simply truncate the blog posts' content to create a summary (which is why I needed to customize the RSS feed!)
{% autoescape off %}
{{ obj.body|truncatewords_html:60 }}
{% endautoescape %}
// Here I am displaying the current comment count for the article.
<a title="View comments for: {{ obj.title }}" href="{{ obj.get_absolute_url }}/#comments">[{{ article.comments|length }}] {% if article.comments|length == 1 %}Comment{% else %}Comments{% endif %}</a>
Now you need to add a one little statement in your main url.py file:
// Importing the usual and importing the BlogFeed Feed class (very important!)
from django.conf.urls import patterns, include, url
from feeds.feed import BlogFeed
urlpatterns = patterns('',
// I cut out the other URL stuff...
// Here I am creating the URL and putting in an instance of the feed object.
url(r'^feeds/blog/$', BlogFeed()),
)
And that's it! You are done! You have just created your first Django powered RSS feed which with the template trick, will allow you to customize the content it pulls. Now if you are having troubles with the URL stuff, the following might help you.
So I was running into the issue where I couldn't get the contents of "link" (inside feed.py) to populate correctly. "Link" is where Django tries getting the associated blog post link for each article, so you have to do a couple of things to get that to work.
Additional Issues
The first thing you need to do if you have not already added this to your blog's model is to define an absolute URL:
// This goes inside your blog.model or the like...
@models.permalink
def get_absolute_url(self):
return ('blog.views.article', (), {
'year': self.created.year,
'month': self.created.strftime('%m'),
'slug': self.slug})
Once you have that, Django can then execute
get_absolute_url()
on the object and it will return with the exact URL. Then inside your feed.py file, just have the starting URL for the link value, for example mine is /blog/ because it is zachrohde.com/blog/2012...
I hope that this little tutorial was useful to those of you having a bit of troubles. Leave a comment if you have any questions or concerns!
Aug. 19, 2012, 10:42 p.m.
This was the first website I have ever created, so it was a big milestone for me in terms of web programming and designing. I spent a lot of time creating ZachRohde.com, approximately 150 hours as of now. A lot of that time was learning the basics: HTML and CSS, but a big portion of that time was spent learning Python and the Django Web Framework and how it all comes together to create a beautifully organized website. In terms of the design, the design just kind of came together in my mind, I spent a few days browsing websites that have won awards or design contests to see how some of the best web designers design a website. I took all that useful information and began shaping my website to what it is now.
The purpose of this website is to give me a place to express my opinions, share useful information, and to show off work that I have done. I will be adding more content to the blog pretty soon, so stay tuned.
If you wish to learn more about the website and what it was created with, head on over to my about page.
If you wish to get into contact with me, visit my contact page.