Please clone the code to local and checkout the code from branch bpi-r2-on-lede-v1.
Run “make menuconfig” to configure this project, and run command “make -j1 V=s” to build it.
A configuration file of this project is attached for you reference(.config (122.4 KB)
You will get three images:
build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/mtk-bpi-r2-SD.img: This is for SD image, please program it to SD card by executing command “dd if=mtk-bpi-r2-SD.img of=/dev/mmcblkx”
build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/mtk-bpi-r2-EMMC.img: This is for EMMC image, please follow below steps to program it EMMC:
We need another system which is running on SD card to program EMMC image to EMMC, please follow below steps to do:
Copy EMMC image to a running system which is from SD card
Program EMMC image to User Data Area of EMMC: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0 (assume /dev/mmcblk0 is for EMMC)
Program preloader to EMMC boot0 block: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0boot0 bs=1M count=1
Change the Partition configurion of EMMC is 48h: reboot the system which is running SD, and enter the U-boot command line, run command emmc pconf 48 (for this steps, we can change partition configuration in userspace by using mmc-utils, see more information in BPI-R2 OpenWrt(LEDE) Souce code : 2018-04-11)
Power off, remove SD card, and then power on R2 board.
This is for runtime upgrade, copy it to R2 board which is running OpenWrt system(no matter where(SD or EMMC) it boots from), and then run command “sysupgrade lede-mediatek-32-bananapi,bpi-r2-sysupgrade.tar” to update both kernel and rootfs.
Please note that sysupgrade can be executed when jffs2 file system is initialized completely, the log “jffs2_build_xattr_subsystem: complete building xattr subsystem” means the initialization of jffs2 file system is done.
You can uncomment openwrt source feeds in feeds.conf.default file.
And compile the required packages. If they compile successfully, they will work. I, for example, compile a package of vtun, absent in LEDE.
I have built the image yesterday. I had to change a few things (libuci-lua old version). But a after a while the build was successful and the new image works. Somethings still need more work: WLAN, VLAN, HWNAT
Especially the loading of the wlan-module is not very comfortable, it should be loaded automatically at boot of the bpi-r2. Another thing is vlan, every cheap wlan-router can do that …
But for now this is the first image usable!
THANKS A LOT for all the work, I know it is not easy to implent something new!
I insert Intel Dual Band Wireless-AC 7260 NIC into BPI-R2. Use lspci can see the network card but use ifconfig -a can’t find it. I check the system log(/var/log/messages). It reminds the missing “iwlwifi-7260-17.ucode” file. I find and copy this file to /lib/firmware and reload modules.