How to get Debian on a Seagate GoFlex Net device

15

Update on 05.06.2013: Due to still interested I dded “USB device partitioning” and other small things to this tutorial.

After using my Seagate Dockstar more than one year, a friend moved into town and wanted something similiar for home uses… Now as the pogoplugs are too pricy and old Dockstar’s are pretty rare in Europe (and even then around 60€ used…) I ran into the Seagate GoFlex Net.

Seagate GoFlex Net Device

On the hardware side, nothing much has changed there. The GoFlex has just only one USB Port – which is in fact not much. So you shouldn’t use too many USB Hubs and/or devices with much wattage or bandwidth at it. But on the bright side, there is a SATA port on the top which is really useful when you are trying some sort of backup/webserver or download machine…
Another fun part is the nice black case and the 8 LED’s built into the front. They are stacked on each side, so 2×4 LEDs which are fully programmable through the kernel/sysfs. They are used in the Pogoplug software to display the amount of data which is currently lockated on the docked hdds in the top. But who wants to use that crappy software…

So next step was to get debian on that thingy – and again Jeff Doozan is there to help. His scripts, created over a year ago, were fine tuned and loads of other Pogoplug devices are supported now. And they come in very handy even for those who don’t hack hardware every day.
So if you need any help or if you’re running into problems, just visit the forum there: http://forum.doozan.com/index.php

IMPORTANT: I take no guarantee/warranty for this how to, so live with a possibly bricked device. Don’t blame me! (There are some ways and cases, where unbricking is possible, like using a UART/JTAG cable)
It might be also very useful, to rescue a print out of your U-Boot environmental settings as soon as you can play with them – just in case!

 

Part one: Prepare SSH Connection

To get started, power your GoFlex up, connect it into your LAN with web access. The first goal now is to get access to the device via SSH. It is currently booting the PlugOS software and there is atm no direct way to get access to it.

Pogoplug shows up on LAN

Pogoplug shows up on LAN

As I bought this device I read across some german forum and found out, that the PlugOS closes the SSH access with GoFlex Net Build dates around july/august 2012. So, yay, I got a pretty new one with no acces. Bad luck, anyway:

http://knowledge.seagate.com/articles/en_US/FAQ/214571en?language=en_US
Seagate themselves are pointing out here how to get access to the device…

So go the the pogoplug website and create yourself an account if you don’t already have one.
After logging in, your pogoplug device should appear on the website. Find the settings tab (well hidden – I needed my girlfriend to find it for me…)

The Pogoplug website with menu

The Pogoplug website with menu

and active the SSH access remotely:

Pogoplug website with security settings

Pogoplug website with security settings

Important: IF this option (enable SSH) does NOT appear on the website, there is potentially something wrong with your routers firewall. (blocking ports, no uPNP – depends). If the SSH port 22 is blocked, its blocked. (found here: GoFlex net missing from LAN

After that, you should be able to SSH into the device:

First SSH logon

First SSH logon

The Username should be “root” and the password should be “root” or “stxadmin” (i.e. on classic dockstars) here.

So Jeff has written scripts for different things:

Installing Debian and Updating U-Boot: http://projects.doozan.com/debian/
Just Updating U-Boot: http://projects.doozan.com/uboot/
There are tutorials, so you should at least take a look at it.

To be up-to-date, I’m using the newest Debian called “Wheezy”. There are also scripts available for bootstraped “Squeeze”. These scripts also automatically update the U-Boot bootloader to the latest version.

 

Part two: Prepare Boot device (USB)

First you should create yourself a root device (i.e. USB memory stick) where the rootfs should be placed with:

user@computer:$ fdisk /dev/sda

You can see all available partitions on that device with the “p” command. Be sure to remove all old partitions from the stick/disk with “d”.
I’m using a 16GB USB 3.0 USB stick from Lexar, which then looks like:

user@computer:$ Command (m for help): p
Disk /dev/sda: 16.0 GB, 16022241280 bytes
237 heads, 17 sectors/track, 7767 cylinders
Units = cylinders of 4029 * 512 = 2062848 bytes
Device Boot Start End Blocks Id System

Now you need to add two primary partitions.

user@computer:$ n p 1 1 +15000M
n p 2 [enter] [enter]

“n” and “p” add a new primary partitiion, the first number is the number of the partition (here 1 and 2), the second number is the start cylinder and the last is the wanted size. So here I’m creating the first primary partition with 15GB space and the second primary partition with the rest of it (default values used then).

user@computer:$ t 2 82

Another step is to change the file system id of the second partition to swap. The last step is to look at everything again with “p”:

user@computer:$ Device Boot Start End Blocks Id System
/dev/sda1 1 7500 15108741+ 83 Linux
/dev/sda2 7501 7767 537871+ 82 Linux swap / Solaris

Save everything with “w” and exit.

 

Part three: Install on USB Disk with workaround

Now you need to make everything ready for the script and start it:

user@computer:$ export PATH=$PATH:/usr/sbin:/sbin
user@computer:$ cd /tmp
user@computer:$ wget http://projects.doozan.com/debian/kirkwood.debian-wheezy.sh
user@computer:$ chmod +x kirkwood.debian-wheezy.sh
user@computer:$ ./kirkwood.debian-wheezy.sh

Now it’s taking some time…

...
# Validating existing uBoot...
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00080000...
Connecting to jeff.doozan.com (50.116.34.13:80)
valid-uboot.md5      100% |*******************************|  1133  --:--:-- ETA
## Valid uBoot detected: [goflexnet original]
killall: hbwd: no process killed
...

The installer will ask you if you want to disable pogoplug services, which is appreciated and normal:

...
DISABLE POGOPLUG SERVICES
The pogoplug service includes an auto-update feature which could
be used to cripple or disable your device.  It is recommended
that you disable this service.
Would you like to disable the pogoplug services? [Y/n]
...

But after installing packages I ran into following error:

...
Connecting to cdn.debian.net (195.71.68.86:80)
xz-utils_5.1.1alpha+ 100% |*******************************|   232k 00:00:00 ETA
Connecting to cdn.debian.net (195.71.68.86:80)
zlib1g_1%3a1.2.7.dfs 100% |*******************************| 87460  00:00:00 ETA
FATAL: kernel too old

Obviously the standard running kernel from GoFlex Net

user@computer:$ uname -a
Linux Pogoplug 2.6.22.18 #81 Tue Oct 19 16:05:00 PDT 2010 armv5tejl unknown

is too old to compile/install some of the packages correctly.
This is a huge problem, because at this point the U-Boot Bootloader got updated, but no working debian filesystem was installed, so rebooting the GoFlex will either end in no boot of the debian device nor getting access via SSH – because of the disabled pogoplug services.

To fix this I needed to download an version of Jeff’s/Dave’s Rescue System, available in Version 3 here.

Download it, copy it to the first non-swap partition (ext2) on the usb drive and untar it there. After that, plug the usb drive back into the GoFlex USB Slot and poweroff/poweron. Wait some time until the LED turns off and then, wait some time again and SSH will be back online. You should be now running the rescue system, a stripped down debian version, from the plugged USB drive.

But that is not our goal, just a workaround to get a newer kernel/environment. So the next step is to install the Rescue System to the NAND memory inside the GoFlex, so that we can always use it.
Some explanations and the full story can be found in Jeffs Forum Rescue Thread.
To install the rescue system do:

user@computer:$ cd /tmp
user@computer:$ wget http://jeff.doozan.com/debian/rescue/install_rescue.sh
user@computer:$ chmod +x install_rescue.sh
user@computer:$ ./install_rescue.sh

Now the rescue system will be hard written into the GoFlex, so after finishing that, reboot and unplug the USB stick. Delete all files from the second ext2 partition (the old rescue system) and plug it back in. Make a reboot and you now should be running the hardcoded Rescue OS in combination with a clean USB stick.

Now we are following the already known procedure from Jeff which is documented here

user@computer:$ cd /tmp
user@computer:$ wget http://projects.doozan.com/debian/kirkwood.debian-wheezy.sh
user@computer:$ chmod +x kirkwood.debian-wheezy.sh
user@computer:$ export PATH=$PATH:/usr/sbin:/sbin

Next step is to start the install script which will download and install everything

user@computer:$ ./kirkwood.debian-wheezy.sh

Doing so brings us the following error:

touch: /sbin/01011970001622: Read-only file system

Your perl subsystem does not have support for $ENV{}
and must be disabled for debootstrap to work
Please disable perl by running the following command

chmod -x /usr/bin/perl

After perl is disabled, you can re-run this script.
To re-enable perl after installation, run:

chmod +x /usr/bin/perl

Installation aborted.

The rescue rootfs is mounted read only, as easy be checked by:

user@computer:$ chmod -x /usr/bin/perl
chmod: /usr/bin/perl: Read-only file system

So you need to make it writable, too:

user@computer:$ mount -o remount,rw /

Now we need to remove the debootstrap, as Jeff mentioned in this Thread

user@computer:$ rm /usr/sbin/debootstrap
user@computer:$ rm -rf /usr/share/debootstrap
user@computer:$ chmod 666 /usr/bin/microperl
user@computer:$ mount -o remount,ro /

Now start the script again by

user@computer:$ ./kirkwood.debian-wheezy.sh

and get some coffee. Depending on your internet connection and the speed of your USB drive, it may take a while…

After a lot of this and that

...
I: Unpacking libtext-wrapi18n-perl...
I: Unpacking lsb-base...
...
I: Configuring libkeyutils1:armel...
I: Configuring iproute...
...
I: Base system installed successfully.
Image Name:   Linux-3.2.0-3-kirkwood
Created:      Thu Jan  1 01:07:31 1970
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    1599648 Bytes = 1562.16 kB = 1.53 MB
Load Address: 00008000
Entry Point:  00008000
Image Name:   initramfs-3.2.0-3-kirkwood
Created:      Thu Jan  1 01:07:32 1970
Image Type:   ARM Linux RAMDisk Image (gzip compressed)
Data Size:    6741832 Bytes = 6583.82 kB = 6.43 MB
Load Address: 00000000
Entry Point:  00000000

we finally get

Installation complete

You can now reboot your device into Debian.
If your device does not start Debian after rebooting,
you may need to restart the device by disconnecting the power.

The new root password is 'root'  Please change it immediately after
logging in.

Reboot now? [Y/n]

Now you’re nearly ready.

 

Part four: Reboot and setup

Reboot and change the root password with:

user@computer:$ passwd root

To print out your U-Boot environmental settings, you can use the command

user@computer:$ fw_printenv

If you have also overwritten your old uboot config, you should set your MAC address to the old value or just choose a new one

user@computer:$ fw_setenv ethaddr 00:10:75:26:69:15

and you if you are using the Seagate GoFlex Net you can also enable the main LED-control for the kernel by changing

user@computer:$ fw_setenv arcNumber 3089

This should be also valid for the Seagate Flex Home. Additionally, the original oldschool Dockstar/Sheevaplug use the arcNumber 2097.

Last step should be to update and upgrade your current package list (and reboot):

user@computer:$ apt-get update
apt-get upgrade
reboot

 

Part five: Finish

A couple of things you should possibly think of:

    • Instal some useful programs (from my point ov view)
      user@computer:$ apt-get install apt-utils cron tzdata ntp psmisc vim sudo
    • match system timezone to yours
      user@computer:$ dpkg-reconfigure tzdata
    • As there is no RTC (time-module) on the dockstar, the time offset will grow larger over the time, so you should make a cronjob which corrects the time. Start “crontab” and add the line for a every 15min check:
      user@computer:$ crontab -e
      0-59/15 * * * * ntpdate -u pool.ntp.org
    • Add another normal user (i.e. admin):
      user@computer:$ adduser admin

To give him super user rights, add him to the “sudoers” file using “visudo”:

user@computer:$ visudo
admin ALL=(ALL) ALL

Thanks for reading!

Change virtual NIC in VMWare from AMD to Intel

0

As I am planing to use RTNet as the network protocol in my upcoming project, I needed my virtual machine to have a Intel NIC. As I installed an Ubuntu 12.04.1 ony my VMWare Workstation 9, I found out, that as default, even with VMWare Tools installed, the machine used the PCNET32 NIC from AMD which gave me 10Mbit…

To get rid of that you need to edit your virtual machines *.vmx file and add a new line (which wasn’t here before):
ethernet0.virtualDev = "e1000e"

Maybe you need to edit the number if you have multiple virtual NICs in your machine. Also you can choose to use the “e1000″ driver instead, which uses then an older version of simulated INTEL Nic.

A nice overview can be found at a VMWare Knowledgebase article

Short on updates

0

As I recently couldn’t get my hands on new development boards the number of updates was nearly zero. I had to give away my pandaboard in january, so i can’t play with it anymore.

I’m trying to get a Beaglebone or equal in the future if I will find the time.

Up-to-date kernel for pandaboard

2

Hey guys,

After getting a lot of traffic (according to google analytics) on the pandaboard kernel topic i recently decided to add another post about that.

As I’m currently stuck in my project with some strange USB driver problem, I had time to checkout all the new cool kernel stuff in the 3.X branch.
After drooling around in the web I found a link to Robert C. Nelsons stuff over at github.
It looks like he is really into kernel developing and also a fan of the OMAP branch which is great news for us noob or semi-noob guys. He is supplying a lot of scripts and patches that fix bugs in the original mainline stable kernel sources automagically (that’s the point!) for us.

In this post I’ll try to write a step-by-step guide in using his stuff.

So first, the kernel.

Go to your home directory

gr3yh0und@builder:$ cd ~

Get Roberts latest release from github

gr3yh0und@builder:$ git clone https://github.com/RobertCNelson/stable-kernel.git

Now change into the new folder and get the latest torvalds mainline kernel source from kernel.org

gr3yh0und@builder:$ cd stable-kernel
gr3yh0und@builder:$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

This can take some time… So time for coffee!

To compile anything you need you have to setup a cross compiling toolchain or do it natively on the board (no good idea though)… I’m assuming that here.

Next is to rename the config file

gr3yh0und@builder:$ mv system.sh.sample system.sh

and edit it

gr3yh0und@builder:$ vim system.sh

Though we are cross-compiling at that point, you have to uncomment the lines (around line 25 and 42)
#CC=arm-none-linux-gnueabi-
and
#LINUX_GIT=/path/to/source
As you can see, you have to edit the last uncommented line and add the path to the kernel mainline sources. If you are using your home folder this would be something like
LINUX_GIT=/home/user/stable-kernel/linux-stable

There are two possible ways in the stable-kernel folder:
* build_kernel.sh
* build_deb.sh

As the filename is implicating, one builds only the kernel and the other one makes a debian installer (.deb). As I’m currently using Ubuntu Oneiric on my pandaboard a deb file comes in very handy…
But the basic script only creates a zImage of the kernel, which I’m not using in uboot – so I added two lines to the build bash scripts:

gr3yh0und@builder:$ diff build_deb.sh build_deb.sh.old
146d145
< time fakeroot make -j${CORES} ARCH=arm KBUILD_DEBARCH=${DEBARCH} LOCALVERSION=-${BUILD} CROSS_COMPILE="${CCACHE} ${CC}" KDEB_PKGVERSION=${BUILDREV}${DISTRO} uImage
160c159
< make_menuconfig
---
> #make_menuconfig

This will always execute the menuconfig option where you can edit the kernel settings and later also make the uImage required by uboot.

Last step is to get another cup of coffee or maybe a rig with more potential cpu power…

gr3yh0und@builder:$ ./build_deb.sh

Currently, Robert has already ported version 3.1.1! Really great job!

After the script has finished you can use the new uImage and .deb file.
i.e. the uImage can be found in KERNEL/arch/arm/boot/ and the .tar.gz and .debs for kernel/header can be found in “deploy”.

Enjoy!

Minecraft Server Installation on Ubuntu

0

A friend of mine introduced me into minecraft and it’s really cool. Though from a developer perspective, a java based game and server let me get pickles all over the butt…

Well, because of the whole JAVA background, minecraft is not very ressource saving, so plan to get a “good” enough server. If you are hosting it at home, don’t even think about ATOM or stuff, just go for a small AMD Dual Core or Intel Sandy Bridge system. It consumes some more power, but it’s worth it. If you are using a old system and want to host some more players, take a dualcore with minimum of 2 GHZ and 2-4GB of Ram to get it quite fluently. HDD is between 20-80GB, depending on the size and players of your world.

Well, I setup a new Ubuntu 10.04 server from scratch and updated the basics to their latest packages. So that it’s ready to get to the minecraft part.
As a quick start get those packages:

gr3yh0und@minecraftserver:$ sudo apt-get update
gr3yh0und@minecraftserver:$ sudo apt-get upgrade
gr3yh0und@minecraftserver:$ sudo apt-get install openssh-server vim

To get the needed Java binaries/packages, you will need to add a repository to your apt. Do this by

gr3yh0und@minecraftserver:$ vim /etc/apt/sources.list

and add the following two lines to it:
deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner

If you are running any other version of ubuntu than 10.04 than take a look at the different pathes

Now you need to update your package lists again and download the packages:

gr3yh0und@minecraftserver:$ sudo apt-get update
gr3yh0und@minecraftserver:$ apt-get install sun-java6-bin sun-java6-jdk sun-java6-jre

The packages are around ~70MB huge, so dependent of your internet connection you may take a coffee break…

Check that java is correctly install with

gr3yh0und@minecraftserver:$ gr3yh0und@ubuntu:~# java -version

and should see something like this:
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
J ava HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

Now download the minecraft server with

gr3yh0und@minecraftserver:$ wget http://www.minecraft.net/download/minecraft_server.jar?v=1314533852047

and start the server with

gr3yh0und@minecraftserver:$ java -Xmx1024m -Xms1024m -jar minecraft_server.jar nogui

Now all the config files, scripts and the start world will be generated. Now your basic server should be available. Just open your Minecraft client, connect to the server ip and after joining the world, enter “op” into the server console, so that you are allowed to build.

That’s it. Maybe more tutorials about configs are coming soon.

Thanks to firestorm for his older blog post, which I mostly adopted to my case.

Openembedded and Ubuntu

1

Though Buildroot doesn’t give me the satisfaction I like for my embedded project (at the moment) I am looking further into openembedded. The first things here are quite simple, so lets get started:

I’m using a Ubuntu 10.04.03 x86 server OS for those development purposes because I’ve best experiences with Long Term Supported Ubuntu distris.

Attention: If you are setting up the system right now, make sure you have enough disk space. I didn’t do “much” things and reached the 50GB limit of my VHDD easily…

 

I’m assuming that your system (or at least mine here) is fresh installed and blank. So first get all available updates for everything installed at the moment:

gr3yh0und@builder:$ sudo apt-get update
gr3yh0und@builder:$ sudo apt-get upgrade

Now get the building essential things:

gr3yh0und@builder:$ sudo apt-get install sed wget cvs subversion git-core coreutils unzip texi2html texinfo docbook-utils gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ desktop-file-utils chrpath python-ply python-progressbar libxml2-utils xmlto python-psyco policykit-gnome-doc gnome-doc-utils

Maybe you want to add some useful stuff as well:

gr3yh0und@builder:$ sudo apt-get install build-essential autoconf make patch vim nfs-kernel-server

Now go to the directory where you want to have everything (and remember the needed disk space!) and get the obenembedded basic things via git:

gr3yh0und@builder:$ git clone git://git.openembedded.org/openembedded </

 

Note: A good reference for the whole part ist located on the openembedded Website, check it out if you’re having problems!

 

Second step is to create your config. Create the directory build on the same level as openembedded. Create then the directory conf under build. A easy start is to use the sample config already provided by openembedded under “openembedded/conf/local.conf.sample” and copy it to your build directory. Rename it to match “local.conf” and edit the following things in it to match them to your wanted config.

In my case I want support for the pandaboard, so we have to change the following Variables:
DL_DIR = "/build/OE/sources"
BBFILES := "/build/OE/openembedded/recipes/*/*.bb"
MACHINE = "omap4430-panda"
DISTRO = "angstrom-2010.x"
IMAGE_FSTYPES = "tar"
BB_NUMBER_THREADS = "4"
BBINCLUDELOGS = "yes"

I’m using the pandaboard, a Angstrom base root fs and the main directory “build” for all stuff. Set the threads variable according to the number of CPU cores you have available, so that compiling doesn’t take ages…

 

Next step is to get “bitbake” which is a kind of “apt” on the debian side. Openembedded serves you “recipes” for both “packages” and “images”. So images are some kind of a summary of what packages are needed for a purpose (i.e. x11-image makes you a small Xorg root fs). Bitbake is the program, that reads the recipes, “cooks” them and packages them into a .tar for you.

There is a ubuntu package available, but I will use the newest version here. So just get it from <HERE>, in my case 1.12:

gr3yh0und@builder:$ wget http://prdownload.berlios.de/bitbake/bitbake-1.12.0.tar.gz

and untar it into your openembedded directory.

 

The last step is now to get bitbake into your environmental settings, so just execute those two things every time you want to use it or put them into your unix profile settings:

gr3yh0und@builder:$ export BBPATH=/build/OE/build:/build/OE/openembedded
gr3yh0und@builder:$ export PATH=/build/OE/openembedded/bitbake/bin:$PATH

 

Now you can do your first cooking or baking or what the hell you may ever call it:

gr3yh0und@builder:$ bitbake vim

 

Just fyi: It took me an hour on my 2600K CPU… And afterwards the hdd looked like

gr3yh0und@ubuntu:/build/OE$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             9.4G  1.9G  7.1G  21% /
none                 1003M  188K 1003M   1% /dev
none                 1007M     0 1007M   0% /dev/shm
none                 1007M   56K 1007M   1% /var/run
none                 1007M     0 1007M   0% /var/lock
none                 1007M     0 1007M   0% /lib/init/rw
/dev/sdb1              99G   24G   71G  25% /build

 

If you are running into the error
ERROR: Openembedded's config sanity checker detected a potential misconfiguration.
Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
Following is the list of potential problems / advisories:
Using dash as /bin/sh causes various subtle build problems, please use bash instead.
ERROR: Command execution failed: Exited with 1

then you will need to reconfigure your dash with:

gr3yh0und@builder:$ sudo dpkg-reconfigure dash

and select <NO> !

The first time it will take like ages because bitbake will need to download all sources, build the corresponding toolchains etc… So maybe get SOME cups of coffee this time…

Pandaboard and Ubuntu 11.04 headless

0

I’m a great fan of ubuntu as a desktop operation system so I tried to install it on my pandaboard. I don’t think that ubuntu as base OS is sufficient for my goals because it is already very, well, bloated. I will try to develop my applications and give them a shot later on both boats: Ubuntu and a selfmade rootfs with (hopefully) well chosen packages…

But now for the installation part: It’s already very well documented on the Ubuntu site and also on OMAPPedia, but I think i could give it a small Post.

Preparation

First step is to download the wanted image from the Ubuntu website (over here). The newest atm is 11.04 and I chose the headless version because I don’t want to connect one of my 3 monitors here to the DVI port of the pandaboard – But use my 7″ USB Touchscreen instead! So the headless version gives me the ability to go through the normal Ubuntu installation process via a textbash and a serial cable. Great!

Download the image:

gr3yh0und@builder:$ wget http://cdimage.ubuntu.com/releases/11.04/release/ubuntu-11.04-preinstalled-headless-armel+omap4.img.gz

Be sure to get the “omap4″ version, not the “omap” version which is used for OMAP generations 1-3. (pandaboard has 4430!)

Next step is to insert a SD Card in your card reader (equal/greater than 4GB). I’m using a Sandisk Ultra III 4GB here for maximum speed. Check if it is getting mounted with

gr3yh0und@builder:$ dmesg

If it got mounted, unmount it with

gr3yh0und@builder:$ umount /dev/sdX

where X is the letter of your drive.
Now copy the complete installation with the command:

gr3yh0und@builder:$ sudo sh -c 'zcat ubuntu-11.04-preinstalled-headless-armel+omap4.img.gz > /dev/sdX'

This can take some time, so lay back or get another cup of coffee.

root@ubuntu:/panda# time sh -c 'zcat ubuntu-11.04-preinstalled-headless-armel+omap4.img.gz > /dev/sdc'
real 1m53.957s
user 1m1.932s
sys 0m1.732s

Great thing about that image is, that things like X-Loader, U-Boot (Both bootloaders), kernel and filesystem are all included. So it’s simply downloaded, cloning to SD and having fun… Pretty straight forward!

BootUp

Plug in your SD Card and power up the Board. The first output will look like this:

Texas Instruments X-Loader 1.5.0 (Apr 11 2011 - 09:48:22)
Reading boot sector
Loading u-boot.bin from mmc

 

U-Boot 2011.03 (Apr 20 2011 - 07:37:43)
CPU : OMAP4430
Board: OMAP4 Panda
I2C: ready
DRAM: 1 GiB
MMC: OMAP SD/MMC: 0
Using default environment
In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 0
reading boot.scr
350 bytes read
Running bootscript from mmc0 ...
3467529 bytes read
## Booting kernel from Legacy Image at 80000000 ...

 

Image Name: Ubuntu Kernel
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4174676 Bytes = 4 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 81600000 ...
Image Name: Ubuntu Initrd
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 3467465 Bytes = 3.3 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

 

Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Caching vfat content in /dev/.initramfs/jasper-vfat ...
Resizing root partition ...
Re-writing vfat partition ...
Resizing root filesystem. Please wait, this will take a moment ...
Resizing root filesystem ...
Checking filesystem before resizing...
Resizing, please wait...
Resizing, pass: 1 [100/100]Enabling serial console login
Setting up fstab
Setting up swap
Enabling oem-config
Writing flash-kernel configuration
Creating bootloader configuration
Rebooting into configuration session
[ 55.207000] Restarting system.

 

fsck from util-linux-ng 2.17.2
/dev/mmcblk0p2: clean, 45081/481440 files, 299174/975948 blocks
[ 6.315979] (stk) :line disc installation timed out
[ 7.487854] (stk) :line disc installation timed out
[ 8.597198] (stk) :line disc installation timed out
[ 9.714385] (stk) :line disc installation timed out
[ 10.823760] (stk) :line disc installation timed out
[ 11.933135] (stk) :line disc installation timed out
[ 13.042510] (stk) :line disc installation timed out
* Starting AppArmor profiles [ OK ]
[ 14.151885] (stk) :line disc installation timed out
[ 15.253448] (stk) :line disc installation timed out
[ 16.362823] (stk) :line disc installation timed out
[ 17.472229] (stk) :line disc installation timed out
[ 17.477447] fmdrv: Failed to get ST write func pointer
[ 17.483489] (stc): chnl_id 8 not registered
[ 17.487823] fmdrv: Unable to prepare FM CORE

After a reboot the installation itself will take place and a funny windows will load (here on putty):

Continue with your normal installation and select the appropriate packages you want to install (i.e. openssh server etc)

For further info about headless installation and the beagleboard, visit the Ubuntu WIKI.

Pandaboard 6 easy steps boot tutorial

3

As I have recently left out the first main part – compiling and installing the bootloaders of the pandaboard – I will add it in here.

So after unpacking the pandaboard, my first intention was to update all available bootloaders. Though I recently also ordered a Beagleboard, i knew already what to do. OMAP platforms are nearly equivalent in this case because all are produced (or are still I should say if Broadcom really wants to buy TI) by Texas Instruments.

Long story short: There is plenty of information about bootloaders for OMAP platforms spread across the web but I strangled because I had different sources, some patched, some not and a lot of work with the SD card format. Well there are several tutorials for that part, but that doesn’t mean that it’s easy…

So the main mechanism for booting up the Pandaboard are simply 4 Steps:
X-Loader (first bootloader) -> U-Boot (second bootloader) -> Kernel -> Root Filesystem

Because the pandaboard doesn’t have any NAND memory chips onboard, you will need to use a separate SD Card for bootloaders. You can also locate the rootfs on that SD card, but look out that you get at least a 8 der 16GB large which is at minimum specified as class 10 – Or your system will run very sluggish! (which made me depressive at one point, so I switched to sandisk extreme III)

Notice: Though the pandaboard is a ARM based device, you will have to set up a cross compiling toolchain for this. There is another entry on how to do this . I’m assuming for the following commands, that you have added the toolchain directory to your PATH environment variable with i.e.:

gr3yh0und@builder:$ export PATH=$PATH:/usr/local/arm-2008q3/bin

Step 1: SD Card Format

To make it as fast and easy as possible, some clever guy wrote the omap3-mkcard.sh script. This makes it pretty simple: Get it, insert your SD Card, make sure to check using “dmesg” that it is loaded/available and check the path (i.e. sdb/sdc/sdd…)

Maybe you check

gr3yh0und@builder:$ sudo apt-get install kpartx bc

to make sure you have all needed commando tools.

Then simply execute it with (I’m using sdb as path here)

gr3yh0und@builder:$ sh omap3-mkcard.sh /dev/sdb

and it will do everything for you. If you get some errors about unknown commandos, check the web and install the needed packages that give you those commands/programs.

It can also be possible that you will get some errors. In my case it was because of a missing dd command or whatever and the partition table on the SD Card got corrupted. To reset the partition table simply do a
fdisk /dev/sdb
o
w

The command “o” will create a new DOS like partition table. After that, everything worked fine for me.

If you are having trouble with preparing the SD Card, have a glance at the SD Configuration over at OMAPPedia.

Step 2: Compile X-Loader

X-Loader is the small bootloader from TI which just initializes basic features of the board itself. X-Loader is kind of limited and so it simply prepares the hardware and loads U-Boot for further commands. How the complete process works is pretty well explained by the guys over at OMAPPEDIA.

To get the X-Loader sources simple get it via git

gr3yh0und@builder:$ git clone git://gitorious.org/pandaboard/x-loader-mainline.git

enter the directory and load the default pandaboard config with

gr3yh0und@builder:$ make CROSS_COMPILE=arm-none-linux-gnueabi- omap4430panda_config

Now create the binary with

gr3yh0und@builder:$ make CROSS_COMPILE=arm-none-linux-gnueabi- ift

It should now lie in the same directory as the sources, named “MLO”. At the moment, the newest version is 1.5.1.

Step 3: Compile U-Boot

Now you have to compile U-Boot from its sources. Either you choose the official U-Boot release tgzs/git or you use the git tree from the same gitorious account:

gr3yh0und@builder:$ git clone git://gitorious.org/pandaboard/u-boot-mainline.git

Then create the config from the default config

gr3yh0und@builder:$ make CROSS_COMPILE=arm-none-linux-gnueabi- omap4_panda_config

and in the last step build the binary again with

gr3yh0und@builder:$ make USE_PRIVATE_LIBGG=yes CROSS_COMPILE=arm-none-linux-gnueabi-

If you are using the latest U-Boot git from denx, then you will get an error atm (20.08.2011) about a too huge cluster size of the SRAM part. There is already a patch available here which will hopefully will be soon upstream. To use it, copy everything to a textfile (i.e. using vim and name it SRAM.patch) and execute it via

gr3yh0und@builder:$ patch -p1 < SRAM.patch

There should now be a file called u-boot.bin flying around in the same directory…

A really good reference about U-Boot and X-Loader is the guy over at elinux.org, check it out!

U-Boot is a relly nice tool and THE bootloader available. Fun fact is, that it’s creator lives in the town next to mine and I’m hopefully looking forward to drink a cup of coffee with him one day.

Step 4: Kernel

To boot up you also need a kernel. You can build your own or use a precompiled one, whatever you like. For my project i needed some adjustments and stuff, so I chose to build it by myself. I chose the latest version (3.0.2 to that point) due to a few OMAP bugfixes in there. You can read about the progress and my config in the other blog entry here. You can also download the precompiled binary there for a quickstart…

Step 5: Root Filesystem

To do anything useful with your device, you’ll also need a root filesystem. There are various options on the web on how to get one… i.e. you can use the angstrom one or, what I did, create your own with the great buildroot suite. This is really a very well designed and up to date suite to build and deploy filesystems of any kind. I will write another article about that later…

Step 6: Finalize SD Card

The final part is to copy everything over to your in step 1 already prepared SD card. Now comes the important part: The order is the key! The script created you 2 partitions, one for the bootloaders/kernel and one for the filesystem. You can also boot the kernel from the second partition or load the filesystem over the network via NFS as explained here.

  • The first file you need to copy is the “MLO” from X-Loader. This HAS TO BE the first file as it is the primary bootloader and the system just looks on the first few cluster on the SD Card to find it!
  • The second file is the “u-boot.bin” and the third file is the kernel, “uImage”.
  • The root system has now to be untared to the second partition or the NFS server needs to be configured

This should be it for the start. Put your SD Card in the slot of your pandaboard, connect a serial cable/USB-Serial adapter to the pandaboard and power it up. You should now see the loading screens of X-Loader, U-Boot and the kernel! After 30 seconds, the rootfs should be loaded und you should be able to login. Have fun!

If theres something wrong/trouble or there is a way how I can do anything smarter, just drop me a comment. I’m open for every single advice!

Pandaboard Kernel 3.0.2

6

Edit: There is a newer version available HERE!

In the development of my project i also need to get a fast and working kernel for the pandaboard. As I searched the web, there were several old and new infos about how – but I couldn’t find a defconfig for it. My first goal after unpacking was simply: Get it working instantly!!111

At this point, a advice would be to visit the HowTo List at elinux, where the newest (and also old) kernels and their How To’s are listed. The list is pretty decent at that point and includes a lot of patches which are still not merged into mainline kernel!

I’m currently working with 3.0.2, the latest final build available atm. For a start, I will post the default config I use atm. But beware – I’m far from testing all functions and drivers, i just checked the parts I thought would be useful. Download it to your kernel dir and rename it to .config

Download kernel config

Download kernel uImage precompiled

Download U-Boot 2011-06 precompiled

Download X-Loader 1.51 precompiled

Checked working:

  • LAN Network
  • serial console
  • USB Displaylink
  • Webcams

Last update: 29/8/2011

Next step is getting 3.0.4 and then, when available, 3.1 to work.

I will keep that file up to date as far as possible and as far as my projects develops…

Thanks to the guys over at pandaboard.org for linking!

Booting the pandaboard over NFS

20

I strangled some days to get this working: I want to boot the filesystem of my embedded pandaboard over NFS, so that I can make quicker changes to it from my development machine. As always with this stuff, it sounds simple and – in the end – it is simple. But the timespan between is really annoying while you are googeling and trying this until four o’clock in the morning…

So to make things hopefully shorter for you, here a quick tutorial how to do all that stuff.

Kernel

First step is our kernel. I’m using the 3.0.2 final which is atm the newest stable release. The guys commited a lot for the omap branch there, especially OMAP4 which is used on Pandaboard. But I’m really not sure, why the kernelguys are not making more defconfigs for starters. Sure they must not be perfect, but simple things like networking should work out of the box…

So go to your development machine and get the 3.0.2 sources from kernel.org and untar them:

gr3yh0und@builder:$ wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.2.tar.bz2
gr3yh0und@builder:$ tar xzf linux-3.0.2.tar.bz2

Now make a OMAP-generic default config (defconfig) and edit it (I’m assuming, that you have downloaded/untared/exported the path of i.e. the CodeSourcery Cross Compiler Toolchain):

gr3yh0und@builder:$ cd linux-3.0.2
gr3yh0und@builder:$ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm omap2plus_defconfig
gr3yh0und@builder:$ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm menuconfig

Because of the generic type of this defconfig, you have to do some manual changes to get everything working. This can easily done by selecting via the ncurse-based “menuconfig” command.
Make sure that the following point are selected ([*] in front of it):

Networking support
--> [*] TCP/IP networking
--> --> [*] IP: kernel level autoconfiguration
--> --> --> [*] IP: DHCP support
--> --> --> [*] IP: BOOTP support
--> --> --> [*] IP: RARP support
Device Drivers
--> [*] Network device support
--> --> USB Network Adapters
--> --> --> [*] SMSC LAN95XX based USB 2.0 10/100 ethernet devices
--> [*] USB support
--> --> [*] EHCI HCD (USB 2.0) support
File systems
--> [*] Network File Systems
--> --> NFS client support
--> --> --> [*] NFS client support for NFS version 3 --> [*] Root file system on NFS

Or do it via bash by checking the .config in the same dir for those variables enabled ( XXX=y ):

CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_SMSC95XX=y
CONFIG_USB=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_ROOT_NFS=y

Now build your kernel and (according to the number of CPU Cores in your system) change the number behind “j”:

gr3yh0und@builder:$ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm -j4 all
gr3yh0und@builder:$ make CROSS_COMPILE=arm-none-linux-gnueabi- uImage

Now your kernel is ready to be used!
I’m assuming here, that you already have a clue how to setup the SD Card right and have U-boot and X-Loader correctly in place. I will make further tutorials on that, too – later!

NFS Server

To use NFS, your development system also needs the NFS server to be installed. On debian systems you can install it simply with

gr3yh0und@builder:$ sudo apt-get install nfs-common nfs-kernel-server

The next step is to create the folder (here /panda/fs) for the filesystem and make it ready for “export”.
Edit the /etc/exports to match your config:
/panda/fs 192.168.1.0/24(rw,sync,no_root_squash,no_subtree_check)
I allow all adresses in this IP Range to access the NFS, due to multiple systems on the network. If you are changing the config and want to reload it, restart the nfs server with

gr3yh0und@builder:$ /etc/init.d/nfs-kernel-server restart

My development System/NFS-Server is using 192.168.1.1 and pandaboard uses the 192.168.1.2 .

U-Boot

Now copy the kernel from arch/arm/boot/uImage over to your SD Card partition 1 and connect your board to a serial cable. Get into U-Boot and enter the following commands to make a network boot:

mmc rescan
fatload mmc 0:1 0x80000000 uImage
setenv bootargs vram=32M console=ttyO2,115200 mem=456M@0x80000000 mem=512M@0xA0000000 smsc95xx.macaddr=76:2F:97:85:4F:56 root=/dev/nfs rw nfsroot=192.168.1.1:/panda/fs,nolock,wsize=1024,rsize=1024 ip=192.168.1.2 rootdelay=2 init=/linuxrc
bootm 0x80000000

Change here the arguments to fit it to your system, i.e. change the MAC Address of your NIC, the IP Address of your server if necessary (nfsroot=X.X.X.X) and the folder (here /panda/fs).
The second IP beginning with “ip=” is the IP address your board will choose after kernel has started up. You can also assign DHCP as choice here (ip=DHCP) – No subnetmask is needed.

To make this executed every boot, you have to create a new textfile on your development system called “boot.script”. Copy your boot commands into it and save it. Then convert it to a file namend “boot.scr” with the command:

gr3yh0und@builder:$ mkimage -A arm -T script -C none -n "Pandaboard boot script" -d boot.script boot.scr

and copy it over to your SD Cards first partition. It will then be executed as first action first by U-Boot on every boot.

Note: If mkimage is not found, install it with “sudo apt-get install uboot-mkimage”!

Et voila! Thanks to the guys over at Googleboard for the startup.

Go to Top