Quick start Ubuntu 15.04 - 64 bits

From RidgeRun Developer Wiki

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.

I have created a bash script with the packages generally needed for develop (by the time of this modification (2016-04-17)), you can just create a single file called install_packages.sh by doing and following the next lines

touch install_packages.sh
vim install_packages.sh

then add the following on it:

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

Then you should type:

chmod +x install_packages.sh
sudo ./install_packages.sh

and it will start installing all the packages. Or if the reader finds easier to install them one by one, just execute every line of the next list:

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

Build the $DEVDIR after you run the steps mentioned above and check for the ld.so.cache filesize is changed to not less than 200 bytes long.

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

sudo 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

Disabling auto mount

Since the SDK is used to write a bootable images to an SD card, it is often useful to disable automount. When automount is enabled, the SDK can not reliabily write to the SD card if the card is under the control of the Nautilus file system manager.

Run:

dconf-editor

Browse to org.gnome.desktop.media-handling and uncheck the automount key.

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

Resize Window Border To Small

If you have having trouble resizing the windows because the borders are too small, you might find these ideas helpful:

  • Hold down the Alt key and use the middle mouse button to resize the window from anywhere inside the window.
  • Edit /usr/share/themes/Ambiance/metacity-1/metacity-theme-1.xml then log out and log back in again.
<distance name="left_width" value="3"/>
<distance name="right_width" value="3"/>
<distance name="bottom_height" value="3"/> 

Suggestions from: http://ubuntuforums.org/showthread.php?t=1482247

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