Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| user:ja [2021/08/25 20:44] – [1.1 Download package list information] Added some more info. ja | user:ja [2021/11/26 00:37] – Table tested routers modified and message added. ja | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== My OpenWrt firmware image building | + | ====== My OpenWrt firmware image build guide ====== |
| - | Mainly | + | <WRAP important> |
| + | This method is NOT OFFICIALLY supported. | ||
| + | A native [[docs: | ||
| + | </ | ||
| + | Build guide mainly | ||
| ===== 1. Prerequisites ===== | ===== 1. Prerequisites ===== | ||
| [[faq: | [[faq: | ||
| - | For [[docs: | + | Tested on [[docs: |
| - | ==== 1.1 Download package | + | <hidden onHidden=" |
| + | See Windows [[wp> | ||
| + | < | ||
| + | ver | ||
| + | </ | ||
| + | See Debian version information with Debian command: | ||
| + | < | ||
| + | cat / | ||
| + | </ | ||
| + | </ | ||
| + | :!: Mind issue with path! | ||
| + | |||
| + | ==== 1.1 Download package information ==== | ||
| Debian terminal command: | Debian terminal command: | ||
| < | < | ||
| sudo apt update | sudo apt update | ||
| </ | </ | ||
| - | < | + | < |
| - | Optional.\\ | + | After downloading package information (**update**), |
| - | \\ | + | |
| - | Install | + | |
| < | < | ||
| + | sudo apt update | ||
| sudo apt upgrade | sudo apt upgrade | ||
| </ | </ | ||
| - | First run the **update**, then the **upgrade**. Neither of them automatically runs the other.\\ | + | Or with one Debian terminal command: |
| - | Command | + | < |
| + | sudo apt update | ||
| + | </ | ||
| + | Other commands (e.g. **upgrade**) operate on package information (**update**).\\ | ||
| \\ | \\ | ||
| - | Remove | + | Optional, remove |
| < | < | ||
| sudo apt autoremove | sudo apt autoremove | ||
| </ | </ | ||
| \\ | \\ | ||
| - | For description of **apt update**, **apt upgrade** and **apt autoremove** | + | Description |
| + | :?: What about "sudo apt dist-upgrade"? | ||
| </ | </ | ||
| - | ==== 1.2 Install required dependencies ==== | ||
| - | See [[docs: | ||
| - | If package list information is not downloaded ([[user:ja#download_package_list_information|step 1.1]]), message can be:\\ | + | ==== 1.2 Install required dependencies ==== |
| + | See [[docs: | ||
| + | :!: Verify link and required packages! | ||
| + | <hidden onHidden=" | ||
| + | If package list information is not downloaded ([[#download_package_information|step 1.1]]), message can be:\\ | ||
| '' | '' | ||
| + | </ | ||
| ==== 1.3 Leave privileged mode ==== | ==== 1.3 Leave privileged mode ==== | ||
| Debian terminal command: | Debian terminal command: | ||
| Line 36: | Line 59: | ||
| exit | exit | ||
| </ | </ | ||
| + | |||
| ===== 2. Get OpenWrt source code ===== | ===== 2. Get OpenWrt source code ===== | ||
| ==== 2.1 Clone repository ==== | ==== 2.1 Clone repository ==== | ||
| - | Debian terminal command: | + | <columns 100% 50% -> |
| + | For OpenWrt 19.07 Debian terminal command: | ||
| < | < | ||
| - | git clone https:// | + | git clone -b openwrt-19.07 --single-branch |
| </ | </ | ||
| - | For more info see: [[docs: | + | < |
| - | + | For OpenWrt 21.02 Debian terminal command: | |
| - | If dependency is not installed ([[user:ja# | + | < |
| + | git clone -b openwrt-21.02 --single-branch https:// | ||
| + | </ | ||
| + | </ | ||
| + | <hidden onHidden=" | ||
| + | This is to clone an specific OpenWrt branch/head (**-b openwrt-19.07 --single-branch** or **-b openwrt-21.02 --single-branch**) in a new directory (**openwrt_19.07** or **openwrt_21.02**).\\ | ||
| + | See [[https:// | ||
| + | \\ | ||
| + | If dependency is not installed ([[# | ||
| '' | '' | ||
| - | If trying second time, message can be:\\ | + | If trying |
| - | '' | + | '' |
| - | ==== 2.2 Change directory ==== | + | '' |
| - | For the following steps go to the openwrt directory.\\ | + | </ |
| - | Debian terminal command: | + | |
| + | ==== 2.2 Change | ||
| + | <columns 100% 50% -> | ||
| + | For OpenWrt 19.07 Debian terminal command: | ||
| < | < | ||
| - | cd openwrt | + | cd openwrt_19.07 |
| </ | </ | ||
| + | < | ||
| + | For OpenWrt 21.02 Debian terminal command: | ||
| + | < | ||
| + | cd openwrt_21.02 | ||
| + | </ | ||
| + | </ | ||
| + | <hidden onHidden=" | ||
| + | See [[https:// | ||
| + | \\ | ||
| + | If repository is not cloned ([[# | ||
| + | '' | ||
| + | '' | ||
| + | </ | ||
| - | If repository | + | ==== 2.3 Update local branch==== |
| - | '' | + | If there is a new release in the branch, update local branch repository with Debian terminal command: |
| - | ==== 2.3 Select | + | < |
| - | See info about [[faq:difference_between_a_release_and_a_trunk_build|snapshots, releases and branches]].\\ | + | git pull |
| - | Debian terminal command: | + | </ |
| + | <hidden onHidden=" | ||
| + | See [[https://manpages.debian.org/ | ||
| + | </ | ||
| + | |||
| + | ==== 2.4 Select | ||
| + | <columns 100% 50% -> | ||
| + | For OpenWrt 19.07 Debian terminal command: | ||
| + | < | ||
| + | git checkout v19.07.8 | ||
| + | </ | ||
| + | < | ||
| + | For OpenWrt 21.02 Debian terminal command: | ||
| + | < | ||
| + | git checkout v21.02.0 | ||
| + | </ | ||
| + | </ | ||
| + | <hidden onHidden=" | ||
| + | See [[https:// | ||
| + | \\ | ||
| + | List branches | ||
| + | < | ||
| + | git tag -l | ||
| + | </ | ||
| + | See [[https:// | ||
| + | \\ | ||
| + | Show current branch (highlighted in green and marked with an asterisk) with Debian terminal command: | ||
| < | < | ||
| git branch | git branch | ||
| - | git checkout <branch name> | ||
| </ | </ | ||
| - | ==== 2.4 Update and install feeds ==== | + | See [[https:// |
| - | Debian terminal command: | + | Or show working tree status with Debian terminal command: |
| < | < | ||
| - | ./ | + | git status |
| - | ./ | + | |
| </ | </ | ||
| + | See [[https:// | ||
| + | </ | ||
| - | If dependencies are not installed ([[user:ja# | + | ==== 2.5 Update and install feeds ==== |
| + | Debian terminal command: | ||
| + | < | ||
| + | ./ | ||
| + | </ | ||
| + | <hidden onHidden=" | ||
| + | If dependencies are not installed ([[# | ||
| '' | '' | ||
| '' | '' | ||
| Line 85: | Line 166: | ||
| '' | '' | ||
| '' | '' | ||
| - | '' | + | '' |
| - | + | If directory is wrong ([[#change_working_directory|step 2.2]]), message can be:\\ | |
| - | If directory is wrong ([[user:ja#change_directory|step 2.2]]), message can be:\\ | + | |
| '' | '' | ||
| + | </ | ||
| + | |||
| ===== 3. OpenWrt Configuration ===== | ===== 3. OpenWrt Configuration ===== | ||
| Debian terminal command: | Debian terminal command: | ||
| Line 94: | Line 176: | ||
| make menuconfig | make menuconfig | ||
| </ | </ | ||
| + | |||
| ==== 3.1 Configure target system ==== | ==== 3.1 Configure target system ==== | ||
| - | E.g. for hardware | + | For router |
| - | < | + | |
| - | ^[[toh:start|Hardware]] ^Target System ^Subtarget ^Target Profile ^Target directory ^ | + | |
| - | |[[toh:belkin: | + | |
| - | |[[toh:d-link: | + | |
| - | |[[toh: | + | |
| - | |[[toh: | + | |
| - | </ | + | |
| - | use corresponding values from menu: | + | |
| * “Target System” ⇒ “Select” ⇒ <target system> ⇒ “Select” | * “Target System” ⇒ “Select” ⇒ <target system> ⇒ “Select” | ||
| * “Subtarget” ⇒ “Select” ⇒ < | * “Subtarget” ⇒ “Select” ⇒ < | ||
| * “Target Profile” ⇒ “Select” ⇒ <target profile> ⇒ “Select” | * “Target Profile” ⇒ “Select” ⇒ <target profile> ⇒ “Select” | ||
| + | <hidden onHidden=" | ||
| + | ^[[toh: | ||
| + | |[[toh: | ||
| + | |[[toh: | ||
| + | |::: |21.02.0 |"bin is too big: 3932975 > 3866624" | ||
| + | |[[toh: | ||
| + | |[[toh: | ||
| + | |::: |21.02.0 |" | ||
| + | |[[toh: | ||
| + | </ | ||
| + | |||
| ==== 3.2 Options ==== | ==== 3.2 Options ==== | ||
| - | ? | + | To add “LuCI”: |
| + | * " | ||
| + | To remove " | ||
| + | * " | ||
| + | To remove " | ||
| + | <columns 100% 50% -> | ||
| + | For OpenWrt 19.07: | ||
| + | * " | ||
| + | < | ||
| + | For OpenWrt 21.02: | ||
| + | * " | ||
| + | </ | ||
| + | To add " | ||
| + | <columns 100% 50% -> | ||
| + | For OpenWrt 19.07: | ||
| + | * " | ||
| + | < | ||
| + | For OpenWrt 21.02: | ||
| + | * " | ||
| + | </ | ||
| ==== 3.3 Exit configuration ==== | ==== 3.3 Exit configuration ==== | ||
| To exit OpenWrt Configuration and save target with options settings do following: | To exit OpenWrt Configuration and save target with options settings do following: | ||
| * “Exit” ⇒ " | * “Exit” ⇒ " | ||
| + | |||
| ===== 4. Build image ===== | ===== 4. Build image ===== | ||
| Debian terminal command: | Debian terminal command: | ||
| < | < | ||
| - | make | + | make V=s 2>&1 | tee build.log |
| </ | </ | ||
| Completion can take time. If successful, the images are in the directory ./ | Completion can take time. If successful, the images are in the directory ./ | ||
| Line 121: | Line 228: | ||
| * The *-sysupgrade.bin image file is for updating an existing OpenWrt installation. | * The *-sysupgrade.bin image file is for updating an existing OpenWrt installation. | ||
| - | To recompile the images, remove files from directory ./ | + | To recompile the images, remove files from directory ./ |
| For faster compiling, use '' | For faster compiling, use '' | ||
| - | To build an OpenWrt firmware image for other hardware or with other options, use the OpenWrt Configuration ([[user:ja#build image|step 3]]) and then build image ([[user:ja#build image|step 4]]) again. | + | To build an OpenWrt firmware image for other hardware or with other options, use the OpenWrt Configuration ([[#build image|step 3]]) and then build image ([[#build image|step 4]]) again. |
| Also more hardware info on [[hwinfo> | Also more hardware info on [[hwinfo> | ||
| Line 131: | Line 238: | ||
| Other OpenWrt pages: | Other OpenWrt pages: | ||
| * [[docs: | * [[docs: | ||
| - | * [[docs: | + | * [[docs: |