Chon · 翀

The Neverland Blog

Raspberry Pi

Raspbian

Post Install for Wi-Fi /boot/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    scan_ssid=1
    ssid="SSID"
    psk="PSK"
    key_mgmt=WPA-PSK
}

Wi-Fi /etc/wpa_supplicant/wpa_supplicant.conf

$ ifdown wlan0
$ ifup wlan0

Configuration

echo -n '' > '/Volumes/boot/ssh';
echo 'RPI3BP' > '/etc/hostname';
rm -f '/etc/localtime';
echo 'Asia/Shanghai' > '/etc/timezone';
dpkg-reconfigure --frontend noninteractive tzdata;
echo 'en_US.UTF-8 UTF-8' > '/etc/locale.gen';
echo 'LANG=en_US.UTF-8' > '/etc/default/locale';
dpkg-reconfigure --frontend noninteractive locales;
/usr/bin/raspi-config --expand-rootfs;
$ dpkg-reconfigure locales
$ dpkg-reconfigure tzdata
$ dpkg-reconfigure keyboard-configuration
$ export LANGUAGE=en_US.UTF-8
$ export LANG=en_US.UTF-8
$ export LC_ALL=en_US.UTF-8
$ locale-gen en_US.UTF-8

edit /etc/default/keyboard

$ setxkbmap us

seccomp fix

$ wget 'http://ftp.cn.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.4-1+b1_armhf.deb' -O 'libseccomp2_2.5.4-1+b1_armhf.deb'
$ dpkg -i 'libseccomp2_2.5.4-1+b1_armhf.deb'

Unnecessary

$ systemctl stop hciuart.service && systemctl disable hciuart.service
$ systemctl stop bluetooth.service && systemctl disable bluetooth.service
$ systemctl stop avahi-daemon.service && systemctl disable avahi-daemon.service
$ systemctl stop alsa-state.service && systemctl disable alsa-state.service
$ systemctl stop alsa-restore.service && systemctl disable alsa-restore.service
$ systemctl stop triggerhappy.service && systemctl disable triggerhappy.service

$ systemctl stop avahi-daemon.socket && systemctl disable avahi-daemon.socket
$ systemctl stop triggerhappy.socket && systemctl disable triggerhappy.socket

$ systemctl stop sound.target && systemctl disable sound.target

$ systemctl stop apt-daily.timer
$ systemctl stop apt-daily-upgrade.timer

Basic packages

$ apt update -y && apt dist-upgrade -y && apt autoremove -y && apt clean all

Audio

$ alsamixer

macOS

write to sd card

$ diskutil list
$ diskutil unmountDisk /dev/disk2
$ sudo dd if=~/Downloads/image.img of=/dev/disk2 bs=512k

apt sources

$ sudo apt-get autoremove -y "wolfram*"
$ sudo rm -rf "/etc/apt/sources.list.d/wolfram.list"
$ sudo rm -rf "/etc/apt/sources.list.d/collabora.list"

edit /etc/apt/sources.list

deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi```

GPG error

apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 8B48AD6246925553

BCM2835

drivers

$ wget "http://www.airspayce.com/mikem/bcm2835/bcm2835-1.38.tar.gz"
$ tar zxf "bcm2835-1.38.tar.gz"
$ ./configure
$ make
$ make check
$ sudo make install

wiringPi

$ git clone "git://git.drogon.net/wiringPi"
$ cd wiringPi
$ ./build