Appunti microSD per schede Acme

Salva la configurazione di Linux

make ARCH=arm savedefconfig 
cp defconfig arch/arm/configs/acme-arietta_defconfig

Salva la configurazione di Buildroot

make savedefconfig 
cp defconfig arch/arm/configs/acme-arietta_defconfig

Create a branch of your Linux Kernel sources

$ git init
$ git add .
$ git commit -m "Vanilla"
$ git branch acme
$ git checkout acme

Create a patch of your branch:

$ git checkout acme
$ git diff master > acme.patch

Apply a patch:

$ patch -p1 < filename.patch

Revert a patch

patch -p1 -R < ../patch-2.6.11.1

Pulizia prima di pubblicare

root@arietta:~# apt-get clean
root@arietta:~# cat /dev/null > /var/log/lastlog
root@arietta:~# cat /dev/null > .bash_history

Montefusco's Tricks

git config --global http.sslVerify false

Creare una patch

$ git checkout acme
$ git diff master > acme.patch

Buildroot: Salva la configurazione di buidroot attuale in board

make savedefconfig

Buildroot: Salva la configurazione del kernel Linux in board

make linux-update-defconfig

Busybox

make busybox-menuconfig

Preparazione microSD Acqua

#per far funzionare la wifi
apt-get install wireless-tools

#Firmware del modulo WiFi
apt-get install firmware-ralink

#Per collegarsi in WiFi
apt-get install wpasupplicant

#Per far funzionare killall
apt-get install psmisc

apt-get install gcc

apt-get install evtest

#Per X
apt-get install xorg

Per calibrare il touch va scaricato il package xinput-calibrator dal repository sid:

# wget http://ftp.us.debian.org/debian/pool/main/x/xinput-calibrator/xinput-calibrator_0.7.5+git20140201-1_armhf.deb
# dpkg -i xinput-calibrator_0.7.5+git20140201-1_armhf.deb
# xinput_calibrator

Non sono sicuro che serva ma andrebbe indagato

apt-get install iw
General setup  --->
    -> Kernel .config support
    <*> Kernel .config support 
    [*]   Enable access to .config through /proc/config.gz 

General setup  --->
    Timers subsystem  --->  
        [*] High Resolution Timer Support 

[*] Networking support  ---> 
    -*-   Wireless  --->        
    [*]     cfg80211 wireless extensions compatibility   

/etc/network/interfaces

auto wlan0
iface wlan0 inet dhcp
wpa-ssid Vodafone-23812521
wpa-psk acmesystemsrobertosergio
wireless-mode managed
wireless-essid any
wpa-driver wext
wpa-ap-scan 2
wpa-proto RSN
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK

/etc/udev/rules.d/70-persistent-net.rules

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

Preparare la microSD per Arietta G25

Aggiornare l'index dei package

# apt-get update

WiFi

# apt-get install usbutils
# apt-get install iw
# apt-get install firmware-ralink
# apt-get install wpasupplicant

/etc/network/interfaces

auto lo
iface lo inet loopback

pre-up modprobe g_ether
auto usb0
iface usb0 inet static
metric 1000
address 192.168.10.10
netmask 255.255.255.0
#gateway 192.168.10.20

auto wlan0
iface wlan0 inet dhcp
    wireless-essid any
    pre-up wpa_supplicant -i wlan0 -c /boot/wpa_supplicant.conf -B
    post-down killall -q wpa_supplicant

/boot/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
ap_scan=1

network={
    ssid="Vodafone-Guest"
    psk="ariettag25"
    scan_ssid=1
    proto=WPA RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP TKIP
    group=CCMP TKIP
}

Installare Apache2 e PHP5

# apt-get install apache2 php5

Installare git

# apt-get install git

Aggiungere un utente di default

# adduser acme
Enter new UNIX password: acmesystems

Installa la pagina web di default

# cd /var/www
/var/www # git clone git://github.com/AcmeSystems/arietta-www
/var/www # rm -Rf html
/var/www # mv arietta-www html

Installare gli esempi

# cd /home/acme
/home/acme # git clone git://github.com/AcmeSystems/arietta4click
/home/acme # rm -R o+w arietta4click

Installare NTP

Installare Codiad

Installare Bonjour

# apt-get install libnss-mdns

Installare c e c++

# apt-get install gcc
# apt-get install g++

Installare python

# apt-get install python
# apt-get install python-serial
# apt-get install python-smbus

Installare sudo

# apt-get install sudo

e aggiungere l'utenza acme nel file /etc/sudoers

acme   ALL=(ALL:ALL) ALL

Installare sqLite3

# apt-get install sqlite3

Installare Tornado

# apt-get install python-tornado
# apt-get install sqlite3

/etc/ssh/sshd.conf

Change PermitRootLogin without-password

in PermitRootLogin yes

Configurazione lighttpd

server.modules = (
    "mod_access",
    "mod_alias",
    "mod_compress",
    "mod_redirect",
    "mod_proxy",
    "mod_fastcgi",
#       "mod_rewrite",
)

server.document-root        = "/var/www"
server.upload-dirs          = ("/var/cache/lighttpd/uploads")
#server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80


index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"


fastcgi.server = ( 
    ".php" => ((
         "bin-path" => "/usr/bin/php-cgi",
         "socket" => "/tmp/php.socket"
)))

proxy.server = ( 
    "/shell" => 
    ( ( 
        "host" => "127.0.0.1",
        "port" => 4200
    ) )
)

Script per salvataggio e rispristino microSD

get.sh

#!/bin/sh
tar -cvjSf boot.tar.bz2 -C /media/$USER/boot .
sudo tar -cvjSf rootfs.tar.bz2 -C /media/$USER/rootfs . 

put.sh

#!/bin/sh
tar -xvjpSf boot.tar.bz2 -C /media/$USER/boot 
sudo tar -xvjpSf rootfs.tar.bz2 -C /media/$USER/rootfs