创建openwrt 目录
mkdir /openwrt;
更改目录权限或把文件夹的拥有者改为用户
sudo chmod -R 777 openwrt
或
sudo chown -R $USER openwrt
进入openwrt目录,下载openwrt的代码库
cd /openwrt
git clone https://github.com/garywangcn/bpi-r2_lede.git
cd bpi-r2_lede
cat README
先查看README
下载2号框中的相关组件
命令:
sudo apt-get install *****
再执行下面两条命令
./scripts/feeds update -a
./scripts/feeds install -a
再执行“make menuconfig”配置一下:
下面是复制过来的,应该只要配置Target system
6.1. Target system: - Mediatek Ralink ARM
6.2. Subtarget: MT7623
6.3. Target Profile (Bpi Banana Pi R2)
6.4. Target Images: select Ramdisk, squashfs, ext4 and gzip images
6.5. image configuration: under “Separate feed repositories” Enable desired packages (luci, routing, telephony)
6.6. Base system: I have added block-mount, blockd and mtd
6.7. boot loaders: mt7623n-preloader and u-boot-mt7623n_bpir2
6.8 LuCI
6.8.1. Collections: luci
6.8.2. Modules: luci-base, -mod-network, -mod-status, -mod-system
6.8.3. Applications as required (ddns, firewall, openvpn, opkg)
6.9. network/vpn openvpn-openssl (used by me, most hidden)
按两次esc退出保存,然后执行“make -j1 V=s”命令去编译工程
编译完成后,会在“build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32”目录下生成编译后的镜像文件:
mtk-bpi-r2-SD.img
mtk-bpi-r2-EMMC.img