Skip to content

z4200228/glbuilder

 
 

Repository files navigation

glbuilder

Documentation

English

中文

Introduction

Before this project, I had a post on the glinet Chinese forum to teach you how to package the firmware with the glinet page based on gl-infra-builder , many users like it. Since the driver part uses the driver code maintained by many chip manufacturers, we have no right to open it to users. We have tried to provide it to users in the form of ko, but we will always encounter many strange problems. For this reason, I built the glbuilder project based on the gl-infra-builder output imagebuilder and SDK to solve the current problem.

glbuilder also supports complete construction of firmware with glinet UI interface. At the same time, it also supports direct integration of ipk files and source code files. In addition, in order to make it easier for more novice users to enjoy compiling, I also configured menuconfig for the project Graphical interface and domestic source.

play

Firmware functions show

play

Install environment

sudo apt update 
sudo apt install device-tree-compiler g++ ncurses-dev python asciidoc bash bc binutils bzip2 fastjar flex gawk gcc genisoimage gettext git intltool jikespg libgtk2.0-dev libncurses5-dev libssl-dev make mercurial patch perl-modules python2.7-dev rsync ruby sdcc subversion unzip util-linux wget xsltproc zlib1g-dev zlib1g-dev -y

Clone repository

git clone https://github.com/gl-inet/glbuilder && cd glbuilder

Compile firmware that supports GL UI (basic configuration)

  1. Enter the menuconfig interface to configure
make menuconfig
  1. Select the router model in the Select GL.iNet router model option.
  2. In the Select version for mt3000 option, select the version based on the official firmware for subsequent modification.
  3. In the Select mt3000 version 4.2.2 build-in packages option, you can choose the built-in package of glinet. Novices suggest to keep the default and not modify it.
  4. Select feeds for SDK of mt3000 The 4.2.2 option can enable the feeds of the SDK, and disabling feeds without using them can speed up the speed of source code compilation. For beginners, it is recommended to keep the default without modification.
  5. Select the download source location option to select the download source of imagebuilder and SDK image, mainland users are recommended to choose China Aliyun
  6. Under Configure customer version information, you can configure your own version number, version type, releasenotes and other version-related content, and you can modify it according to the actual situation
  7. After the above configuration is completed, do not pay attention to other configuration options for the time being, save and exit and execute
make
  1. After the compilation is completed, the compiled image will be in the bin///target directory of the current directory

Add your own IPK

  1. We have two ways to get the ipk file, through the remote repository or the customer/ipk local directory. For the local ipk file, we need to manually copy it to the customer/ipk directory. The remote repository address is defined in board///distfeeds.conf, which can be modified by yourself. In order to avoid the inconsistency between the compiled firmware and the official release version due to the remote repository version update, the remote repository is disabled by default. If you want to use please cancel the selection of the Imagebuilder do not use remote repository option in the Global option option, and execute make imagebuilder/clean to make the configuration option take effect immediately.
  2. Complete the basic configuration according to your own needs(do not need to execute the final make)
  3. Add the IPK name in the Customer build-in packages option, such as luci-app-aria2; if you want to remove a certain package, you can add a '-' symbol in front, such as -dnsmasq means that dnsmasq does not need to be installed. In the project board///version_info.mk, there are some removed packages preset by gl_collision_package. The reason is that these packages conflict with the preset packages of glinet. If necessary, you can edit and modify the corresponding gl_collision_package variable.
  4. Save the configuration and exit, execute
make
  1. The location of the compiled image is the same as the location of the image in the basic configuration

Add your own source code

  1. Clone your own source code files into the customer/source directory of the project root directory
  2. Complete the basic configuration according to your own needs(do not need to execute the final make)
  3. Select the package that you need to compile into the firmware in the Select customer package directory. The directory expansion in this directory is based on each Makefile in the source code, which is consistent with the expansion method of the official openwrt source code.
  4. Save the configuration and exit, execute
make
  1. The compiled ipk file is in the bin///package directory of the current directory
  2. The location of the compiled image is the same as that in the basic configuration

Add your own files

Create a files directory in the project root directory and put your own files, for example

mkdir -p files/etc/config
echo "test my files" >files/etc/config/test_config

The firmware compiled in this way can see the test_config file in the /etc/config/ directory in the file system

TIPS

  1. Compilation in the form of source code and IPK can be combined with each other
  2. The packages removed using the '-' symbol in the Customer build-in packages option may be reselected by other dependencies, and the corresponding dependent packages need to be removed at the same time
  3. When a problem occurs, it can be debugged step by step. Currently, the commonly used subcommands are:
make sdk/download #Download SDK image
make sdk/prepare #Decompress the SDK image and configure some basic files
make sdk/feeds/update #Update SDK feeds
make sdk/compile #Use the SDK to compile the source code package
make sdk/install #Copy the compiled ipk to the bin directory
make sdk/package/index #Generate index for compiled ipk
make sdk/clean #Clear all SDK related compilation environment

make customer/source/<path>/compile #Compile a single package in the customer/source/ directory
make customer/source/<path>/clean #Clear the compilation environment and IPK file of the specified package in the customer/source/ directory
make customer/ipk/index #Generate index for IPK files in the cuntomer/ipk directory

make imagebuilder/download #Download imagebuilder image
make imagebuilder/prepare #Decompress the imagebuilder image and configure some basic files
make imagebuilder/compile #package firmware
make imagebuilder/clean: #Clear all imagebuilder related compilation environment

make menuconfig #Enter the configuration menu
make clean #Delete the build directory and temporary files
make distclean #Delete the build directory and temporary files, delete the generated image files and all build tools

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 63.1%
  • Makefile 21.9%
  • C++ 6.2%
  • Perl 4.1%
  • Yacc 1.8%
  • Shell 1.7%
  • Other 1.2%