0%

openwrt

OpenWrt

系统安装

安装依赖库文件

应用程序–附件–终端
sudo apt-get update (更新)
安装编译需要的组件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
sudo apt-get install gcc 
sudo apt-get install g++
sudo apt-get install binutils
sudo apt-get install patch
sudo apt-get install bzip2
sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install make
sudo apt-get install autoconf-archive gnu-standards autoconf-doc libtool
sudo apt-get install autoconf
sudo apt-get install gettext
sudo apt-get install debhelper texlive-base texlive-latex-base texlive-generic-recommended texinfo-doc-nonfree
sudo apt-get install texinfo
sudo apt-get install unzip
sudo apt-get install sharutils
sudo apt-get install subversion
sudo apt-get install libncurses5-dev
sudo apt-get install ncurses-term
sudo apt-get install zlib1g-dev
sudo apt-get install gawk
sudo apt-get install asciidoc
sudo apt-get install libz-dev
sudo apt-get install git subversion

根据openwrt版本更新gcc以及g++ 重中之重一定要选择

git clone https://github.com/openwrt/openwrt 也可以直接下载zip文件
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig

make -j1 V=s #j后面的1代表1个核

导入环境变量

export STAGING_DIR=/path/to/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2

export STAGING_DIR=/home/allen/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl
export PATH=$PATH:$STAGING_DIR/bin

查看环境变量有三个命令
env
env命令是environment的缩写,用于列出所有的环境变量
export
单独使用export命令也可以像env列出所有的环境变量,不过export命令还有其他额外的功能
echo $PATH
echo $PATH用于列出变量PATH的值,里面包含了已添加的目录
mips-openwrt-linux-gcc hello.c -o hello-mips64 -static -mips64r2

设置设备树

openwrt源码设备树设置
target/linux/ramips/image/mt76x8.mk
target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts
alfa-network_awusfree1

### MT
参考链接 https://blog.csdn.net/likang517/article/details/80864918 增加内核对spi支持 kernel modules->spi support->kmod-spi-dev openwrt源码开启wifi package/kernel/mac80211/files/lib/wifi/mac80211.sh set wireless.radio${devidx}.disabled=1 修改为 set wireless.radio${devidx}.disabled=0

源码中所有设备的位置
ls target/linux/ramips/dts/

cp bin/targets/ramips/mt76x8/openwrt-ramips-mt76x8-alfa-network_awusfree1-squashfs-sysupgrade.bin /mnt/share/

更改设备名称
https://blog.csdn.net/H_177/article/details/109273185

安装ssr

https://github.com/rapistor/openwrt-ssr/blob/master/mp3-lede-ar71xx/mp3%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.txt

参考博客
vps编译然后上传路由器,本地文件编写

坚持原创技术分享,您的支持将鼓励我继续创作!