garywang  
                (gary)
               
               
                 
              
                  
                    September 29, 2017,  1:05pm
                   
                   
              1 
               
             
            
              Source code 
The source code is at: https://github.com/garywangcn/bpi-r2_lede 
Please clone the code to local and checkout the code from branch bpi-r2-on-lede-v1 .
Build 
Follow the LEDE building instruction to compile the lede system, the target system is MediaTek Ralink ARM, the config file is attached.
Image 
Please download the image I built from below link
http://pan.baidu.com/s/1nuXqAVJ 
Boot with LEDE image 
Step 1: Please program LEDE 2017-09-08 image to emmc by following BPI-R2 New image : Openwrt/LEDE 2017-09-08 
Step 2: Boot the board from EMMC, and enter U-boot shell.
Step 3: Load build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/uImage-mt7623n-bananapi-bpi-r2-initramfs from host pc(tftp 84000000 uImage-mt7623n-bananapi-bpi-r2-initramfs). Before loading image, you may need to set/ipaddr/netmask/serverip in uboot
Step 4:  Program the image to EMMC by run command:
   mmc dev 0
   mmc write 84000000 1000 5800
 
 
IP Forwarding Performance based on hardware NAT 
Known limitation 
PCIE is disabled because it may cause OS to be hang 
HDMI is not validated. 
 
             
            
               
               
              1 Like 
            
            
                 
                 
              
                
           
          
            
              
                garywang  
                (gary)
               
               
                 
              
                  
                    September 30, 2017, 12:46am
                   
                   
              2 
               
             
            
              Before testing IP forwarding, please change the firewall setting in /etc/config/firewall, and then restart firewall(/etc/init.d/firewall restart). Below is for you reference
firewall  (4.1 KB)
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                RW2003  
                
               
               
              
                  
                    October 1, 2017,  8:24pm
                   
                   
              3 
               
             
            
              Hi gary,
I built the system and transfered it to my pi and copied it on emmc.
But it cant boot.
The uboot promp shows:
MMC read: dev # 0, block # 4096, count 22528 ... 22528 blocks read: OK
bootm flag=0, states=70f
Booting kernel from Legacy Image at 84000000 ...
  Image Name:   MIPS OpenWrt Linux-4.9.44
  Image Type:   ARM Linux Kernel Image (uncompressed)
  Data Size:    3692431 Bytes = 3.5 MiB
  Load Address: 80008000
  Entry Point:  80008000
  Verifying Checksum ... OK
  Loading Kernel Image ... OK
Starting kernel ...
 
what did I do wrong?
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                frank-w  
                (Frank W.)
               
               
              
                  
                    October 2, 2017,  7:26am
                   
                   
              4 
               
             
            
              Did you changed something with uart in dtsi?
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                RW2003  
                
               
               
              
                  
                    October 2, 2017,  7:48am
                   
                   
              5 
               
             
            
              I only did set the ip environment settings, download the file via tftp and write it with mcc…
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                frank-w  
                (Frank W.)
               
               
              
                  
                    October 3, 2017,  9:20pm
                   
                   
              6 
               
             
            
              does it boot from sd-card?
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                RW2003  
                
               
               
              
                  
                    October 4, 2017,  1:07pm
                   
                   
              7 
               
             
            
              I tried it again and … it works 
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                garywang  
                (gary)
               
               
              
                  
                    October 10, 2017, 11:56pm
                   
                   
              8 
               
             
            
              The pcie issue has been fixed, please get the latest code from  https://github.com/garywangcn/bpi-r2_lede 
A pull request has been  created for submitting commits to moore-bros/bpi-r2-on-lede.
             
            
               
               
              1 Like 
            
            
                 
                 
              
           
          
            
            
              I build the system and I use the mkimage in staging_dir/host/bin create a Multi-File Image.
I can boot the system. But I can`t get any freespace like the image form BPI-R2 New image : Openwrt/LEDE 2017-09-08 
How can I do?
command:
mkimage -A arm -T multi -C none -a 80008000 -e 80008000 -n ‘Multi-File Test Image’ -d lede-mediatek-32-uImage-mt7623n-bananapi-bpi-r2-initramfs:lede-mediatek-32-root.squashfs uMulti
 
And it return:
Image Name:   Multi-File Test Image
 
Created:      Thu Oct 12 22:26:59 2017
 
Image Type:   ARM Linux Multi-File Image (uncompressed)
 
Data Size:    9897528 Bytes = 9665.55 kB = 9.44 MB
 
Load Address: 80008000
 
Entry Point:  80008000
 
Contents:
Image 0: 5965351 Bytes = 5825.54 kB = 5.69 MB
 
 
Image 1: 3932164 Bytes = 3840.00 kB = 3.75 MB
 
 
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                garywang  
                (gary)
               
               
              
                  
                    October 12, 2017, 11:42pm
                   
                   
              10 
               
             
            
              Can you please try to build and program image to emmc by following instruction?
Instruction 
Please clone the latest code from github(https://github.com/garywangcn/bpi-r2_lede/tree/bpi-r2-on-lede-v1 ) and then follow below steps to build/program both rootfs and uImage :
 
Run make menuconfig in root directory of bpi-r2_lede
 
Enable squashfs: Target Images ->squashfs
 
Rebuild lede by executing command: make
 
The root.squashfs and uImage-mt7623n-bananapi-bpi-r2 will be programmed to EMMC via tftp,  they are located at build_dir/target…/linux-mediatek_32/
 
Copy above images to /tftpboot/(please enable tftp service first)
 
Boot the board to Uboot prompt, configure the IP address/netmask/gatewayip/serverip, make sure the R2 board is able to access tftp server.
 
Run below command to program uImage-mt7623n-bananapi-bpi-r2:
tftp 84000000 uImage-mt7623n-bananapi-bpi-r2
mmc dev 0
mmc write  84000000 1000 6000
 
Run below command to program root.squashfs to EMMC:
tftp 84000000 root.squashfs
mmc dev 0
mmc write 84000000 20A00 6000
 
 
10.Run command: boot
Please note that the first reboot will take a few minutes to sync file system. 
             
            
               
               
               
            
            
                 
                 
              
                
           
          
            
            
              Thanks garywang. It works!
“df -h” :
And in LUCI:
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                garywang  
                (gary)
               
               
              
                  
                    October 14, 2017,  1:15am
                   
                   
              12 
               
             
            
              Good news, thanks for your informatio, please let me know if you have any question.
             
            
               
               
               
            
            
                 
                 
              
                
           
          
            
              
                garywang  
                (gary)
               
               
                 
              
                  
                    October 23, 2017,  3:13pm
                   
                   
              13 
               
             
            
              Image 
New test images(kernel and root.squashfs) are available:
http://pan.baidu.com/s/1nuXrUTb 
How to program both uImage and root file system 
Copy both uImagelede and root.squashfs to tftp server
 
Run below command to program uImagelede
 
 
tftp 84000000 uImagelede
mmc dev 0
mmc write  84000000 1000 6000
 
 
Run below command to program root.squashfs to EMMC: 
 
tftp 84000000 root.squashfs
mmc dev 0
mmc write 84000000 20A00 6000
 
 
Run command: boot
 
Configure an available IP address and then run below commands when entering OS
 
 
opkg update
opkg  install luci-theme-bootstrap
opkg  install luci-mod-admin-full
 
 
Connect R2 board via web
 
 
 
             
            
               
               
              2 Likes 
            
            
                 
                 
              
           
          
            
              
                pkalemba  
                (Paweł Kalemba)
               
               
              
                  
                    October 26, 2017,  6:17am
                   
                   
              14 
               
             
            
              With this image it Will possible to use R2 as a normal router?, i got problems with nat on Ubuntu.
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                garywang  
                (gary)
               
               
              
                  
                    October 26, 2017,  7:25am
                   
                   
              15 
               
             
            
              Yes, it’s possible to make R2 to be a router.
On Ubuntu, the HNAT will NOT be supported, the HNAT is supported based on DSA structure, but there is no DSA within kernel 4.4(ubuntu is using), so it’s a huge task to port HNAT from lede(4.9 kernel) to Ubuntu(4.4 kerenl).
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                frank-w  
                (Frank W.)
               
               
              
                  
                    October 26, 2017,  8:59am
                   
                   
              16 
               
             
            
              Can 4.9 from lede be used for ubuntu? Where are problems? If the problem with sd-card in 4.14 can be solved it can also be used.
             
            
               
               
               
            
            
                 
                 
              
           
          
            
            
              Replace the current uImage with v4.14 kernel so that you can run HNAT on Ubuntu. I’ve done it before…
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                frank-w  
                (Frank W.)
               
               
              
                  
                    October 26, 2017, 12:35pm
                   
                   
              18 
               
             
            
              @Ryder.Lee  Is sd-card-problem solved?
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                RW2003  
                
               
               
              
                  
                    October 26, 2017,  4:16pm
                   
                   
              19 
               
             
            
              How a can configure my IP Address?
I tried it with ifconfig br-lan add … and route add default gw …
I can ping my PC successfully but I got no internet
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                garywang  
                (gary)
               
               
              
                  
                    October 27, 2017, 12:13am
                   
                   
              20 
               
             
            
              Hi RW2003
The DNS should be configured and the /etc/config/firewall will be changed, please refer to http://forum.banana-pi.org/uploads/default/original/2X/8/84d6c0336af978c299fb73556fd67d896e719d52.png