Quick start Ubuntu 15.04 - 64 bits

From RidgeRun Developer Connection
Jump to: navigation, search

sudo configuration

You can configure sudo to not ask for your password:

sudo addgroup admin
sudo adduser $USER admin
sudo sh -c "echo '%admin ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers"

Packages to install

General utilities and RR SDK required packages

These are packages that are typically required to put your system in shape for general utilities, and also packages necessary to compile typical RR's SDKs.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y build-essential fakeroot graphviz gdb vim openssh-server git
sudo apt-get install -y zip subversion git-core nfs­-kernel­-server nfs­-common meld
sudo apt-get install -y portmap xinetd tftpd tftp curl libncurses5-dev texinfo
sudo apt-get install -y minicom quilt curl autoconf libcrypt-ssleay-perl quilt
sudo apt-get install -y libusb-dev libexpect-perl mono-devel libgtk2.0-dev bison flex
sudo apt-get install -y xclip liblzo2-dev uuid-dev python-virtualenv
sudo apt-get install -y terminator tree doxygen vlc libdbus-glib-1-dev iftop libxml2-dev
sudo apt-get install -y gstreamer-tools libgstreamer0.10-dev libgstrtspserver-0.10-dev
sudo apt-get install -y libreadline-dev valac libtool libterm-readkey-perl libwww-perl
sudo apt-get install -y gparted gperf libgmp-dev libgmp3-dev libmpfr-dev libmpc-dev
sudo apt-get install -y imagemagick ddd cmake cmake-curses-gui ccache mtd-utils
sudo apt-get install -y intltool xsltproc libusb-1.0-0-dev libbz2-dev libjpeg62
sudo apt-get install -y ccache libncurses5-dev texinfo minicom subversion curl git-core 
sudo apt-get install -y autoconf libcrypt-ssleay-perl libusb-dev libexpect-perl mono-devel
sudo apt-get install -y libgtk2.0-dev bison flex meld asciidoc

This package is required by Lauterbach TRACE32:

sudo apt-get install -y libjpeg62

The next packages can also be convenient, but note that they will eventually require user-interaction during the installation process, for example to confirm a User License agreement.

sudo apt-get install -y ubuntu-restricted-extras

RR developers work continuously using quilt to create patches.

sudo apt-get install quilt

Recommended quilt refresh settings (File ~/.quiltrc):

QUILT_REFRESH_ARGS="--no-timestamps --diffstat"

The termnet and termnetd packages are available through:

http://www.ubuntuupdates.org/termnetd
http://www.ubuntuupdates.org/termnet

Common packages used by RR Developers

RidgeRun developers often install:

sudo apt-get install -y geany geany-plugin-addons emacs eclipse-cdt cscope hamster-indicator pidgin filezilla gimp wireshark wireshark-doc

Setup

Switch shell from dash to bash

sudo rm /bin/sh
sudo ln -s /bin/bash /bin/sh

Tuning bash startup script

echo "alias h='history 100'" >> $HOME/.bashrc
echo "alias e='source rr-make-env 2> /dev/null'" >> $HOME/.bashrc
echo 'export PATH=$PATH:/sbin' >> $HOME/.bashrc

When you're ready you can source the file:

source $HOME/.bashrc

SDK downloads

The location /opt/ridgerun/downloads is conveniently used to hold all the packages and tarballs downloaded by the RR SDK, and is convenient because it can be re-used if you have more than one RR SDK installed in your machine.

sudo mkdir --parents /opt/ridgerun/downloads
sudo chmod ugo+rwx /opt/ridgerun/downloads

If you have another computer setup that has built the RidgeRun SDK before, you will find it much faster on the first build if you copy the downloads directory to your new machine.

EXISTING_MACHINE_IP=192.168.0.1
scp -r $EXISTING_MACHINE_IP:/opt/ridgerun/downloads/* /opt/ridgerun/downloads

Host ldconfig does not support ARM architecture

If you get the error

Kernel panic - not syncing: No init found.  Try passing init= option to kernel.

when you first boot your target hardware, you may have run into the ldconfig issue. On the host computer check the file length of

$DEVDIR/fs/fs/etc/ld.so.cache

If that file is less than 200 bytes long, you need to use a different version of the host application ldconfig.

When the 2.19 version of ldconfig that comes with Ubuntu 14.04 tries to create the /etc/ld.so.cache shared library cache on the target file system, it ignores all ARM shared libraries. This is a known defect. To work around the defect, the RidgeRun SDK has been enhanced to fetch the 2.15 version of ldconfig and use it to create the target file system /etc/ld.so.cache file.

If you are using a older version of the RidgeRun SDK, you can follow these commands to resolve the issue.

cd $DEVDIR
mkdir tmp
cd tmp
wget https://launchpad.net/~ubuntu-security/+archive/ubuntu/ppa/+build/5061964/+files/libc-bin_2.15-0ubuntu10.5_i386.deb
dpkg-deb -x libc-bin_2.15-0ubuntu10.5_i386.deb libc-bin_2.15-0ubuntu10.5_i386
install -Dm 755 libc-bin_2.15-0ubuntu10.5_i386/sbin/ldconfig.real $DEVDIR/bsp/local/bin/ldconfig.2_15
sed -i -e 's!LDCONFIG?=.*!LDCONFIG?=ldconfig.2_15!' $DEVDIR/bsp/classes/common.defs
cd $DEVDIR
rm -rf tmp
ldconfig --version

Building a RR SDK

After the steps above, you can try out building your RR SDK. See the SDK User Guides for reference.

Steps needed to install toolchain on versions newer than ubuntu 12.04

In order to run the toolchain installer you need to install the 32-bits libs, since this versions removed ia32-libs ia32-libs-gtk packages from the repository you need to run

apt-get install libgtk2.0-0:i386 libxtst6:i386 gtk2-engines-murrine:i386 lib32stdc++6 libxt6:i386 libdbus-glib-1-2:i386 libasound2:i386

Special steps when installing the dvsdk

Running the dvsdk installer, use the --forcehost switch to enable the installation, for example:

./dvsdk_dm368-evm_4_02_00_06_setuplinux --forcehost

Packages that will be asked by the Ridgerun SDK

 sudo apt-get install libdbus-glib-1-dev libgtk2.0-dev bison flex libglib2.0-dev

Switching desktop environments

I haven't gotten used to Unity yet. I prefer Gnome panel. You could start by loading the official Gnome Ubuntu distro, which is likely easier. If you already installed Ubuntu, then you might find these steps helpful.

To see what desktops are available, I ran:

aptitude search desktop

I found one that looked good, so I ran:

sudo apt-get install ubuntu-gnome-desktop gnome-panel

Pick gdm the Gnome Display Manager, when asked.

Get gnome panel to auto-start, by adding it to your session properties (fill in all boxes with gnome-panel)

gnome-session-properties

Log out, and when you go to log back in again, first click on the Ubuntu circle icon in the dialog box asking for your password and select GNOME Flashback (metacity).

Customizing desktop

Run dconf Editor and wander around org.gnome tree. Here are some of my favorites:

  • org.gnome.desktop.wm.preferences
    • button-layout : close,maximize,minimize:
    • auto-raise : select
    • auto-raise-delay : 500
    • num-workspaces : 4
    • workspace-names : ['mail', 'chat', 'customer 1', 'personal']

Creating ssh key for github

To make git clone work easily, I created and uploaded an ssh key to github.com. Create a key using:

YOUR_EMAIL_ADDRESS=foo.bar@baz.com
ssh-keygen -t rsa -C "$YOUR_EMAIL_ADDRESS"

Then browse to http://github.com, log in, click on your name in the upper right corner, then pick SSH keys from the left side panel. You can view the key you created by running:

cat ~/.ssh/id_rsa.pub

Common problems and how to solve them

grammar.tab.c error too few arguments to function _gst_parse_yylex

Put that patch into $DEVDIR/fs/apps/gstreamer-0.10.36/patches:

From 90622bb35544655cf641e3ab65cf35a6d01869bc Mon Sep 17 00:00:00 2001
From: Kerrick Staley <kerrick@kerrickstaley.com>
Date: Tue, 20 Aug 2013 23:59:29 -0700
Subject: [PATCH] Make grammar.y work with Bison 3

YYLEX_PARAM is no longer supported in Bison 3.
---
 gst/parse/grammar.y | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gst/parse/grammar.y b/src/gst/parse/grammar.y
index 8a9019c..f533389 100644
--- a/src/gst/parse/grammar.y
+++ b/src/gst/parse/grammar.y
@@ -26,7 +26,6 @@
  */
 
 #define YYERROR_VERBOSE 1
-#define YYLEX_PARAM scanner
 
 #define YYENABLE_NLS 0
 
@@ -659,6 +658,7 @@ static int yyerror (void *scanner, graph_t *graph, const char *s);
 %right '.'
 %left '!' '='
 
+%lex-param { void *scanner }
 %parse-param { void *scanner }
 %parse-param { graph_t *graph }
 %pure-parser
-- 
1.8.3.4

and add its name to $DEVDIR/fs/apps/gstreamer-0.10.36/patches/series.

Rebuild gstreamer.

See also

Quick start ubuntu 11.10