Skip to content

Instantly share code, notes, and snippets.

@maxp
Created April 29, 2014 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxp/11404752 to your computer and use it in GitHub Desktop.
Save maxp/11404752 to your computer and use it in GitHub Desktop.
Raspberry Pi Setup - embedded
### Raspberry Pi setup
(29.04.2014)
http://downloads.raspberrypi.org/raspbian_latest
# 2014-01-07-wheezy-raspbian.zip
dd if=2014-01-07-wheezy-raspbian.img od=/dev/mmcblk0
gparted - resize: 2Gb (/), xxGb (/home)
raspi-config:
locale: en_US.UTF-8
timezone: Asia/Irkutsk
keyboard: English-US
user: pi, password: xxx
boot: commandline
GPU memory: - minimum
ssh: enable
/etc/network/interfaces:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.xx.xx.yy
netmask 255.255.255.0
gateway 10.xx.xx.zz
#.
echo "" > /etc/motd
apt-get remove dphys-swapfile
apt-get update
apt-get upgrade
? apt-get install vim ntpdate
? apt-get install ppp wvdial
/etc/wvdial.conf:
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
Baud = 9600
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
[Dialer megafon]
Modem = /dev/ttyUSB0
Baud = 115200
Init1 = ATZ
Init2 = AT+CGDCONT=1,"IP","internet"
Dial Command = ATD
Phone = *99***1#
Stupid Mode = 1
Username = \n
Password = \n
#.
/etc/fstab:
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat ro 0 2
/dev/mmcblk0p2 / ext4 ro 0 1
/dev/mmcblk0p3 /home ext4 defaults,noatime 0 2
tmpfs /tmp tmpfs defaults,mode=1777,size=1M 0 0
tmpfs /var/log tmpfs nodev,nosuid,mode=0755,size=1M 0 0
tmpfs /var/lock tmpfs nodev,nosuid,mode=0755,size=64k 0 0
tmpfs /var/lib/sudo tmpfs nodev,nosuid,mode=0700,size=64k 0 0
#.
apt-get purge --auto-remove scratch
apt-get purge --auto-remove debian-reference-en dillo idle3 python3-tk idle python-pygame python-tk
apt-get purge --auto-remove lightdm gnome-icon-theme raspberrypi-artwork
apt-get purge --auto-remove gvfs-backends gvfs-fuse desktop-base lxpolkit netsurf-gtk zenity
apt-get purge --auto-remove gtk2-engines alsa-utils lxde lxtask menu-xdg gksu xdg-utils
apt-get purge --auto-remove midori xserver-xorg xinit xserver-xorg-video-fbdev lxde-icon-theme
apt-get purge --auto-remove dbus-x11 libx11-6 libx11-data libx11-xcb1 x11-common x11-utils
rm -rf /usr/share/icons/
rm -rf /lib/modules/3.10.25+/kernel/sound/
rm /etc/cron.weekly/man.db
rm /etc/cron.daily/man.db
rm from /etc/cron.daily/all except [logrotate,ntp,passwd]
mount --bind / /mnt
rm /mnt/var/log/*
rm /mnt/var/swap
/boot/cmdline.txt:
root=... ro ...
/sbin/fake-hwclock:
FILE=/home/.fake-hwclock.data
/etc/cron.daily/logrotate:
#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate --state /var/log/.logrotate.state /etc/logrotate.conf
#.
mount / -o remount,rw
...
mount / -o remount,ro
# ?
/usr/lib/dhcpcd/dhcpcd-hooks/50-ntp:
#!/bin/sh
case "${reason}" in
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC)
# "-g" allows for large time differences
ntpd -qg
;;
esac
#.
### Other
http://archive.raspbian.org/raspbian/dists/wheezy/main/binary-armhf/Packages
/etc/apt/sources.list:
deb http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi
deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi
#.
wget http://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add -
#
-march=armv6
-mfpu=vfp
-mfloat-abi=hard
###.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment