Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
user:ja [2021/08/26 01:51] – [2.2 Change directory] Modified Debian cd manpage link. jauser:ja [2021/11/26 00:37] – Table tested routers modified and message added. ja
Line 1: Line 1:
-====== My OpenWrt firmware image building guide ====== +====== My OpenWrt firmware image build guide ====== 
-Mainly based on [[https://openwrt.org/docs/guide-developer/quickstart-build-images?rev=1618756598|an old revision of the document "Quick Image Building Guide"]].+<WRAP important> 
 +This method is NOT OFFICIALLY supported. 
 +A native [[docs:guide-developer:build-system:install-buildsystem|GNU/Linux environment]] is recommended. 
 +</WRAP> 
 +Build guide mainly based on [[https://openwrt.org/docs/guide-developer/quickstart-build-images?rev=1618756598|an old revision of OpenWrt document "Quick Image Building Guide"]]. 
 ===== 1. Prerequisites ===== ===== 1. Prerequisites =====
 [[faq:what_system_can_i_build_openwrt_on|A suitable case-sensitive file system]].\\ [[faq:what_system_can_i_build_openwrt_on|A suitable case-sensitive file system]].\\
-For [[docs:guide-developer:build-system:wsl|WSL on Windows]] with [[https://www.microsoft.com/en-us/p/debian/9msvkqc78pk6|Debian]] these are the steps.+Tested on [[docs:guide-developer:toolchain:wsl|WSL2 (Windows Version 10.0.19043.1202)]] with [[https://www.microsoft.com/en-us/p/debian/9msvkqc78pk6|Debian GNU/Linux 10 (buster)]]
 +<hidden onHidden="Click to display more info" onVisible="Click to hide the extra info"> 
 +See Windows [[wp>Ver_(command)|version]] information with [[wp>Cmd.exe|cmd.exe]] command: 
 +<code> 
 +ver 
 +</code> 
 +See Debian version information with Debian command: 
 +<code> 
 +cat /etc/os-release 
 +</code> 
 +</hidden> 
 +:!: Mind issue with path! 
 ==== 1.1 Download package information ==== ==== 1.1 Download package information ====
 Debian terminal command: Debian terminal command:
Line 9: Line 26:
 sudo apt update sudo apt update
 </code> </code>
-<hidden More info> +<hidden onHidden="Click to display more info" onVisible="Click to hide the extra info"
-__Optional.__\\ +After downloading package information (**update**), optional install available upgrades (**upgrade**) with Debian terminal commands:
-\\ +
-Download package information (**update**) and install available upgrades (**upgrade**) with Debian terminal commands:+
 <code> <code>
 sudo apt update sudo apt update
Line 23: Line 38:
 Other commands (e.g. **upgrade**) operate on package information (**update**).\\ Other commands (e.g. **upgrade**) operate on package information (**update**).\\
 \\ \\
-Remove obsolete packages with Debian terminal command:+Optional, remove obsolete packages with Debian terminal command:
 <code> <code>
 sudo apt autoremove sudo apt autoremove
Line 29: Line 44:
 \\ \\
 Description see [[https://manpages.debian.org/apt/apt.html | Debian apt manpage]].\\ Description see [[https://manpages.debian.org/apt/apt.html | Debian apt manpage]].\\
 +:?: What about "sudo apt dist-upgrade"?
 </hidden> </hidden>
 +
 ==== 1.2 Install required dependencies ==== ==== 1.2 Install required dependencies ====
-See [[docs:guide-developer:build-system:install-buildsystem#examples_of_package_installations|examples of package installations]]. +See [[docs:guide-developer:toolchain:install-buildsystem#examples_of_package_installations|examples of package installations]].\\ 
- +:!: Verify link and required packages! 
- +<hidden onHidden="Click to display more info" onVisible="Click to hide the extra info">
-<hidden More info> +
-__Possible message.__\\ +
-\\+
 If package list information is not downloaded ([[#download_package_information|step 1.1]]), message can be:\\ If package list information is not downloaded ([[#download_package_information|step 1.1]]), message can be:\\
 ''E: Unable to locate package'' ''E: Unable to locate package''
Line 45: Line 59:
 exit exit
 </code> </code>
 +
 ===== 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:
 <code> <code>
 git clone -b openwrt-19.07 --single-branch https://git.openwrt.org/openwrt/openwrt.git openwrt_19.07 git clone -b openwrt-19.07 --single-branch https://git.openwrt.org/openwrt/openwrt.git openwrt_19.07
 </code> </code>
-<hidden More info> +<newcolumn> 
-This is to clone an specific OpenWrt branch/head (**-b openwrt-19.07 --single-branch**) in a new directory (**openwrt_19.07**).\\ +For OpenWrt 21.02 Debian terminal command: 
-[[https://manpages.debian.org/git-man/git-clone.html|Debian git clone manpage]].\\ +<code> 
-[[docs:guide-developer:source-code:start|The OpenWrt source code repositories]].\\ +git clone -b openwrt-21.02 --single-branch https://git.openwrt.org/openwrt/openwrt.git openwrt_21.02 
-\\ +</code> 
-__Possible messages.__\\+</columns> 
 +<hidden onHidden="Click to display more info" onVisible="Click to hide the extra info"
 +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://manpages.debian.org/git-man/git-clone.html|Debian git clone manpage]][[docs:guide-developer:source-code:start|the OpenWrt source code repositories]] and [[faq:difference_between_a_release_and_a_trunk_build|difference snapshots, releases and branches]].\\
 \\ \\
 If dependency is not installed ([[#install_required_dependencies|step 1.2]]), message can be:\\ If dependency is not installed ([[#install_required_dependencies|step 1.2]]), message can be:\\
 ''-bash: git: command not found''\\ ''-bash: git: command not found''\\
-If trying second time, message can be:\\ +If trying Debian terminal command second time, message can be one of these:\\ 
-''fatal: destination path 'openwrt_19.07' already exists and is not an empty directory.''+''fatal: destination path 'openwrt_19.07' already exists and is not an empty directory.''\\ 
 +''fatal: destination path 'openwrt_21.02' already exists and is not an empty directory.''
 </hidden> </hidden>
-==== 2.2 Change directory ==== + 
-Change working directory to the one with cloned repository ([[#clone_repository|step 2.1]]) by Debian terminal command:+==== 2.2 Change working directory ==== 
 +<columns 100% 50% -> 
 +For OpenWrt 19.07 Debian terminal command:
 <code> <code>
 cd openwrt_19.07 cd openwrt_19.07
 </code> </code>
-<hidden> +<newcolumn> 
-[[https://manpages.debian.org/tcl8.6-doc/cd.html|Debian cd manpage]].\\+For OpenWrt 21.02 Debian terminal command: 
 +<code> 
 +cd openwrt_21.02 
 +</code> 
 +</columns> 
 +<hidden onHidden="Click to display more info" onVisible="Click to hide the extra info"
 +See [[https://manpages.debian.org/tcl8.6-doc/cd.html|Debian cd manpage]].\\
 \\ \\
-__Possible message.__\\ +If repository is not cloned ([[#clone_repository|step 2.1]]), message can be one of these:\\ 
-\\ +''-bash: cd: openwrt_19.07: No such file or directory''\\ 
-If repository is not cloned ([[#clone_repository|step 2.1]]), message can be:\\ +''-bash: cd: openwrt_21.02: No such file or directory''
-''-bash: cd: openwrt: No such file or directory''+
 </hidden> </hidden>
-==== 2.3 Select branch (optional) ==== + 
-See info about [[faq:difference_between_a_release_and_a_trunk_build|snapshots, releases and branches]].\\ +==== 2.3 Update local branch==== 
-Debian terminal command:+If there is a new release in the branch, update local branch repository with Debian terminal command: 
 +<code> 
 +git pull 
 +</code> 
 +<hidden onHidden="Click to display more info" onVisible="Click to hide the extra info"> 
 +See [[https://manpages.debian.org/git-man/git-pull.html|Debian git pull manpage]]. 
 +</hidden> 
 + 
 +==== 2.4 Select version ==== 
 +<columns 100% 50% -> 
 +For OpenWrt 19.07 Debian terminal command: 
 +<code> 
 +git checkout v19.07.8 
 +</code> 
 +<newcolumn> 
 +For OpenWrt 21.02 Debian terminal command: 
 +<code> 
 +git checkout v21.02.0 
 +</code> 
 +</columns> 
 +<hidden onHidden="Click to display more info" onVisible="Click to hide the extra info"> 
 +See [[https://manpages.debian.org/git-man/git-checkout.html|Debian git checkout manpage]].\\ 
 +\\ 
 +List branches (tags) with Debian terminal command: 
 +<code> 
 +git tag -l 
 +</code> 
 +See [[https://manpages.debian.org/git-man/git-tag.html|Debian git tag manpage]].\\ 
 +\\ 
 +Show current branch (highlighted in green and marked with an asterisk) with Debian terminal command:
 <code> <code>
 git branch git branch
-git checkout <branch name> 
 </code> </code>
-==== 2.4 Update and install feeds ==== +See [[https://manpages.debian.org/git-man/git-branch.html|Debian git branch manpage]].\\ 
-Debian terminal command:+Or show working tree status with Debian terminal command:
 <code> <code>
-./scripts/feeds update -a +git status
-./scripts/feeds install -a+
 </code> </code>
 +See [[https://manpages.debian.org/git-man/git-status.html|Debian git status manpage]].
 +</hidden>
  
 +==== 2.5 Update and install feeds ====
 +Debian terminal command:
 +<code>
 +./scripts/feeds update -a && ./scripts/feeds install -a
 +</code>
 +<hidden onHidden="Click to display more info" onVisible="Click to hide the extra info">
 If dependencies are not installed ([[#install_required_dependencies|step 1.2]]), messages can be:\\ If dependencies are not installed ([[#install_required_dependencies|step 1.2]]), messages can be:\\
 ''Can't exec "make": No such file or directory at ./scripts/feeds line 22.''\\ ''Can't exec "make": No such file or directory at ./scripts/feeds line 22.''\\
Line 104: Line 166:
 ''Checking 'python'... failed.''\\ ''Checking 'python'... failed.''\\
 ''Checking 'python3'... failed.''\\ ''Checking 'python3'... failed.''\\
-''Checking 'file'... failed.'' +''Checking 'file'... failed.''\\ 
- +If directory is wrong ([[#change_working_directory|step 2.2]]), message can be:\\
-If directory is wrong ([[#change_directory|step 2.2]]), message can be:\\+
 ''-bash: ./scripts/feeds: No such file or directory'' ''-bash: ./scripts/feeds: No such file or directory''
 +</hidden>
 +
 ===== 3. OpenWrt Configuration ===== ===== 3. OpenWrt Configuration =====
 Debian terminal command: Debian terminal command:
Line 113: Line 176:
 make menuconfig make menuconfig
 </code> </code>
 +
 ==== 3.1 Configure target system ==== ==== 3.1 Configure target system ====
-E.g. for hardware from table +For router hardware select corresponding values in menu (:!: link to router hardware table):
-<sortable 1> +
-^[[toh:start|Hardware]] ^Target System ^Subtarget ^Target Profile ^Target directory ^ +
-|[[toh:belkin:f5d8235-4|Belkin F5D8235-4]] v1 |MediaTek Ralink MIPS |RT288x based boards |Belkin F5D8235 V1 |? | +
-|[[toh:d-link:dir-615|D-Link DIR-615]] rev D3 |MediaTek Ralink MIPS |RT3x5x/RT5350 based boards |D-Link DIR-615 D |? | +
-|[[toh:tp-link:archer_mr200|TP-Link Archer MR200]] v1.0 |? |? |? |? | +
-|[[toh:tp-link:tl-wa730re|TP-Link TL-WA730RE]] v1 |Atheros AR7xxx/AR9xxx |Devices with small flash |TP-LINK TL-WA730RE v1 |ar71xx/generic/+
-</sortable> +
-use corresponding values from menu:+
   * “Target System” ⇒ “Select” ⇒ <target system> ⇒ “Select”   * “Target System” ⇒ “Select” ⇒ <target system> ⇒ “Select”
   * “Subtarget” ⇒ “Select” ⇒ <subtarget> ⇒ “Select”   * “Subtarget” ⇒ “Select” ⇒ <subtarget> ⇒ “Select”
   * “Target Profile” ⇒ “Select” ⇒ <target profile> ⇒ “Select”   * “Target Profile” ⇒ “Select” ⇒ <target profile> ⇒ “Select”
 +<hidden onHidden="Click to display more info about tested router hardware and relevant firmware image build information." onVisible="Click to hide table with tested router hardware and relevant build information.">
 +^[[toh:start|Hardware]]                                 ^Branch  ^Target System        ^Subtarget                  ^Target Profile        ^Target directory ^
 +|[[toh:belkin:f5d8235-4|Belkin F5D8235-4]] v1           |21.02.0 |MediaTek Ralink MIPS |RT288x based boards        |Belkin F5D8235 V1     |ramips\rt288x    |
 +|[[toh:d-link:dir-615|D-Link DIR-615]] rev D3           |19.07.8 |MediaTek Ralink MIPS |RT3x5x/RT5350 based boards |D-Link DIR-615 D      |ramips\rt305x    |
 +|:::                                                    |21.02.0 |"bin is too big: 3932975 > 3866624"                                                    ||||
 +|[[toh:tp-link:archer_mr200|TP-Link Archer MR200]] v1.0 |?       |?                    |?                          |?                     |?                |
 +|[[toh:tp-link:tl-wa730re|TP-Link TL-WA730RE]] v1       |19.07.8 |Atheros ATH79 (DTS)  |Devices with small flash   |TP-LINK TL-WA730RE v1 |ath79\tiny       |
 +|:::                                                    |21.02.0 |"images are too big by 306444 bytes"                                                   ||||
 +|[[toh:ubiquiti:unifi|Ubiquiti UniFi AP-LR]]            |21.02.1 |Atheros ATH79        |Generic                    |Ubiquiti UniFi        |ath79\generic    |
 +</hidden>
 +
 ==== 3.2 Options ==== ==== 3.2 Options ====
-?+To add “LuCI”:\\ 
 +  * "LuCI" ⇒ “Select” ⇒ "Collections" ⇒ “Select” ⇒ on "luci" press <Y> to include (= “*” built-in) ⇒ “Exit” ⇒ “Exit” 
 +To remove "ppp" 
 +  * "Network" ⇒ “Select” ⇒ on “ppp” press <N> to exclude (= “ ” excluded) ⇒ “Exit” 
 +To remove "wpad-mini" 
 +<columns 100% 50% -> 
 +For OpenWrt 19.07: 
 +  * "Network" ⇒ “Select” ⇒ on "wpad-mini" press <N> to exclude (= “ ” excluded) ⇒ “Exit” 
 +<newcolumn> 
 +For OpenWrt 21.02: 
 +  * "Network" ⇒ “Select” ⇒ "WirelessAPD" ⇒ “Select” ⇒ on "wpad-basic-wolfssl" press <N> to exclude (= “ ” excluded) ⇒ “Exit” ⇒ “Exit” 
 +</columns> 
 +To add "wpad" 
 +<columns 100% 50% -> 
 +For OpenWrt 19.07: 
 +  * "Network" ⇒ “Select” ⇒ on "wpad" press <Y> to include (= “*” built-in) ⇒ “Exit” 
 +<newcolumn> 
 +For OpenWrt 21.02: 
 +  * "Network" ⇒ “Select” ⇒ "WirelessAPD" ⇒ “Select” ⇒ on "wpad" press <Y> to include (= “*” built-in) ⇒ “Exit” ⇒ “Exit” 
 +</columns> 
 ==== 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” ⇒ "Yes"   * “Exit” ⇒ "Yes"
 +
 ===== 4. Build image ===== ===== 4. Build image =====
 Debian terminal command: Debian terminal command:
 <code> <code>
-make+make V=s 2>&1 | tee build.log
 </code> </code>
 Completion can take time. If successful, the images are in the directory ./bin/targets/<target directory>  Completion can take time. If successful, the images are in the directory ./bin/targets/<target directory> 
Line 150: Line 238:
 Other OpenWrt pages: Other OpenWrt pages:
   * [[docs:guide-developer:start|Developer guide]]   * [[docs:guide-developer:start|Developer guide]]
-  * [[docs:guide-user:additional-software:beginners-build-guide|Beginners guide to building your own firmware]]+  * [[docs:guide-developer:toolchain:beginners-build-guide|Beginners guide to building your own firmware]]
  • Last modified: 2021/11/27 12:31
  • by ja