Parallella Linaro Nano

= How to Install Linaro nano 14.03 (minimal headless system) =

'''This guide is only for Parallella E16/Zynq7020. Do not apply these instructions to another board'''.

Requirements
Ubuntu PC, SD Card, SD Card adapter, Parallella

On the PC's terminal:

Download the files
wget --no-check-certificate https://github.com/parallella/parallella-bin/raw/master/rel.14.02.06.tgz

wget http://releases.linaro.org/14.03/ubuntu/saucy-images/nano/linaro-saucy-nano-20140323-649.tar.gz

md5sum rel.14.02.06.tgz

23eb538fd58d684b5a64236e81275dc8 rel.14.02.06.tgz

md5sum linaro-saucy-nano-20140323-649.tar.gz

0bb79433fc2018c1b5ff6da9d9f970c7 linaro-saucy-nano-20140323-649.tar.gz

Determine the device name of the SD Card
sudo parted -l

In case of a 2GB SD Card:

Model: SD/MM Reader Disk /dev/sdX: 2042MB Sector size (logical/physical): 512B/512B Partition Table: msdos

Number Start End Size Type File system Flags 1 1049kB 49.3MB 48.2MB primary fat16 2 49.3MB 2042MB 1992MB primary ext4

"/dev/sdX" is the device name of the SD Card

(e.g. sdb, sdc, sdd, sde, mmcblk0, mmcblk1, ... and, Beware! Don't partition HDD!!!)

sdX : an example of the device name (e.g. sde, mmcblk0)

sdX1 : partition 1 of the device (e.g. sde1, mmcblk0p1)

sdX2 : partition 2 of the device (e.g. sde2, mmcblk0p2)

Partition the SD Card
Unmount the SD Card if it was automounted, then,

sudo parted -a optimal /dev/sdX

(parted) print

If there are two partitions on the SD Card,

Number Start End Size Type File system Flags 1 1049kB 99.6MB 98.6MB primary fat16 lba 2 99.6MB 2042MB 1942MB primary

Delete all existing partition

(parted) rm 2 (parted) rm 1

Make new partitions

(parted) mkpart p fat32 2048s 100m (parted) mkpart p ext2 100m -1m (parted) q

Check the partition

sudo fdisk -l /dev/sdX

Device Boot Start End Blocks Id System /dev/sdX1 2048 194559 96256 c W95 FAT32 (LBA) /dev/sdX2 194560 3987455 1896448 83 Linux

Format the partition

sudo mkfs.vfat -n BOOT /dev/sdX1 sudo mkfs.ext4 -L rootfs /dev/sdX2

Extract rootfs
sudo mkdir /tmp/mnt1 /tmp/mnt2 sudo mount /dev/sdX2 /tmp/mnt1 sudo tar --strip-components=1 -C /tmp/mnt1 -xzpf linaro-saucy-nano-20140323-649.tar.gz sudo sync sudo umount /tmp/mnt1

Extract BOOT partition
sudo mount -o umask=000 -t vfat /dev/sdX1 /tmp/mnt2 sudo tar -C /tmp/mnt2 -xzf rel.14.02.06.tgz (The warning "Cannot change ownership..." can be ignored.) sudo sync sudo umount /tmp/mnt2

Preventing to install unnecessary packages
sudo mount /dev/sdX2 /tmp/mnt1 sudo nano /tmp/mnt1/etc/apt/apt.conf.d/00InstallRecommends (Edit and save.) APT::Install-Recommends "false";

Network configuration
If your router's IP address is 192.168.0.1 and the Parallella's IP address is 192.168.0.2,

sudo nano /tmp/mnt1/etc/network/interfaces (Edit and save.) source-directory /etc/network/interfaces.d

auto lo iface lo inet loopback

auto eth0

iface eth0 inet static address 192.168.0.2 netmask 255.255.255.0 gateway 192.168.0.1 up sleep 3; mii-tool -F 1000baseT-FD
 * 1) static network settings


 * 1) If you prefer DHCP, comment out the above 5 lines, uncomment the below.
 * 2) iface eth0 inet dhcp

sudo nano /tmp/mnt1/etc/resolv.conf

nameserver 192.168.0.1

sudo sync sudo umount /tmp/mnt1

Insert the SD Card to the Parallella,

power-on,

Wait 30 seconds,

You'll see a root terminal.

If it doesn't boot, press the reset button and try again.

Install openssh-server
On the Parallella:

apt-get update apt-get install openssh-server sync

Now you can login the Parallella from your PC.

On the PC,

ssh linaro@192.168.0.2 password: linaro

Create device nodes
sudo mknod -m 600 /dev/ttyPS0 c 251 0 sudo chown root:tty /dev/ttyPS0

Let's see how lightweight it is
free

total      used       free     shared    buffers     cached Mem:       992452      38356     954096          0       1816      13076 -/+ buffers/cache:     23464     968988 Swap:           0          0          0

The memory consumption is only 23MB !! :D

df

Filesystem    1K-blocks   Used Available Use% Mounted on /dev/root       30348232 311108  28472452   2% / none              99248     68     99180   1% /run none               5120      0      5120   0% /run/lock none             496224      0    496224   0% /run/shm none             102400      0    102400   0% /run/user

The disk consumption is only 304MB !!

Recommended Packages
sudo apt-get install vim-tiny nano fake-hwclock wget less unzip

Epiphany SDK
sudo apt-get install build-essential man-db manpages-dev git libmpc-dev libmpc2 libgmp3-dev libmpfr-dev ca-certificates

wget ftp://ftp.parallella.org/esdk/esdk.5.13.09.10_linux_armv7l.tgz

md5sum esdk.5.13.09.10_linux_armv7l.tgz

52e3b60185c882c7641115993b6a72b5 esdk.5.13.09.10_linux_armv7l.tgz

sudo mkdir -p /opt/adapteva/ sudo tar xzf esdk.5.13.09.10_linux_armv7l.tgz -C /opt/adapteva/ sudo ln -sTf /opt/adapteva/esdk.5.13.09.10 /opt/adapteva/esdk

touch ~/.nano_history nano ~/.bashrc (add to the bottom of the file)

EPIPHANY_HOME=/opt/adapteva/esdk . ${EPIPHANY_HOME}/setup.sh

Disable sshd hostname look-up
(To fix slow SSH connections) sudo nano /etc/ssh/sshd_config (add to the bottom of the file) UseDNS no

Enable devtmpfs
(and disable serial console: they are incompatible) sudo mknod -m 660 /dev/mmcblk0 b 179 0 sudo mknod -m 660 /dev/mmcblk0p1 b 179 1 sudo mknod -m 660 /dev/mmcblk0p2 b 179 2

sudo apt-get install device-tree-compiler

sudo mount /dev/mmcblk0p1 /mnt cd /mnt sudo cp devicetree.dtb devicetree.dtb.bak

sudo dtc -I dtb -O dts -o devicetree.dts devicetree.dtb

sudo nano devicetree.dts (Search and Edit the "bootargs" line) bootargs = "root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait";

sudo dtc -I dts -O dtb -o devicetree.dtb devicetree.dts cd / sync sudo reboot

That's all! Below are installation instructions of lightweight desktop environment.

= How to Install lightweight X environment =

Demo video: http://youtu.be/6gpM57qB-I8

Install LXDE
sudo apt-get install lxde xserver-xorg xinit alsa-base alsa-utils libasound2-plugins feh galculator xserver-xorg-video-fbdev xserver-xorg-video-modesetting x11-xserver-utils

Disable PCManFM Desktop mode
(for faster displaying) sudo nano /etc/xdg/lxsession/LXDE/autostart (Delete the line "@pcmanfm --desktop --profile LXDE" and save.)

Set a background image
Put a background image file in your home directory.

(e.g. /home/linaro/background.png)

sudo nano /etc/xdg/lxsession/LXDE/autostart (Append this line to the bottom of the file)

@feh --bg-fill /home/linaro/background.png

xorg configuration
sudo nano /etc/X11/xorg.conf

Section "Device" Identifier "Card0" Driver "modesetting" Option "ShadowFB" "True" Option "SWCursor" "True" Option "HWCursor" "False" EndSection Section "Screen" Identifier "Screen0" Device "Card0" SubSection "Display" #Modes "1920x1200" #Modes "1920x1080" #Modes "1280x720" #Modes "640x480" EndSubSection EndSection
 * 1) Uncomment your preferred mode

ALSA configuration
nano ~/.asoundrc (copy, paste and save) pcm.!default { type rate slave { pcm "hw:0" rate 48000 } converter "samplerate" }

sync sudo reboot

How to login as a normal user
After booting, press Ctrl+Alt+F2 login: linaro Password: linaro

Or, (easier way)

In the root prompt,

su linaro cd

Start X environment
startx

Install Firefox
sudo apt-get install firefox

Using a RAM disk for cache
sudo nano /etc/fstab (Add this line to the bottom of the file) tmpfs /home/linaro/.cache tmpfs noatime,nodev,nosuid,size=100M 0 0

Limit the cache size of Firefox
On Firefox,

MENU->Edit->Preferences->Advanced->Network->Cached Web Content

[v]Override automatic cache management

Limit cache to [50] MB of space

More responsive mouse wheel
On Firefox,

Type "about:config" in URL bar,

mousewheel.acceleration.start : Double click, set [2]

Install media player
sudo apt-get install smplayer

Launch smplayer,

Options->Preferences->Video->Output driver: x11

Options->Preferences->Audio->Output driver: alsa

How to force framebuffer resolution to 1280x720
To increase desktop performance on a full-HD monitor.

Edit bootargs and update dtb file.

How to: Parallella_Linaro_Nano bootargs = "root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait video=HDMI-A-1:1280x720"; Edit xorg.conf

How to: Parallella_Linaro_Nano Modes "1280x720"
 * 1) In the Section "Screen"