Build the firmware from source codes

This section describes how to build the firmware for OpenWRT Smart 7688 development boards from a source code.

 

Environment

The following operations are performed under a Ubuntu LTS 16.04 environment. For a Windows or a Mac OS X host computer, you can install a virtual machine to have the same environment:

  • Download Ubuntu 16.04 LTS image from http://www.ubuntu.com
  • Install this image with VirtualBox (http://virtualbox.org) on the host machine. 50GB disk space reserved for the virtual machine is recommended.

Steps

In the Ubuntu system, open the Terminal application and enter the following commands:

 

    1. Install prerequisite packages to build the firmware:

      $ sudo apt-get install git g++ libncurses5-dev subversion libssl-dev gawk libxml-parser-perl unzip 
         

     

    2. Download the OpenWrt CC source codes:

     

    3. Unzip OpenWrt CC source codes:

      $ tar xvfz Linkit_7688_openwrt_fw_v15.05_1.tar.gz
         

     

    4. Update the feed information for all available packages to build the firmware:

      $ cd openwrt
      $ ./scripts/feeds update -i 
         

     

    5. Prepare the kernel configuration:

      $ make menuconfig 
         

      Run make menuconfig to update the .config files. After enter the menu, select exit and save.

     

    6. Start the compilation process:

      $ make V=99 
         

     

    7. After the build process is finished, the resulted firmware file will be under "bin/ramips/openwrt-ramips-mt7688-LinkIt7688-squashfs-sysupgrade.bin". Depending on the hardware resources of the host environment, the build process may take more than 2 hours.

     

    8. You can use this file to update the firmware through Web UI or rename it to lks7688.img to update through a USB drive.

     

 


 

Build the bootloader

This section describes how to build the bootloader for OpenWRT Smart 7688 development boards from source codes.

 

Environment

The following operations are performed under a Ubuntu LTS 16.04 environment. For a Windows or a Mac OS X host computer, you can install a virtual machine to have the same environment:

  • Download Ubuntu 16.04 LTS image from http://www.ubuntu.com
  • Install this image with VirtualBox (http://virtualbox.org) on the host machine. 50GB disk space reserved for the virtual machine is recommended.

Steps

In the Ubuntu system, open the Terminal application and enter the following commands:

 

    1. Refer to Step 1 of the firmware building process for installing all prerequisite packages.

     

    2. Download the bootloader source codes:

      $ git clone https://github.com/MediaTek-Labs/linkit-smart-uboot.git 
         

     

    3. Change to the source folder:

      $ cd linkit-smart-uboot
         

     

    4. Install the toolchain to build the bootloader:

      $ sudo tar xjf buildroot-gcc342.tar.bz2 -C /opt/  
         

     

    5. Since the toolchain is provided in 32-bit executables, you need to install additional packages for execution on a 64-bit machine:

      $ sudo dpkg --add-architecture i386   
      $ sudo apt-get update   
      $ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 
         

     

    6. Start the compilation process:

      $ make
         

     

    7. The resulted bootloader file is uboot.bin.

     

    8. You can rename it to lks7688.ldr to update the system bootloader through a USB drive.

     

 

 


Resources

 

Buy it