ArchLinux:ARM
From Wiki.cyring.fr
| Contents | 
Installation
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 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
/home/
<login>
# adduser $ mkdir ~/Downloads $ mkdir ~/bin $ mkdir ~/src
.zshrc
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
unsetopt beep
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/<login>/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
autoload -U compinit promptinit
compinit
promptinit
prompt adam2
zstyle ':completion:*' menu select
setopt completealiases
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
export EDITOR=nano
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias ll='ls -hl --color=auto'
alias la='ls -hAl --color=auto'
alias l='ls -CF --color=auto'
alias p='ps -eo user:5,pid:6,pcpu:5,rss:7,nlwp:2,comm --sort +pcpu,+rss'
# https://wiki.archlinux.org/index.php/Zsh#Key_Bindings
# create a zkbd compatible hash;
# to add other keys to this hash, see: man 5 terminfo
typeset -A key
key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}
# setup key accordingly
[[ -n "${key[Home]}"    ]]  && bindkey  "${key[Home]}"    beginning-of-line
[[ -n "${key[End]}"     ]]  && bindkey  "${key[End]}"     end-of-line
[[ -n "${key[Insert]}"  ]]  && bindkey  "${key[Insert]}"  overwrite-mode
[[ -n "${key[Delete]}"  ]]  && bindkey  "${key[Delete]}"  delete-char
[[ -n "${key[Up]}"      ]]  && bindkey  "${key[Up]}"      up-line-or-history
[[ -n "${key[Down]}"    ]]  && bindkey  "${key[Down]}"    down-line-or-history
[[ -n "${key[Left]}"    ]]  && bindkey  "${key[Left]}"    backward-char
[[ -n "${key[Right]}"   ]]  && bindkey  "${key[Right]}"   forward-char
# Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
function zle-line-init () {
    echoti smkx
}
function zle-line-finish () {
    echoti rmkx
}
## zle -N zle-line-init
## zle -N zle-line-finish
# End Of Wiki
Remote
Terminal
$ ssh <login>@RasPi
Desktop
Xfce
# pacman -S xfce4 xf86-video-fbdev xorg-server xfce4-screenshooter xterm
/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
HowTo Cross-compiling
arm master
# pacman -S base-devel distcc # pacman -S gdb ddd # nano /etc/makepkg.conf # nano /etc/distcc/hosts
/etc/makepkg.conf
MAKEFLAGS="-j3" BUILDENV=(fakeroot distcc color !ccache check !sign) DISTCC_HOSTS="<Master_HostName>"
/etc/distcc/hosts
<Master_HostName> 127.0.0.1
x86_64 client
# pacman -S distcc # nano /etc/makepkg.conf # nano /etc/conf.d/distccd # nano /etc/hosts.allow # systemctl enable distccd # systemctl start distccd
/etc/makepkg.conf
MAKEFLAGS="-j9"
/etc/conf.d/distccd
DISTCC_ARGS="--user nobody --allow 192.168.1.0/24"
/etc/hosts.allow
distccd:192.168.1.
Sample
Calculator
cross compile
 
$ nano ~/src/fcalc.c $ distcc -o bin/fcalc src/fcalc.c
debug
$ ddd ~/bin/fcalc
~/src/fcalc.c
#include <stdio.h>
#include <stdlib.h>
int	fcalc(char *f, char op, int a, int b)
{
	int c = 0;
	*f = 0;
	switch(op)
	{
		case '+': c = a + b;
		break;
		case '-': c = a - b;
		break;
		case 'x':
		case '*': c = a * b;
		break;
		case '/': if(b != 0)
				c = (int) (a / b);
			  else
				*f = 1;
		break;
	}
	return(c);
}
int	main(int argc, char * argv[])
{
	char f = 0;
	int  r = 0;
	if(argc == 4)
	{
		r = fcalc( &f, argv[1][0], atoi(argv[2]), atoi(argv[3]) );
		if( !f )
			printf("%d\n", r);
		else
			printf("DIV/0\n");
	}
	else
		printf(	"Usage: %s Op Num1 Num2\n"    \
			"where\n\tOp is + - x * /\n"  \
			"\tNum#1 is first argument\n" \
			"\tNum#2 is second argument\n", argv[0]);
	return(r);
}
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
x86_64 client
- 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
$ 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 $ $ alsamixer
Sensors
Temperature
$ cat /sys/devices/virtual/thermal/thermal_zone0/temp
« 51382 »
