Difference between revisions of "Parallella Linaro Nano"

From eLinux.org
Jump to: navigation, search
(Created page with "= How to Install Linaro nano 14.01 (minimal headless system) = Copied here from [http://forums.parallella.org/viewtopic.php?f=9&t=844&start=10#p5989 Shodruk's forum post]. ==...")
 
(14.01->14.03, LXDE)
Line 1: Line 1:
= How to Install Linaro nano 14.01 (minimal headless system) =
+
= How to Install Linaro nano 14.03 (minimal headless system) =
  
 
Copied here from [http://forums.parallella.org/viewtopic.php?f=9&t=844&start=10#p5989 Shodruk's forum post].
 
Copied here from [http://forums.parallella.org/viewtopic.php?f=9&t=844&start=10#p5989 Shodruk's forum post].
Line 11: Line 11:
  
 
<pre>
 
<pre>
$ wget ftp://ftp.parallella.org/parallella/gen1/Parallella16_z7020wGPIO_131224.zip
+
wget -O rel.14.02.06.tgz https://github.com/parallella/parallella-bin/blob/master/rel.14.02.06.tgz?raw=true
  
$ wget http://releases.linaro.org/14.01/ubuntu/saucy-images/nano/linaro-saucy-nano-20140126-627.tar.gz
+
wget http://releases.linaro.org/14.03/ubuntu/saucy-images/nano/linaro-saucy-nano-20140323-649.tar.gz
 +
</pre>
 +
 
 +
<pre>md5sum rel.14.02.06.tgz</pre>
  
$ wget https://github.com/parallella/parallella-bin/blob/master/rel.14.02.06.tgz
+
<blockquote>
 +
<pre>
 +
23eb538fd58d684b5a64236e81275dc8  rel.14.02.06.tgz
 
</pre>
 
</pre>
 +
</blockquote>
  
== Unzip the files ==
+
<pre>md5sum linaro-saucy-nano-20140323-649.tar.gz</pre>
  
 +
<blockquote>
 
<pre>
 
<pre>
$ unzip Parallella16_z7020wGPIO_131224.zip
+
0bb79433fc2018c1b5ff6da9d9f970c7  linaro-saucy-nano-20140323-649.tar.gz
 +
</pre>
 +
</blockquote>
  
$ tar xzf rel.14.02.06.tgz
 
</pre>
 
  
 
== Determine the device name of the SD Card ==
 
== Determine the device name of the SD Card ==
  
 
<pre>
 
<pre>
$ sudo parted -l
+
sudo parted -l
 
</pre>
 
</pre>
  
 
In case of a 2GB SD Card:
 
In case of a 2GB SD Card:
  
 +
<blockquote>
 
<pre>
 
<pre>
 
Model: SD/MM Reader
 
Model: SD/MM Reader
Line 44: Line 52:
 
2 49.3MB 2042MB 1992MB primary ext4
 
2 49.3MB 2042MB 1992MB primary ext4
 
</pre>
 
</pre>
 +
</blockquote>
  
"/dev/sdX" is the device name of the SD Card
+
"/dev/sdX" is the device name of the SD Card<br />
(e.g. sdb, sdc, sdd, sde, ... and, Don't partition HDD!!!)
+
(e.g. sdb, sdc, sdd, sde, mmcblk0, mmcblk1, ... and, Beware! Don't partition HDD!!!)
  
 
== Partition the SD Card ==
 
== Partition the SD Card ==
Line 53: Line 62:
  
 
<pre>
 
<pre>
$ sudo parted -a optimal /dev/sdX
+
sudo parted -a optimal /dev/sdX
  
 
(parted) print
 
(parted) print
Line 60: Line 69:
 
If there are two partitions on the SD Card,
 
If there are two partitions on the SD Card,
  
 +
<blockquote>
 
<pre>
 
<pre>
 
Number Start End Size Type File system Flags
 
Number Start End Size Type File system Flags
Line 65: Line 75:
 
2 99.6MB 2042MB 1942MB primary
 
2 99.6MB 2042MB 1942MB primary
 
</pre>
 
</pre>
 +
</blockquote>
  
 
Delete all existing partition
 
Delete all existing partition
Line 84: Line 95:
  
 
<pre>
 
<pre>
$ sudo fdisk -l /dev/sdX
+
sudo fdisk -l /dev/sdX
 
</pre>
 
</pre>
  
 +
<blockquote>
 
<pre>
 
<pre>
 
Device Boot Start End Blocks Id System
 
Device Boot Start End Blocks Id System
Line 92: Line 104:
 
/dev/sdX2 194560 3987455 1896448 83 Linux
 
/dev/sdX2 194560 3987455 1896448 83 Linux
 
</pre>
 
</pre>
 +
</blockquote>
  
 
Format the partition
 
Format the partition
  
 
<pre>
 
<pre>
$ sudo mkfs.vfat -n BOOT /dev/sdX1
+
sudo mkfs.vfat -n BOOT /dev/sdX1
$ sudo mkfs.ext4 -L rootfs /dev/sdX2
+
sudo mkfs.ext4 -L rootfs /dev/sdX2
 
</pre>
 
</pre>
  
Line 103: Line 116:
  
 
<pre>
 
<pre>
$ sudo mkdir /tmp/mnt1 /tmp/mnt2
+
sudo mkdir /tmp/mnt1 /tmp/mnt2
$ sudo mount /dev/sdX2 /tmp/mnt1
+
sudo mount /dev/sdX2 /tmp/mnt1
$ sudo tar --strip-components=1 -C /tmp/mnt1 -xzpf linaro-saucy-nano-20140126-627.tar.gz
+
sudo tar --strip-components=1 -C /tmp/mnt1 -xzpf linaro-saucy-nano-20140323-649.tar.gz
$ sudo sync
+
sudo sync
$ sudo umount /tmp/mnt1
+
sudo umount /tmp/mnt1
 
</pre>
 
</pre>
  
Line 113: Line 126:
  
 
<pre>
 
<pre>
$ sudo losetup -o 32256 /dev/loop0 Parallella16_z7020wGPIO_131220.img
+
sudo mount -o umask=000 -t vfat /dev/sdX1 /tmp/mnt2
$ sudo mount -o umask=000 -t vfat /dev/loop0 /tmp/mnt1
+
sudo tar -C /tmp/mnt2 -xzf rel.14.02.06.tgz
$ sudo mount -o umask=000 -t vfat /dev/sdX1 /tmp/mnt2
+
</pre>
$ sudo cp -r /tmp/mnt1/* /tmp/mnt2/
+
(The warning "Cannot change ownership..." can be ignored.)
$ sudo cp rel.14.02.06/* /tmp/mnt2/
+
<pre>
$ sudo sync
+
sudo sync
$ sudo umount /tmp/mnt1
+
sudo umount /tmp/mnt2
$ sudo losetup -d /dev/loop0
 
$ sudo umount /tmp/mnt2
 
 
</pre>
 
</pre>
  
 
== Edit some configuration files ==
 
== Edit some configuration files ==
  
 +
==== Preventing to install unnecessary packages ====
 
<pre>
 
<pre>
$ sudo mount /dev/sdX2 /tmp/mnt1
+
sudo mount /dev/sdX2 /tmp/mnt1
$ sudo nano /tmp/mnt1/etc/apt/apt.conf.d/00InstallRecommends
+
sudo nano /tmp/mnt1/etc/apt/apt.conf.d/00InstallRecommends
 
</pre>
 
</pre>
 
+
(Edit and save.)
 +
<blockquote>
 
<pre>
 
<pre>
 
APT::Install-Recommends "false";
 
APT::Install-Recommends "false";
 
</pre>
 
</pre>
 +
</blockquote>
  
For extreme minimalist :D
+
==== Network configuration ====
 
 
Network configuration:
 
  
 
If your router's IP address is 192.168.0.1 and the Parallella's IP address is 192.168.0.2,
 
If your router's IP address is 192.168.0.1 and the Parallella's IP address is 192.168.0.2,
  
 
<pre>
 
<pre>
$ sudo nano /tmp/mnt1/etc/network/interfaces
+
sudo nano /tmp/mnt1/etc/network/interfaces
 
</pre>
 
</pre>
 
+
(Edit and save.)
 +
<blockquote>
 
<pre>
 
<pre>
 
source-directory /etc/network/interfaces.d
 
source-directory /etc/network/interfaces.d
Line 152: Line 165:
  
 
auto eth0
 
auto eth0
 +
 +
# static network settings
 
iface eth0 inet static
 
iface eth0 inet static
 
   address 192.168.0.2
 
   address 192.168.0.2
Line 157: Line 172:
 
   gateway 192.168.0.1
 
   gateway 192.168.0.1
 
   up sleep 3; mii-tool -F 1000baseT-FD
 
   up sleep 3; mii-tool -F 1000baseT-FD
 +
 +
# If you prefer DHCP, comment out the above 5 lines, uncomment the below.
 +
#iface eth0 inet dhcp
 
</pre>
 
</pre>
 +
</blockquote>
  
 
<pre>
 
<pre>
$ sudo nano /tmp/mnt1/etc/resolv.conf
+
sudo nano /tmp/mnt1/etc/resolv.conf
 
</pre>
 
</pre>
  
 +
<blockquote>
 
<pre>
 
<pre>
 
nameserver 192.168.0.1
 
nameserver 192.168.0.1
 
</pre>
 
</pre>
 +
</blockquote>
  
 
<pre>
 
<pre>
$ sudo sync
+
sudo sync
$ sudo umount /tmp/mnt1
+
sudo umount /tmp/mnt1
 
</pre>
 
</pre>
  
*Insert the SD Card to the Parallella
+
Insert the SD Card to the Parallella,<br />
*Connect Ethernet only
+
power-on,<br />
*Power-on
+
Wait 30 seconds,<br />
*Wait 30 seconds
+
You'll see a root terminal.<br />
*Connect HDMI, USB keyboard
+
If it doesn't boot, press the reset button and try again.<br />
*You'll see a root terminal
+
 
*Install openssh-server
+
==== Install openssh-server ====
  
 
On the Parallella:
 
On the Parallella:
  
 
<pre>
 
<pre>
# apt-get install openssh-server
+
apt-get update
# sync
+
apt-get install openssh-server
 +
sync
 
</pre>
 
</pre>
  
Now you can login the Parallella from your PC.
+
Now you can login the Parallella from your PC.<br />
On the PC:
+
On the PC,
  
 
<pre>
 
<pre>
$ ssh linaro@192.168.0.2
+
ssh linaro@192.168.0.2
 
password: linaro
 
password: linaro
 
</pre>
 
</pre>
  
Let's see how lightweight it is.
+
==== Create device nodes ====
  
 
<pre>
 
<pre>
$ free
+
sudo mknod -m 600 /dev/ttyPS0 c 251 0
 +
sudo chown root:tty /dev/ttyPS0
 
</pre>
 
</pre>
 +
 +
==== Let's see how lightweight it is ====
  
 
<pre>
 
<pre>
total used free shared buffers cached
+
free
Mem: 992452 43696 948756 0 7512 13960
 
-/+ buffers/cache: 22224 970228
 
Swap: 0 0 0
 
 
</pre>
 
</pre>
  
Memory Consumption: Only 22MB !! :D  
+
<blockquote>
 +
<pre>
 +
            total      used      free    shared    buffers    cached
 +
Mem:       992452      38356    954096          0      1816      13076
 +
-/+ buffers/cache:      23464    968988
 +
Swap:            0          0          0
 +
</pre>
 +
</blockquote>
 +
 
 +
The memory consumption is only 23MB !! :D  
  
 
<pre>
 
<pre>
$ df
+
df
 
</pre>
 
</pre>
  
 +
<blockquote>
 
<pre>
 
<pre>
Filesystem 1K-blocks Used Available Use% Mounted on
+
Filesystem     1K-blocks   Used Available Use% Mounted on
/dev/root 1833872 270072 1452596 16% /
+
/dev/root       30348232 311108  28472452  2% /
none 99248 72 99176 1% /run
+
none               99248     68    99180  1% /run
none 5120 0 5120 0% /run/lock
+
none               5120     0     5120   0% /run/lock
none 496224 0 496224 0% /run/shm
+
none             496224     0   496224   0% /run/shm
none 102400 0 102400 0% /run/user
+
none             102400     0   102400   0% /run/user
 
</pre>
 
</pre>
 +
</blockquote>
  
Disk Consumption: Only 270MB !!
+
The disk consumption is only 304MB !!
 +
 
 +
== Additional Installation ==
 +
 
 +
==== Recommended Packages ====
  
 
<pre>
 
<pre>
$ ps axo pid,cmd,rss,vsz
+
sudo apt-get install vim-tiny nano fake-hwclock wget less unzip
 
</pre>
 
</pre>
 +
 +
==== Epiphany SDK ====
  
 
<pre>
 
<pre>
PID CMD RSS VSZ
+
sudo apt-get install build-essential man-db manpages-dev git libmpc-dev libmpc2 libgmp3-dev libmpfr-dev ca-certificates
1 /sbin/init 1696 2756
+
 
2 [kthreadd] 0 0
+
wget ftp://ftp.parallella.org/esdk/esdk.5.13.09.10_linux_armv7l.tgz
3 [ksoftirqd/0] 0 0
+
 
4 [kworker/0:0] 0 0
+
md5sum esdk.5.13.09.10_linux_armv7l.tgz
5 [kworker/0:0H] 0 0
+
</pre>
6 [kworker/u4:0] 0 0
+
 
7 [migration/0] 0 0
+
<blockquote>
8 [rcu_preempt] 0 0
+
<pre>
9 [rcu_bh] 0 0
+
52e3b60185c882c7641115993b6a72b5  esdk.5.13.09.10_linux_armv7l.tgz
10 [rcu_sched] 0 0
 
11 [migration/1] 0 0
 
12 [ksoftirqd/1] 0 0
 
13 [kworker/1:0] 0 0
 
14 [kworker/1:0H] 0 0
 
15 [khelper] 0 0
 
16 [kdevtmpfs] 0 0
 
17 [kworker/u4:1] 0 0
 
340 [writeback] 0 0
 
342 [bioset] 0 0
 
343 [kblockd] 0 0
 
361 [khubd] 0 0
 
384 [cfg80211] 0 0
 
468 [rpciod] 0 0
 
478 [khungtaskd] 0 0
 
483 [kswapd0] 0 0
 
484 [fsnotify_mark] 0 0
 
485 [nfsiod] 0 0
 
486 [crypto] 0 0
 
583 [.qspi] 0 0
 
627 [xemacps] 0 0
 
639 [aoe_tx0] 0 0
 
640 [aoe_ktio0] 0 0
 
654 [kpsmoused] 0 0
 
811 [mmcqd/0] 0 0
 
823 [binder] 0 0
 
849 [irq/39-] 0 0
 
898 [deferwq] 0 0
 
905 [kworker/1:1H] 0 0
 
906 [kworker/0:1H] 0 0
 
907 [kworker/1:1] 0 0
 
908 [jbd2/mmcblk0p2-] 0 0
 
909 [ext4-rsv-conver] 0 0
 
999 upstart-udev-bridge --daemo 720 1964
 
1006 /lib/systemd/systemd-udevd 1084 8712
 
1118 rsyslogd -c5 1400 30124
 
1439 upstart-socket-bridge --dae 420 1924
 
1441 upstart-file-bridge --daemo 764 2332
 
1517 /sbin/getty -8 38400 tty4 704 1796
 
1519 /sbin/getty -8 38400 tty5 704 1796
 
1529 /sbin/getty -8 38400 tty2 704 1796
 
1531 /sbin/getty -8 38400 tty3 704 1796
 
1534 /sbin/getty -8 38400 tty6 704 1796
 
1558 /usr/sbin/sshd -D 2080 5600
 
1563 cron 784 2324
 
1597 /bin/login -f 1256 3264
 
1613 -bash 1624 4280
 
3568 sshd: linaro [priv] 2708 8852
 
3591 sshd: linaro@pts/1 1432 8852
 
3594 -bash 1636 4272
 
4104 [kworker/0:2] 0 0
 
4269 /sbin/getty -n -l /bin/auto 684 1616
 
4272 ps axo pid,cmd,rss,vsz 840 3740
 
 
</pre>
 
</pre>
 +
</blockquote>
  
 
<pre>
 
<pre>
$ dpkg-query -Wf='${binary:Package}\n'
+
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
 
</pre>
 
</pre>
 +
(add to the bottom of the file)
  
 +
<blockquote>
 
<pre>
 
<pre>
adduser
+
EPIPHANY_HOME=/opt/adapteva/esdk
apt
+
. ${EPIPHANY_HOME}/setup.sh
apt-utils
 
base-files
 
base-passwd
 
bash
 
bsdutils
 
busybox-initramfs
 
console-setup
 
coreutils
 
cpio
 
cron
 
dash
 
debconf
 
debianutils
 
diffutils
 
dpkg
 
e2fslibs:armhf
 
e2fsprogs
 
file
 
findutils
 
gcc-4.8-base:armhf
 
gnupg
 
gpgv
 
grep
 
gzip
 
hostname
 
ifupdown
 
initramfs-tools
 
initramfs-tools-bin
 
initscripts
 
insserv
 
iproute
 
iproute2
 
iputils-ping
 
isc-dhcp-client
 
isc-dhcp-common
 
kbd
 
keyboard-configuration
 
klibc-utils
 
kmod
 
libacl1:armhf
 
libapt-inst1.5:armhf
 
libapt-pkg4.12:armhf
 
libattr1:armhf
 
libaudit-common
 
libaudit1:armhf
 
libblkid1:armhf
 
libbsd0:armhf
 
libbz2-1.0:armhf
 
libc-bin
 
libc6:armhf
 
libcap2:armhf
 
libck-connector0:armhf
 
libcomerr2:armhf
 
libdb5.1:armhf
 
libdbus-1-3:armhf
 
libdrm2:armhf
 
libedit2:armhf
 
libexpat1:armhf
 
libffi6:armhf
 
libfribidi0:armhf
 
libgcc1:armhf
 
libgcrypt11:armhf
 
libgnutls-openssl27:armhf
 
libgnutls26:armhf
 
libgpg-error0:armhf
 
libgssapi-krb5-2:armhf
 
libjson-c2:armhf
 
libjson0:armhf
 
libk5crypto3:armhf
 
libkeyutils1:armhf
 
libklibc
 
libkmod2:armhf
 
libkrb5-3:armhf
 
libkrb5support0:armhf
 
liblocale-gettext-perl
 
liblockfile-bin
 
liblockfile1:armhf
 
liblzma5:armhf
 
libmagic1:armhf
 
libmount1:armhf
 
libncurses5:armhf
 
libncursesw5:armhf
 
libnewt0.52:armhf
 
libnih-dbus1:armhf
 
libnih1:armhf
 
libp11-kit0:armhf
 
libpam-modules:armhf
 
libpam-modules-bin
 
libpam-runtime
 
libpam0g:armhf
 
libpcre3:armhf
 
libplymouth2:armhf
 
libpng12-0:armhf
 
libpopt0:armhf
 
libprocps0:armhf
 
libpython-stdlib:armhf
 
libpython2.7-minimal:armhf
 
libpython2.7-stdlib:armhf
 
libreadline6:armhf
 
libselinux1:armhf
 
libsemanage-common
 
libsemanage1:armhf
 
libsepol1:armhf
 
libslang2:armhf
 
libsqlite3-0:armhf
 
libss2:armhf
 
libssl1.0.0:armhf
 
libstdc++6:armhf
 
libtasn1-3:armhf
 
libtinfo5:armhf
 
libudev1:armhf
 
libusb-0.1-4:armhf
 
libustr-1.0-1:armhf
 
libuuid1:armhf
 
libwrap0:armhf
 
linaro-nano
 
linaro-overlay
 
linaro-overlay-minimal
 
locales
 
lockfile-progs
 
login
 
logrotate
 
lsb-base
 
makedev
 
mawk
 
mime-support
 
module-init-tools
 
mount
 
mountall
 
multiarch-support
 
ncurses-base
 
ncurses-bin
 
net-tools
 
netbase
 
netcat-openbsd
 
ntpdate
 
openssh-client
 
openssh-server
 
passwd
 
perl-base
 
plymouth
 
procps
 
python
 
python-minimal
 
python2.7
 
python2.7-minimal
 
readline-common
 
rsyslog
 
sed
 
sensible-utils
 
sudo
 
sysv-rc
 
sysvinit-utils
 
tar
 
tzdata
 
ubuntu-keyring
 
ucf
 
udev
 
upstart
 
util-linux
 
whiptail
 
xkb-data
 
zlib1g:armhf
 
 
</pre>
 
</pre>
 +
</blockquote>
 +
 +
==== Disable sshd hostname look-up ====
 +
(To fix slow SSH connections)
 +
<pre>
 +
sudo nano /etc/ssh/sshd_config
 +
</pre>
 +
(add to the bottom of the file)
 +
<blockquote>
 +
<pre>
 +
UseDNS no
 +
</pre>
 +
</blockquote>
 +
 +
==== Enable devtmpfs ====
 +
(and disable serial console: they are incompatible)
 +
<pre>
 +
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 wget https://raw.githubusercontent.com/parallella/parallella-linux-adi/xcomm_zynq/arch/arm/boot/dts/zynq-parallella.dts
 +
 +
sudo mv zynq-parallella.dts devicetree.dts
 +
sudo nano devicetree.dts
 +
</pre>
 +
(Search and Edit the "bootargs" line)
 +
<blockquote>
 +
<pre>
 +
bootargs = "root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait devtmpfs.mount=1";
 +
</pre>
 +
</blockquote>
 +
 +
<pre>
 +
sudo dtc -I dts devicetree.dts -O dtb -o devicetree.dtb
 +
cd /
 +
sync
 +
sudo reboot
 +
</pre>
 +
 +
That's all! Below are installation instructions of lightweight desktop environment.
 +
 +
= How to Install X environment to minimal headless system =
 +
 +
Demo video:
 +
http://youtu.be/6gpM57qB-I8
 +
 +
==== Install LXDE ====
 +
 +
<pre>
 +
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
 +
</pre>
 +
 +
==== Disable PCManFM Desktop mode ====
 +
(for faster displaying)
 +
<pre>
 +
sudo nano /etc/xdg/lxsession/LXDE/autostart
 +
</pre>
 +
(Delete the line "@pcmanfm --desktop --profile LXDE" and save.)
 +
 +
==== Set a background image ====
 +
 +
Put a background image file in your home directory.<br />
 +
(e.g. /home/linaro/background.png)<br />
 +
 +
<pre>
 +
sudo nano /etc/xdg/lxsession/LXDE/autostart
 +
</pre>
 +
(Append this line to the bottom of the file)
 +
 +
<blockquote>
 +
<pre>
 +
@feh --bg-scale /home/linaro/background.png
 +
</pre>
 +
</blockquote>
 +
 +
==== xorg configuration ====
 +
 +
<pre>
 +
sudo nano /etc/X11/xorg.conf
 +
</pre>
 +
 +
<blockquote>
 +
<pre>
 +
Section "Device"
 +
  Identifier "Card0"
 +
  Driver "modesetting"
 +
  Option "ShadowFB" "True"
 +
  Option "SWCursor" "True"
 +
  Option "HWCursor" "False"
 +
EndSection
 +
Section "Screen"
 +
  Identifier "Screen0"
 +
  Device "Card0"
 +
  SubSection "Display"
 +
#---- Uncomment your preferred mode ----
 +
    #Modes "1920x1200"
 +
    #Modes "1920x1080"
 +
    #Modes "1280x720"
 +
    #Modes "640x480"
 +
  EndSubSection
 +
EndSection
 +
</pre>
 +
</blockquote>
 +
 +
==== ALSA configuration ====
 +
 +
<pre>
 +
nano ~/.asoundrc
 +
</pre>
 +
(copy, paste and save)
 +
<blockquote>
 +
<pre>
 +
pcm.!default {
 +
type rate
 +
slave {
 +
  pcm "hw:0"
 +
  rate 48000
 +
}
 +
converter "samplerate"
 +
}
 +
</pre>
 +
</blockquote>
 +
 +
<pre>
 +
sync
 +
sudo reboot
 +
</pre>
 +
 +
==== How to login as a normal user ====
 +
 +
After booting, press Ctrl+Alt+F2
 +
<pre>
 +
login: linaro
 +
Password: linaro
 +
</pre>
 +
 +
Or, (easier way)<br />
 +
In the root prompt,<br />
 +
<pre>
 +
su linaro
 +
cd
 +
</pre>
 +
 +
==== Start X environment ====
 +
 +
<pre>
 +
startx
 +
</pre>
 +
 +
==== Install Firefox ====
 +
 +
<pre>
 +
sudo apt-get install firefox
 +
</pre>
 +
 +
==== Using a RAM disk for cache ====
 +
 +
<pre>
 +
sudo nano /etc/fstab
 +
</pre>
 +
(Add this line to the bottom of the file)
 +
<blockquote>
 +
<pre>
 +
tmpfs /home/linaro/.cache tmpfs noatime,nodev,nosuid,size=100M 0 0
 +
</pre>
 +
</blockquote>
 +
 +
==== Limit the cache size of Firefox ====
 +
On Firefox,<br />
 +
MENU->Edit->Preferences->Advanced->Network->Cached Web Content<br />
 +
[v]Override automatic cache management<br />
 +
Limit cache to [50] MB of space<br />
 +
 +
==== More responsive mouse wheel ====
 +
On Firefox,<br />
 +
Type "about:config" in URL bar,<br />
 +
mousewheel.acceleration.start : Double click, set [2]<br />
 +
 +
==== Install media player ====
 +
 +
<pre>
 +
sudo apt-get install smplayer
 +
</pre>
 +
 +
Launch smplayer,<br />
 +
Options->Preferences->Video->Output driver: x11<br />
 +
Options->Preferences->Audio->Output driver: alsa<br />

Revision as of 13:47, 6 April 2014

How to Install Linaro nano 14.03 (minimal headless system)

Copied here from Shodruk's forum post.

Requirements

Ubuntu PC, SD Card, SD Card adapter, Parallella

On the PC's terminal:

Download the files

wget -O rel.14.02.06.tgz https://github.com/parallella/parallella-bin/blob/master/rel.14.02.06.tgz?raw=true

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!!!)

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

Edit some configuration files

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

# static network settings
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

# If you prefer DHCP, comment out the above 5 lines, uncomment the below.
#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 !!

Additional Installation

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 wget https://raw.githubusercontent.com/parallella/parallella-linux-adi/xcomm_zynq/arch/arm/boot/dts/zynq-parallella.dts

sudo mv zynq-parallella.dts devicetree.dts
sudo nano devicetree.dts

(Search and Edit the "bootargs" line)

bootargs = "root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait devtmpfs.mount=1";
sudo dtc -I dts devicetree.dts -O dtb -o devicetree.dtb
cd /
sync
sudo reboot

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

How to Install X environment to minimal headless system

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-scale /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"
#---- Uncomment your preferred mode ----
    #Modes "1920x1200"
    #Modes "1920x1080"
    #Modes "1280x720"
    #Modes "640x480"
  EndSubSection
EndSection

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