Introduction
Deployment of ROS Indigo requires all Ubuntu platforms tied to ROS Indigo run Ubuntu 14.04. The PandaBoard is one of the platforms, so upgrading it from Ubuntu 12.04 to 14.04 is a must. However, at the time of this writing, we weren’t able to find a pre-built image for PandaBoard, so we followed a relatively complex but well documented procedure published by Robert Nelson.
The procedure basically has these major parts:
- Download the build tools
- Download and build the boot-loader (U-Boot)
- Download and build the Linux Kernel
- Download the Root file system (Ubuntu 14.04.1)
- Setup the SD Card
- Install Kernel and Root File System on the SD Card
- Setup Networking and Serial I/O
- Sync and Unmount the SD Card
Once these steps are done, boot the Pandaboard from the SD card, and then perform some additional sudo apt-get install
steps to upgrade to the LXDE desktop.
If you prefer just get a pre-built image, download the image from here, and insert a 8 GB SD card, make sure it is unmounted, and apply the following command:
tar zxvf ubuntu_14.04_lxde_panda.img.tar.gz sudo dd if=ubuntu_14.04_lxde_panda.img of=/dev/mmcblk0 bs=1M
If you prefer doing it the hard way, read on…
Download the Build Tools
Install the 32-bit library prerequisites:
sudo apt-get install libc6:i386 libstdc++6:i386 libncurses5:i386 zlib1g:i386 sudo apt-get install build-essential
Now download the build tools:
wget -c https://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz tar xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz export CC=`pwd`/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-
Now test to ensure installation is done properly:
${CC}gcc --version arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) 4.9.2 20140904 (prerelease) Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Download and Build the Boot-Loader (U-Boot)
Download the boot-loader
git clone git://git.denx.de/u-boot.git cd u-boot/ git checkout v2015.01 -b tmp
Now apply the required patches:
wget -c https://raw.githubusercontent.com/eewiki/u-boot-patches/master/v2015.01/0001-omap4_common-uEnv.txt-bootz-n-fixes.patch patch -p1 < 0001-omap4_common-uEnv.txt-bootz-n-fixes.patch
Build U-Boot:
make ARCH=arm CROSS_COMPILE=${CC} distclean make ARCH=arm CROSS_COMPILE=${CC} omap4_panda_defconfig make ARCH=arm CROSS_COMPILE=${CC}
Download and Build Linux Kernel
First download it:
git clone https://github.com/RobertCNelson/armv7-multiplatform.git cd armv7-multiplatform
Now check out the proper branch:
git checkout origin/v3.18.x -b tmp
Finally, build it with the supplied script:
./build_kernel.sh
When the build completes successfully, take note of the version number on the screen; it looked something like this:
----------------------------- Script Complete eewiki.net: [user@localhost:~$ export kernel_version=3.X.Y-Z] -----------------------------
Download the Root File System (Ubuntu 14.04.1)
Robert Nelson provide several types of file system, including Debian 7, Debian 8, Ubuntu 14.04.1, and a Debian 7 small flash file system. For our purpose, we need to install the Ubuntu 14.04.1 file system.
First, download:
wget -c https://rcn-ee.net/rootfs/eewiki/minfs/ubuntu-14.04.1-minimal-armhf-2015-01-20.tar.xz
Then verify:
md5sum ubuntu-14.04.1-minimal-armhf-2015-01-20.tar.xz fc71da62babe15e45c7e51f8dba22639 ubuntu-14.04.1-minimal-armhf-2015-01-20.tar.xz
and finally extract the file system:
tar xf ubuntu-14.04.1-minimal-armhf-2015-01-20.tar.xz
The extracted files will be copied to the SD card later.
Setup SD Card
Typically a 4 GB SD card will work well. Plug in the SD card into your system. Make sure all partitions on the card are unmounted. Find out the device name, it should be either /dev/sdx
or /dev/mmcblk0
. You can use the lsblk
command to find out (under the /sr0
section):
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 232.9G 0 disk ├─sda1 8:1 0 487M 0 part /boot/efi ├─sda2 8:2 0 200.7G 0 part / └─sda3 8:3 0 31.8G 0 part [SWAP] sdb 8:16 0 931.5G 0 disk └─sdb1 8:17 0 931.5G 0 part sdc 8:32 0 238.5G 0 disk ├─sdc1 8:33 0 1G 0 part ├─sdc2 8:34 0 260M 0 part ├─sdc3 8:35 0 128M 0 part ├─sdc4 8:36 0 223.3G 0 part └─sdc5 8:37 0 13.9G 0 part sr0 11:0 1 1024M 0 rom mmcblk0 179:0 0 3.7G 0 disk ├─mmcblk0p1 179:1 0 25.5K 0 part └─mmcblk0p2 179:2 0 3.7G 0 part
In this case, the SD card is located at mmcblk0
, and it has two partitions.
Now we will define and export a macro:
export DISK=/dev/mmcblk0
and erase the SD card:
sudo dd if=/dev/zero of=${DISK} bs=1M count=10
Now we install the boot-loader:
sudo dd if=./u-boot/MLO of=${DISK} count=1 seek=1 conv=notrunc bs=128k sudo dd if=./u-boot/u-boot.img of=${DISK} count=2 seek=1 conv=notrunc bs=384k
Next, create the partitions:
sudo sfdisk --in-order --Linux --unit M ${DISK} <<-__EOF__ 1,,0x83,* __EOF__
And format:
#for: DISK=/dev/mmcblk0 sudo mkfs.ext4 ${DISK}p1 -L rootfs #for: DISK=/dev/sdX sudo mkfs.ext4 ${DISK}1 -L rootfs
Now we mount the partitions (on some systems, auto-mount happens when the SD card is inserted).
sudo mkdir -p /media/rootfs/ #for: DISK=/dev/mmcblk0 sudo mount ${DISK}p1 /media/rootfs/ #for: DISK=/dev/sdX sudo mount ${DISK}1 /media/rootfs/
Install Kernel and Root File System on SD Card
Here you will need the kernel version number saved after the kernel build. Use it below by substituting “3.X.Y-Z” with the kernel version number you wrote down.
export kernel_version=3.X.Y-Z
Now, copy the file system to the SD card:
sudo tar xfvp ./*-*-*-armhf-*/armhf-rootfs-*.tar -C /media/rootfs/
and create the /boot/nEnv.txt
:
sudo sh -c "echo 'uname_r=${kernel_version}' > /media/rootfs/boot/uEnv.txt"
Now, setup the device tree binary, depending on which version of Pandaboard you have:
PandaBoard EA1->A3 sudo sh -c "echo 'dtb=omap4-panda.dtb' >> /media/rootfs/boot/uEnv.txt" PandaBoard A4->+ (non ES) sudo sh -c "echo 'dtb=omap4-panda-a4.dtb' >> /media/rootfs/boot/uEnv.txt" PandaBoard ES sudo sh -c "echo 'dtb=omap4-panda-es.dtb' >> /media/rootfs/boot/uEnv.txt" PandaBoard ES Rev B3 sudo sh -c "echo 'dtb=omap4-panda-es-b3.dtb' >> /media/rootfs/boot/uEnv.txt"
Now copy the kernel files, device tree binaries, and kernel modules:
sudo cp -v ./armv7-multiplatform/deploy/${kernel_version}.zImage /media/rootfs/boot/vmlinuz-${kernel_version} sudo mkdir -p /media/rootfs/boot/dtbs/${kernel_version}/ sudo tar xfv ./armv7-multiplatform/deploy/${kernel_version}-dtbs.tar.gz -C /media/rootfs/boot/dtbs/${kernel_version}/ sudo tar xfv ./armv7-multiplatform/deploy/${kernel_version}-modules.tar.gz -C /media/rootfs/
Setup the file system table:
sudo sh -c "echo '/dev/mmcblk0p1 / auto errors=remount-ro 0 1' >> /media/rootfs/etc/fstab"
Setup Networking and Serial I/O
Edit the file /etc/network/interfaces
:
sudo gedit /media/rootfs/etc/network/interfaces
and add the following:
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp
To setup serial login on Ubuntu, we need to create a new file, /etc/init/serial.conf
:
sudo gedit /media/rootfs/etc/init/serial.conf
and put the below contents in it:
start on stopped rc RUNLEVEL=[2345] stop on runlevel [!2345] respawn exec /sbin/getty 115200 ttyO2
To setup the wifi, we have to first install some firmware:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git sudo mkdir -p /media/rootfs/lib/firmware/ti-connectivity sudo cp -v ./linux-firmware/ti-connectivity/* /media/rootfs/lib/firmware/ti-connectivity
and then edit the file:
sudo gedit /media/rootfs/etc/network/interfaces
and add the below contents in it:
auto wlan0 iface wlan0 inet dhcp wpa-ssid "essid" wpa-psk "password"
Now, sync the file system, unmount and remove the SD card:
sync sudo umount /media/rootfs
Booting Ubuntu and Install LXDE Desktop
Insert the SD card into Pandaboard and apply power. Connect HDMI to a monitor and you should see a simple console login. Enter username ubuntu
and password temppwd
.
To install LXDE desktop, perform the following steps:
sudo apt-get update sudo apt-get -y install lxde-core slim xserver-xorg x11-xserver-utils
Other desktop configurations, such as ubuntu-desktop
, do not work and the system locks up. If you’re having slow or disappearing mouse issue, add the following to the /etc/X11/xorg.conf
file:
Section "Monitor" Identifier "Builtin Default Monitor" EndSection Section "Device" Identifier "Builtin Default fbdev Device 0" Driver "omap" Option "HWcursor" "false" EndSection Section "Screen" Identifier "Builtin Default fbdev Screen 0" Device "Builtin Default fbdev Device 0" Monitor "Builtin Default Monitor" DefaultDepth 16 EndSection Section "ServerLayout" Identifier "Builtin Default Layout" Screen "Builtin Default fbdev Screen 0" EndSection
After you finished, boot from the new SD card image, login and you should see a pretty desktop like the one shown at the top of this blog.
Hi Larry,
I am using the pre-built image, however it hangs on this line
[ 3.992156] ashmem: initialized
My board is Pandaboard ES rev B3. Any suggestions on how to solve this error ?
Thanks
Rana
It sounds like a boot loader issue. B3 model requires a different memory setup in uEnv.txt. I think I built the image for a ES A2 board. You may have to try do it from scratch.
Hi Larry, thank you for publishing my Feb 7th reply.
When you deal with package based Linux, your image is never “out of date” because all packages may be upgraded.
As mentioned in my post, upgrading the packages (and staying on 14.04) or even upgrading the distribution is common sense.
I choose the later.
There’s few more steps needed to upgrade to 16.04. that are not so obvious.
Currently I have it as:
“Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 3.18.5-armv7-x2 armv7l)”
(this shows on my current login banner).
All of this is based on your binary image – I did not have to compile any component of it.
I would say the most tricky part was to resize the sd card partition. After burning your image it ends up with 4GB partition with around 1.2GB left as free space. This is insufficient for upgrading to 16.04.
There’s two commands I had to run to enlarge the partition to max size offered by my physical SD card.
After that upgrading to 16.04 went fine with no glitches.
The commands mentioned earlier are:
sudo echo -e “d\n1\nn\n\n\n\n+28G\nw\n” | fdisk /dev/mmcblk0
sudo reboot
sudo resize2fs /dev/mmcblk0p1
(this matches my 32GB card). With some minimal effort I could turn them into a script a lot easier to follow.
I feel documenting the steps to upgrade may benefit your blog readers.
If you think this info is good enough “as is” please feel free to post it as another “reply”.
Personally I think this content fits better on your main blog page.
I am willing to contribute; please let me know if you consider this idea and if you need any help.
Sorry for making use of “Reply”, I didn’t know a better way to pass this feedback to you.
Thank you,
Mircea
P.S. I do Linux software development for living.
Hi Larry — Great blog post for getting started. But after following the easy method steps I boot from the SD card and it stops dead at this point: 4.155242] omap2_set_init_voltage: unable to set vdd_iva
[ 4.162475] cpufreq: __cpufreq_add_dev: CPU0: Running at unlisted freq: 699977 KHz
[ 4.170471] cpufreq: __cpufreq_add_dev: CPU0: Unlisted initial frequency changed to: 800000 KHz
I have a Pandaboard ES Rev B2. Any idea what’s wrong?
Thanks!
Try Robert Nelson’s wiki. He has some good more recent instruction, even for Ubuntu 16.04 LTS.
https://eewiki.net/display/linuxonarm/PandaBoard#PandaBoard-Ubuntu16.04LTS
Hi Larry,
Unfortunately, I followed the “easy way” to get going at the beginning of your blog. and it boots, starts the kernel, and gets all the way to this point and stops dead: 4.155242] omap2_set_init_voltage: unable to set vdd_iva
[ 4.162475] cpufreq: __cpufreq_add_dev: CPU0: Running at unlisted freq: 699977 KHz
[ 4.170471] cpufreq: __cpufreq_add_dev: CPU0: Unlisted initial frequency changed to: 800000 KHz
Is the image I downloaded no longer applicable? I have a Pandaboard ES Rev B2.
Thanks!
Had the same messages on a ES Rev B2. The issue is mismatching dt-blob. By default the image ships with support for standard PandaBoard. If you are using ES version you need to adjust eEnv.txt accordingly.
For more details please refer to “setup the device tree binary” section above.
After adding the -ES suffix in uEnv,txt (dtb=omap4-panda-es.dtb) I had my board booting fine to the login prompt.
Obviously I had to remove the SDCard, mount it on a Linux machine and edit the uEnv.txt
RE: other comments – the image is outdated – ubuntu is a packaged base Linux distribution, so it is quite easy and convenient to update it.
Many thanks for providing this image – saved some cycles in preparing one…
Mircea
Hi Larry, the Dropbox link doesn’t seem to work anymore. Would it be possible to get the image somewhere else?
Hi Johannes,
The files was removed because it is out-dated. You should follow Robert Nelson’s instruction here to create updated image.
-Larry
Larry, could you make your image available again? The dropbox link has expired.
Yes, it’s expired. Would you please make it available again. Thanks!
I refreshed the link. You can also download it here:
https://www.dropbox.com/s/mmdtovm1getgjkx/ubuntu_14.04_lubuntu-desktop_panda.img.tar.gz?dl=0