OpenWRT 树莓派编译 & 烧写

来源:互联网 发布:淘宝几十元澳洲羊毛被 编辑:程序博客网 时间:2024/05/16 06:40

编译准备

安装编译依赖包

sudo apt-get install gcc
sudo apt-get install binutils
sudo apt-get install bzip2
sudo apt-get install flex
sudo apt-get install python
sudo apt-get install perl
sudo apt-get install make
sudo apt-get install find
sudo apt-get install grep
sudo apt-get install diff
sudo apt-get install unzip
sudo apt-get install gawk
sudo apt-get install getopt
sudo apt-get install subversion
sudo apt-get install libz-dev
sudo apt-get install libc-dev
sudo apt-get install g++
sudo apt-get install libncurses5-dev
sudo apt-get install openssl
sudo apt-get install libssl-dev

下载代码包

cd ~
git clone https:的//github.com/openwrt-mirror/openwrt.git

设置编译选项

make menuconfig
Target System 选择 Broadcom BCM2708/BCM2835

编译

sudo make

烧写镜像到sd卡

进入编译生成镜像路径

cd ~/openwrt/bin/brm2708

使用dd命令烧写镜像到sd卡

sudo dd if=openwrt-brcm2708-sdcard-vfat-ext4.img of=/dev/mmcblk0

连接树莓派

将sd卡插入树莓派
1.
用网线连接电脑
配置eth0 与树莓派在同一网段
ifconfig eth0 192.168.1.100 netmask 255.255.255.0

telnet 连接 树莓派
telnet 192.168.1.100

2.
将树莓派接入局域网方法
修改树莓派/etc/config/network 如下
config interface ‘lan’
option ifname ‘eth0’
option proto ‘dhcp’
关闭dns/dhcp服务
/etc/init.d/odhcpd disable
/etc/init.d/odhcpd stop

重启网络服务
/etc/init.d/network reload

0 0
原创粉丝点击