树莓派3B+刷openwrt总结

目录

 

前言

1. 刷openwrt img

1.1 下载img

1.2 烧写img

2. 编译openwrt源码,为树莓派定制固件

2.1 下载openwrt源码

2.2 安装编译工具和依赖

2.3 openwrt裁剪配置


前言

本文介绍两种为openwrt刷写固件的方式,第一种是下载官方或第三方已经编译好的openwrt固件(即img文件),笔者亲自尝试了多种版本固件,均不能在树莓派3B+上启动,欢迎有跑起来的小伙伴可以来指点交流; 第二种方式是编译openwrt源码,裁剪配置,最终树莓派跑起来了。

1. 刷openwrt img

从openwrt官方网站下载编译好的img文件进行刷写,这也是目前大多数文章介绍的方式,笔者也使用树莓派3B+验证了这种方式,openwrt始终不能启动( 现象:ACT灯不亮,代表SD卡启动文件损坏或没有SD卡), 很是奇怪其他玩家都是怎么跑起来的。

虽然没跑起来, 也还是要介绍下方式的。

1.1 下载img

a. 打开网址 https://openwrt.org

b. 根据树莓派型号选择合适的固件

       我的树莓派型号是 3B+,所以我选择

下表列出了可供bcm2710使用的固件

1.2 烧写img

c. 使用Win32DiskImager烧写img到sd卡

      SD卡 >= 2G.

        

d. 将sd卡插入树莓派,上电启动

   以下是手机拍摄的显示器画面,openwrt并没有启动成功,树莓派ACT灯一直闪烁

 笔者又分别试了下图openwrt18.6和17.01的不同版本固件,均无法启动成功, 如果有跑起来的小伙伴欢迎来敲砖。

2. 编译openwrt源码,为树莓派定制固件

2.1 下载openwrt源码

下载源有多个,以下方式均可下载最新源码

git clone https://git.openwrt.org/openwrt/openwrt.git/

git clone git://github.com/openwrt/openwrt.git

2.2 安装编译工具和依赖

see https://openwrt.org/docs/guide-developer/quickstart-build-images

First we need to make sure the dependencies are installed (for Debian/Ubuntu):

sudo apt-get install subversion g++ zlib1g-dev build-essential git python rsync man-db
sudo apt-get install libncurses5-dev gawk gettext unzip file libssl-dev wget zip time

由于不同平台版本环境不同, 也可以考虑以下命令
sudo apt-get install git-core build-essential libssl-dev libncurses5-dev unzip
sudo apt-get install subversion mercurial

2.3 openwrt裁剪配置

本节列了笔者系统的配置方式,比较简单,但是足以证明树莓派可以跑起来了,后续可以继续更新配置

执行make menuconfig

target system-----------------------------Broadcom BCM2708
subtarget---------------------------------BroadcomBCM2710
targetprofile----------------------------raspberrypi3 B(default)
Global buildsettings---------------------compile with support for patentedfunctionality(default)

enable support for prink
basesystem-------------------------------wireless tools

kernel module
blockdevice------------------------------kmod-block2mtd(MTD:memory technology device内存技术设备)
Cryptographic APImodules-----------------kmod-crypto-ccm
kmod-crypto-cmac
file systems------------------------------ext4
kmod-fs-ntfs
kmod-fs-vfat
USB Supprot-------------------------------kmod-usb-ohci
kmod-usb-uhci
kmod-usb-storage-extras
kmod-usb2

videosupport-----------------------------kmod-video-core
kmod-video-uvc
WirelessDrivers--------------------------kmod-ath
kmod-ath9k-common
kmod-ath9k-htc
kmod-brcmfmac

wpa-supplicant
 

编译过程持续若干小时,再烧写系统,出现了以下熟悉的画面:

3. 参考

openwrt源码编译 3B+ https://blog.csdn.net/weixin_42627035/article/details/80944269

猜你喜欢

转载自blog.csdn.net/u011734326/article/details/83066189
今日推荐