#1.下载镜像并安装
https://www.raspberrypi.org/documentation/installation/installing-images/windows.md
安装之后, 启动, 默认不会使用全部的sd卡空间, 使用fdisk和resize2fs把剩余空间也使用进来
df -h
sudo fdisk /dev/mmcblk0
p
d
2
n
p
2
#enter
#enter
w
sudo reboot
sudo resize2fs /dev/mmcblk0p2
#2.设置静态ip(方便日后ssh)
vim /etc/network/interfaces
原内容有如下4行:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
修改为类似下面的:
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.2.129
netmask 255.255.255.0
gateway 192.168.2.2
修改DNS
注意, 这里像网上说的, 修改/etc/resolv.conf, 只是一时好用, 重启便会有问题. 正确的姿势是
sudo vi /etc/resolvconf/resolv.conf.d/base
添加
nameserver 192.168.2.1
重启.
#3. 修改源: 树莓派的源不能用正常的ubuntu的源, 会有问题, 国内比较好的
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi
##4. 安装ssh
sudo apt-get install ssh
##5. cross compile
http://airwiki.ws.dei.polimi.it/index.php/Cross-compiling_for_the_RaspberryPi