Blog Code Forum

ArchLinux:ARM

From Wiki.cyring.fr

Jump to: navigation, search

Contents

Installation

Raspberry Pi

Partitions

# fdisk -l
Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes, 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            2048      194559       96256    b  W95 FAT32
/dev/mmcblk0p2          194560    10680319     5242880   83  Linux
/dev/mmcblk0p3        10680320    15523839     2421760   83  Linux

Packages

# pacman -Syu
# pacman -S zsh
# pacman -S sudo
# pacman -S yaourt
# pacman -S rsync customizepkg

Configuration

/boot/

config.txt
disable_overscan=1
gpu_mem=64
cmdline.txt
quiet

/etc/

pacman.d/mirrorlist
### France
## Geo-IP based mirror selection and load balancing
# Server = http://mirror.archlinuxarm.org/armv6h/$repo
Server = http://fr.mirror.archlinuxarm.org/armv6h/$repo
hostname
RasPi
vconsole.conf
KEYMAP=fr
FONT=lat9w-16
FONT_MAP=8859-1_to_uni
locale.gen
en_US.UTF-8 UTF-8
# locale-gen
localtime
# ln -fs /usr/share/zoneinfo/Europe/Paris localtime
dhcpcd.conf
noipv6rs
sudoers
## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL
nanorc
## Constantly display the cursor position in the statusbar.  Note that
set const
## Use the blank line below the titlebar as extra editing space.
set morespace
## Don't display the helpful shortcut lists at the bottom of the screen.
set nohelp
## Don't wrap text at all.
set nowrap
## Color setup
## Makefiles
include "/usr/share/nano/makefile.nanorc"
## Cascading Style Sheets
include "/usr/share/nano/css.nanorc"
## HTML
include "/usr/share/nano/html.nanorc"
## PHP
include "/usr/share/nano/php.nanorc"
## Perl
include "/usr/share/nano/perl.nanorc"
## Python
include "/usr/share/nano/python.nanorc"
## Ruby
include "/usr/share/nano/ruby.nanorc"
## Java
include "/usr/share/nano/java.nanorc"
## Assembler
include "/usr/share/nano/asm.nanorc"
## Bourne shell scripts
include "/usr/share/nano/sh.nanorc"
modprobe.d/blacklist.conf
blacklist ipv6
modules-load.d/raspi.conf
snd-bcm2835
ld.so.conf.d/vc.conf
/opt/vc/lib
# ldconfig
fstab
# <file system>         <dir>         <type>    <options>          <dump> <pass>
devpts                  /dev/pts      devpts    defaults            0      0
shm                     /dev/shm      tmpfs     nodev,nosuid        0      0

/dev/disk/by-label/BOOT /boot         vfat      defaults            0      0
/dev/disk/by-label/ROOT /             ext4      discard,noatime,nodiratime,defaults 0 1
/dev/disk/by-label/HOME /home         ext4      discard,noatime,nodiratime,defaults 0 2

/home/

New user
  • as root
# adduser <login>
  • as the new user
$ mkdir ~/Downloads
$ mkdir ~/bin
$ mkdir ~/src
$ mkdir ~/tmp
$ chmod +t ~/tmp
$ mkdir ~/usr
.zshrc

  1. # Lines configured by zsh-newuser-install
  2. HISTFILE=~/.histfile
  3. HISTSIZE=1000
  4. SAVEHIST=1000
  5. unsetopt beep
  6. bindkey -e
  7. # End of lines configured by zsh-newuser-install
  8. # The following lines were added by compinstall
  9. zstyle :compinstall filename '/home/<login>/.zshrc'
  10.  
  11. autoload -Uz compinit
  12. compinit
  13. # End of lines added by compinstall
  14. autoload -U compinit promptinit
  15. compinit
  16. promptinit
  17. prompt adam2
  18. zstyle ':completion:*' menu select
  19. setopt completealiases
  20.  
  21. export LESS_TERMCAP_mb=$'\E[01;31m'
  22. export LESS_TERMCAP_md=$'\E[01;31m'
  23. export LESS_TERMCAP_me=$'\E[0m'
  24. export LESS_TERMCAP_se=$'\E[0m'
  25. export LESS_TERMCAP_so=$'\E[01;44;33m'
  26. export LESS_TERMCAP_ue=$'\E[0m'
  27. export LESS_TERMCAP_us=$'\E[01;32m'
  28.  
  29. export EDITOR=nano
  30.  
  31. alias grep='grep --color=auto'
  32. alias egrep='egrep --color=auto'
  33. alias fgrep='fgrep --color=auto'
  34. alias ll='ls -hl --color=auto'
  35. alias la='ls -hAl --color=auto'
  36. alias l='ls -CF --color=auto'
  37. alias p='ps -eo user:5,pid:6,pcpu:5,rss:7,nlwp:2,comm --sort +pcpu,+rss'
  38. alias nedit='nedit -xrm "*fontList:fixed"'
  39.  
  40. # https://wiki.archlinux.org/index.php/Zsh#Key_Bindings
  41. # create a zkbd compatible hash;
  42. # to add other keys to this hash, see: man 5 terminfo
  43. typeset -A key
  44.  
  45. key[Home]=${terminfo[khome]}
  46.  
  47. key[End]=${terminfo[kend]}
  48. key[Insert]=${terminfo[kich1]}
  49. key[Delete]=${terminfo[kdch1]}
  50. key[Up]=${terminfo[kcuu1]}
  51. key[Down]=${terminfo[kcud1]}
  52. key[Left]=${terminfo[kcub1]}
  53. key[Right]=${terminfo[kcuf1]}
  54. key[PageUp]=${terminfo[kpp]}
  55. key[PageDown]=${terminfo[knp]}
  56.  
  57. # setup key accordingly
  58. [[ -n "${key[Home]}"    ]]  && bindkey  "${key[Home]}"    beginning-of-line
  59. [[ -n "${key[End]}"     ]]  && bindkey  "${key[End]}"     end-of-line
  60. [[ -n "${key[Insert]}"  ]]  && bindkey  "${key[Insert]}"  overwrite-mode
  61. [[ -n "${key[Delete]}"  ]]  && bindkey  "${key[Delete]}"  delete-char
  62. [[ -n "${key[Up]}"      ]]  && bindkey  "${key[Up]}"      up-line-or-history
  63. [[ -n "${key[Down]}"    ]]  && bindkey  "${key[Down]}"    down-line-or-history
  64. [[ -n "${key[Left]}"    ]]  && bindkey  "${key[Left]}"    backward-char
  65. [[ -n "${key[Right]}"   ]]  && bindkey  "${key[Right]}"   forward-char
  66.  
  67. # Finally, make sure the terminal is in application mode, when zle is
  68. # active. Only then are the values from $terminfo valid.
  69.  
  70. function zle-line-init () {
  71.     echoti smkx
  72. }
  73. function zle-line-finish () {
  74.     echoti rmkx
  75. }
  76.  
  77. ## zle -N zle-line-init
  78. ## zle -N zle-line-finish
  79. # End Of Wiki
  80.  
  81. export PATH=$PATH:$HOME/bin:$HOME/usr/bin
  82. export MANPATH=`manpath`:$HOME/usr/share/man

Remote

Terminal

Client [x86_64]

$ ssh <login>@RasPi

X11 forwarding

Client [x86_64]

/etc/ssh/ssh_config
ForwardX11 yes

Server [Raspberry Pi]

/etc/ssh/sshd_config
AllowTcpForwarding yes
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
Commands
  • [x86_64]
$ ssh -X <login>@RasPi
--- OR ---
$ ssh -Y <login>@RasPi
  • [Raspberry Pi]
$ xterm -fg grey -bg black &

Local

Xfce Desktop

# pacman -S xfce4 xf86-video-fbdev xorg-server xfce4-screenshooter xterm nedit

/etc/X11/xorg.conf.d/

10-evdev.conf
Section "InputClass"
	Identifier	"evdev keyboard catchall"
	MatchIsKeyboard	"on"
	MatchDevicePath	"/dev/input/event*"
	Driver		"evdev"
	Option		"xkb_layout" "fr"
	Option		"xkbOptions" "terminate:ctrl_alt_bksp"
EndSection

Start it up

$ startxfce4

Programming

ArchLinux:ARM:Programming

Applications

Chrome

Download it

$ yaourt libxss
$ yaourt xulrunner
$ yaourt gconf
$ yaourt ttf-droid

$ cd ~/Downloads
$ wget distribution-eu.hexxeh.net/chromium-rpi/chromium-rpi-r22.tar.gz
$ tar -zxvf chromium-rpi-r22.tar.gz

$ cd /opt
$ sudo mkdir google
$ cd google
$ sudo mv ~/Downloads/chrome .
$ sudo chmod 4755 chrome/chrome-sandbox

$ sudo ln -s /usr/lib/libudev.so.1 /usr/lib/libudev.so.0

$ cd
$ echo "/opt/google/chrome/chrome -disable-ipv6" > ~/bin/chrome
$ source /etc/profile.d/mozilla-common.sh
$ ~/bin/chrome &

Cross-compile it [DRAFT]

x86_64 <SERVER>
  • cross compilation monitoring
$ distccmon-text 3
arm master
$ yaourt -S git
$ yaourt -S subversion
$ yaourt -S python2

$ mkdir ~/src/chrome
$ cd ~/src/chrome
$ git clone https://git.chromium.org/chromium/tools/depot_tools.git
$ nano depot_tools/gclient
$ export PATH="$PATH":`pwd`/depot_tools

$ mkdir lkgr
$ cd lkgr
$ gclient config https://src.chromium.org/svn/trunk/src https://chromium-status.appspot.com/lkgr
$ gclient sync --deps="unix,chromeos" --force
depot_tools/gclient
  • change python to python2
base_dir=$(dirname "$0")

if [[ "#grep#fetch#cleanup#diff#" != *"#$1#"* ]]; then
  "$base_dir"/update_depot_tools
fi

PYTHONDONTWRITEBYTECODE=1 exec python2 "$base_dir/gclient.py" "$@"

FileZilla

FileZilla.png

$ yaourt -S filezilla

VLC

$ yaourt -S vlc

Hardware

Video

HDMI

List Modes
$ /opt/vc/bin/tvservice -m CEA
$ /opt/vc/bin/tvservice -m DMT
Get Status
/opt/vc/bin/tvservice -s
Set Mode
/opt/vc/bin/tvservice -e "CEA 16"

Audio

$ yaourt -S pulseaudio
$ yaourt -S pulseaudio-alsa
$ yaourt -S alsa-utils
$ yaourt -S libmikmod libmad libid3tag audiofile
$ yaourt -S alsaplayer

$ sudo amixer cset numid=3 1
$ alsamixer

$ cd ~/Downloads
$ wget http://upload.wikimedia.org/wikipedia/commons/5/55/Air.ogg
$ alsaplayer Air.ogg &

AlsaMixer.png


AlsaPlayer.png


Sensors

Temperature

$ cat /sys/devices/virtual/thermal/thermal_zone0/temp

« 51382 »

Personal tools