Raspberry Pi: resources

Resources

Raspberry Pi

http://www.raspberrypi.org/documentation/configuration/device-tree.md

http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=97314

https://github.com/Hexxeh/rpi-firmware/tree/master/overlays

ArchLinux

http://archlinuxarm.org/platforms/armv6/raspberry-pi

http://archpi.dabase.com/

https://wiki.archlinux.org/index.php/Raspberry_Pi

http://elinux.org/ArchLinux_Install_Guide

http://docs.rpi-dashboard.com/system_configuration/enable_spi.html
http://www.raspberrypi.org/tag/arch-linux/

http://docs.rpi-dashboard.com/build_from_source/build_on_arch_linux.html

Raspberry Pi: status

How are you today?

#!/bin/bash                                                               
for src in arm core h264 isp v3d uart pwm emmc pixel vec hdmi dpi
do
    echo -e "$src:\t$(vcgencmd measure_clock $src)"
done                                  
for id in core sdram_c sdram_i sdram_p
do
    echo -e "$id:\t$(vcgencmd measure_volts $id)"
done
vcgencmd codec_enabled MPG2
vcgencmd codec_enabled WVC1                   

Synology: Preserve your path

After DSM update ipkg/opkg stops working.

Always remember > Trust is good – verification is better

EDIT: apply to /root/.profile as well

Use your favorite ssh-client to connect to your diskstation as root

# ssh root@your-ds
# cp /etc/profile /etc/profile.org
# vi /etc/profile

If you mess up in vi Esc:q! and start again

Find the line reading

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin

Place the cursor under the first slash ‘/’ and press i to insert text.

Modify path according to your environment ipkg or opkg

PATH=opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin

PATH=/Apps/opt/bin:/Apps/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin

Press Esc to go back to command mode and then press uppercase Z twice to save and close vi.

For good measure – verify the changes you made

# cat /etc/profile

Activate the path modification by sourcing profile

# source /etc/profile

During the next DSM update your profile will probably be replaced by the update process and to prevent that you can make the file readonly by doing

# chmod 0444 /etc/profile[/code]

Arch: Install using TFTP

Local pxe installation

Remember – every action by YOU is YOUR responsibility – not mine.

Recommended reading

The following is my preferences

  • and therefore might not suit you – so change what ever you like, to fit your needs.

The approach is more than average geeky, and requires a local server to serve pxe-boot and fast internet connection, but you will benefit by getting an up2date killer-installation just as you prefer it.

You need at machine to serve as TFTP server. If you have Synology NAS you are in luck.

The machine you want to install must be able to boot from the network. This is a setting in BIOS.

When booted you must select an installation mirror. It makes sense to select a mirror in your neighborhood – or at least in your country

http://mirrors.dotsrc.org/archlinux/$repo/os/$arch

Above mirror is Ålborg University in Denmark so this works for me.

Wait while 250MB data is fetched …

Keyboard layout

# loadkeys dk

Get disk ready

remember backup – all my files is located at network-shares so this works for me.

# sgdisk --zap-all /dev/sdc
# reboot

The terminal font can be a pain (this one lacks danish accent chars æøå) but is good on my tired eyes

# setfont Lat2-Terminus16

This one has support for above mentioned accent chars

# setfont cp865-8x16

Partitioning

I run from a PCIe card with mSATA disk raid so my bootdrive is not the common choice. You will need to modify according to your actual setup

# cgdisk /dev/sdc

    sdc1 type 8200 name root filesystem ext4
    sdc2 type 8302 name home filesystem ext4
    sdc3 type 8300 name boot filesystem ext2

Create filesystems and mount them

# mkfs.ext4 /dev/sdc1
# mkfs.ext4 /dev/sdc2 
# mkfs.ext2 /dev/sdc3
# mount /dev/sdc1 /mnt
# mkdir /mnt/home
# mkdir /mnt/boot
# mount /dev/sdc2 /mnt/home
# mount /dev/sdc3 /mnt/boot
# lsblk -f

Base installation

# pacman -Syy                                                 
# pacstrap /mnt base base-devel
# genfstab -U -p /mnt >> /mnt/etc/fstab
# cat /mnt/etc/fstab
# arch-chroot /mnt /bin/bash

Locale

# echo LANG=da_DK.UTF-8 > /etc/locale.conf
# echo da_DK.UTF-8 UTF-8 > /etc/locale.gen
# locale-gen                                                  
# echo KEYMAP=dk > /etc/vconsole.conf            
# echo FONT=Lat2-Terminus16 >> /etc/vconsole.conf
# ln -s /usr/share/zoneinfo/Europe/Copenhagen /etc/localtime  
# hwclock --systohc --utc

Network

# echo ts1 > /etc/hostname
# nano /etc/hosts

    127.0.0.1         localhost.localdomain    localhost
    127.0.1.1         sfinx
    192.168.10.200    sfinx.uex.lan sfinx

Info

# ip link
# ip addr

DHCP

# systemctl enable            

Boot-loader

# pacman -S gptfdisk syslinux
# syslinux-install_update -iam                      
# nano /boot/syslinux/syslinux.cfg

    ...
    LABEL arch
        ...
        APPEND root=/dev/sdc3 rw
        ...
    LABEL archfallback
        ...
        APPEND root=/dev/sdc3 rw
        ...

The raisin in the hotdog-end

# passwd                                            
# exit
# umount -R /mnt
# reboot

References

Beginners’ guide
Installation guide
General recommendations

Arch: XDMCP

XDMCP desktop over LAN

Install XDM, LightDM and a greeter

$ sudo pacman -S xorg-xdm lightdm lightdm-gtk-greeter

/etc/X11/xdm/Xaccess => remove # at beginning of line

#*                  #any host can get a login window    

/etc/X11/xdm/Xservers => insert # at beginning of line

:0 local /usr/bin/X :0

/etc/X11/xdm/xdm-config => insert ! at beginning of line

DisplayManager.requestPort: 0

/etc/lightdm/lightdm.conf => edit section [XDMCPServer]

[XDMCPServer]
enabled=true
port=177
#key=

su

$ su -l root
# xdm -config /etc/X11/xdm/xdm-config
# exit

Activate and start LightDM

$ sudo systemctl enable lightdm
$ sudo systemctl start lightdm

Install Xming on Windows.

I recommend the donation approach. These versions are much-much than community version.

Arch: Oracle java

Archlinux bruger som standard openJDK javamiljø og Android Studio bygger på JetBrains IntelliJ som igen fungerer bedst med Oracle Java.

Rettelse:
Installer fra AUR med pacaur

$ pacaur -S jdk

Men man kan da også tage denne løsning:

Download JRE og JDK fra Oracle tech network

Opret mapperne {version} erstattes med den hentede version.

For Java jre-8u25-linux-x64.tar.gz indsættes 8u25 eller blot 8

$ sudo mkdir --parent /usr/lib/jvm/java-{version}-oraclejre
$ sudo mkdir --parent /usr/lib/jvm/java-{version}-oraclejdk

Udpak arkiverne

$ tar -xf ~/Downloads/jre-8u25-linux-x64.tar.gz
$ tar -xf ~/Downloads/jre-8u25-linux-x64.tar.gz

Kopier de udpakkede filer til de respektive mapper

$ sudo cp --recursive ./jre1.8.0_25/* /usr/lib/jvm/java-8-oraclejre
$ sudo cp --recursive ./jdk1.8.0_25/* /usr/lib/jvm/java-8-oraclejdk

Brug archlinux-java status for at vis aktuelle konfiguration.

$ archlinux-java status

Hvis ovenstående giver en fejlmeddelelse skal pakkerne java-runtime-common og java-environment-common installeres.

Det er pakken java-runtime-common som indeholder scriptet archlinux-java.

$ sudo pacman -Syyu java-runtime-common java-environment-common

Sæt det ønskede miljø med på denne måde

$ sudo archlinux-java set java-8-oraclejdk