Build OpenWrt / LEDE from source codes | [firmware] OpenWrt / LEDE compilation from source codes



Rep: (577)
OpenWrt / LEDE (General theme) | DD-WRT FIRMWARE | Collect bin (dump) for the programmer | Upgraded UBOOT loaders


Build OpenWrt / LEDE from source


Attached Image
This topic should be placed under the image and logs spoilerPicture


Description / What is discussed in the topic, and what is not
OpenWrt is an embedded Linux kernel-based operating system designed primarily for home routers. Core components include the Linux kernel, util-linux, uClibc or musl, and BusyBox. The source code is open. Distributed under licenseGNU GPL

The LEDE project is developed on the basis of Linux, an embedded meta-distribution based on OpenWRT, focused on a wide range of SOHO wireless routers and non-network devices. “Linux Embedded Development Environment”.
LEDE turned away from the parent project in May 2016, with the goal of continuing to develop better software in an open management model and encouraging new developers to contribute and development efforts.


  • This topic is intended to discuss the build process, discuss the components of the firmware for inclusion in the finished file for the firmware of your router and everything that is not related to the compilation of the firmware.
  • In this topicdon't discuss OpenWrt / LEDE settings, installation process of ready-made assemblies on your router. Questions like: "I installed OpenWrt and now I don’t know what to do, how to set up the Internet" is offtopic and will be deleted without any warnings. There is a general theme for such questions. OpenWrt / LEDE - alternative firmware

Initial instruction with pictures. Buildroot Build Method
Quick reminder for those who already know how to do it. Who is not in the theme, read below in detail
Fast downloads and all the steps to begin compiling
Download the desired branchfrom here and inserted before the first && then everything will be executed automatically
&& cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq


Cook faster team
19.07.4
git clone git: //github.com/openwrt/openwrt.git -b v19.07.4 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

19.07.3
git clone git: //github.com/openwrt/openwrt.git -b v19.07.3 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

19.07.2
git clone git: //github.com/openwrt/openwrt.git -b v19.07.2 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

19.07.1
git clone git: //github.com/openwrt/openwrt.git -b v19.07.1 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

19.07.0
git clone git: //github.com/openwrt/openwrt.git -b v19.07.0 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

18.06.7
git clone git: //github.com/openwrt/openwrt.git -b v18.06.7 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

18.06.6
git clone git: //github.com/openwrt/openwrt.git -b v18.06.6 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

18.06.5
git clone git: //github.com/openwrt/openwrt.git -b v18.06.5 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

18.06.4
git clone git: //github.com/openwrt/openwrt.git -b v18.06.4 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

18.06.3
git clone git: //github.com/openwrt/openwrt.git -b v18.06.3 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

18.06.2
git clone git: //github.com/openwrt/openwrt.git -b v18.06.2 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

18.06.1
git clone git: //github.com/openwrt/openwrt.git -b v18.06.1 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

18.06.0
git clone git: //github.com/openwrt/openwrt.git -b v18.06.0 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

17.01.6
git clone git: //github.com/openwrt/openwrt.git -b v17.01.6 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

17.01.5
git clone git: //github.com/openwrt/openwrt.git -b v17.01.5 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

17.01.4
git clone git: //github.com/openwrt/openwrt.git -b v17.01.4 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

17.01.3
git clone git: //github.com/openwrt/openwrt.git -b v17.01.3 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

17.01.2
git clone git: //github.com/openwrt/openwrt.git -b v17.01.2 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

17.01.1
git clone git: //github.com/openwrt/openwrt.git -b v17.01.1 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq

17.01.0
git clone git: //github.com/openwrt/openwrt.git -b v17.01.0 && cd ~ / openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq




All manipulations are done on a computer with linux (in our example it will be for Debian / Ubuntu)
First, install everything you need.

Open the console and copy the commands there.
sudo apt-get install subversion git

Further
sudo apt-get install g ++ libncurses5-dev zlib1g-dev gawk libssl-dev unzip make

Is done.

Next you need to download the source of the firmware (see spoilerGit-repositories of OpenWrt and LEDE projects )

Download the branch we need (in this example, it is OpenWrt v17.01.4)

git clone git: //github.com/openwrt/openwrt.git -b v17.01.4


Next, go to the directory so that we download. ~ / (Ie home, he's home directory) we created openwrt directory, you need to go into it to continue
cd ~ / openwrt /

In Ubuntu, you can:
Attached Image

Now you need to run
./scripts/feeds update -a


After the update process is completed, we perform
./scripts/feeds install -a

Almost everything is ready, then we perform
make prereq

If everything is ok, then there will be this message: Collecting package info: done
Starting the interface for selecting the firmware components (in the latest versions it appears automatically after the previous step)
make menuconfig

Moving through the points is done with the keyboard keys: up-down, space and esc.
Target system
Attached Image

Target Profile can be selected for the desired model, if you leave the default profile then a lot of compiled firmware will be created for all devices at once from the Target System profile
Attached Image

Now a few simple explanations:
We put the web-interface
Attached Image

Attached Image

Attached Image

and Russian language to him
Attached Image

Attached Image

Attached Image

To support L2TP, you need to select the xl2tpd package.
Attached Image

Attached Image

Attached Image

Also the necessary protocols pptp and so on are selected here:
Network --->
<*>ppp
<*>ppp-mod-pppoe
<*>ppp-mod-pppol2tp
<*>ppp-mod-pptp
Attached Image

Add busybox components:
Attached Image

Attached Image

Attached Image

Well, then be guided by your needs, remember that the place in the router is not rubber and you often need to keep within 4 mb., So do not overdo it.
When everything is finished, save our configuration with the button<Save>
We proceed to the assembly:
make

And for 4-core processor, to enable all cores, the team will be: (number of cores 1, and here it turns out -j5)
make -j5 V = -1

Attached Image

Waiting over half an hour find its firmware in the directory ~ / openwrt /bin

If the correct target is selected before the build, but the firmware is obtained in a size larger than the size allowed for the flash of your router - the files * sysupgrade.bin and * factory.bin will not be created.

Cleaning
make clean

Removes the contents of the bin and build_dir directories.

make dirclean

Removes the contents of the / bin and / build_dir directories, as well as the addition of / staging_dir and / toolchain (cross-compilation tools). 'Dirclean' is the main command for a thorough cleanup.

make distclean

Removes everything that you have collected or configured, and also removes everything downloaded from the repository and the source codes of the packages.
ATTENTION: Among other things, your build configuration (.config), your toolchain, and all other source codes will be erased. Use with caution!

Addresses of the repositories used are in the file feeds.conf.default

Git-repositories of OpenWrt and LEDE projects
19.07.4
git clone git: //github.com/openwrt/openwrt.git -b v19.07.4

19.07.3
git clone git: //github.com/openwrt/openwrt.git -b v19.07.3

19.07.2
git clone git: //github.com/openwrt/openwrt.git -b v19.07.2

19.07.1
git clone git: //github.com/openwrt/openwrt.git -b v19.07.1

19.07.0
git clone git: //github.com/openwrt/openwrt.git -b v19.07.0

18.06.7
git clone git: //github.com/openwrt/openwrt.git -b v18.06.7

18.06.6
git clone git: //github.com/openwrt/openwrt.git -b v18.06.6

18.06.5
git clone git: //github.com/openwrt/openwrt.git -b v18.06.5

18.06.4
git clone git: //github.com/openwrt/openwrt.git -b v18.06.4

18.06.3
git clone git: //github.com/openwrt/openwrt.git -b v18.06.3

18.06.2
git clone git: //github.com/openwrt/openwrt.git -b v18.06.2

18.06.1
git clone git: //github.com/openwrt/openwrt.git -b v18.06.1

18.06.0
git clone git: //github.com/openwrt/openwrt.git -b v18.06.0

17.01.6
git clone git: //github.com/openwrt/openwrt.git -b v17.01.6

17.01.5
git clone git: //github.com/openwrt/openwrt.git -b v17.01.5

17.01.4
git clone git: //github.com/openwrt/openwrt.git -b v17.01.4

17.01.3
git clone git: //github.com/openwrt/openwrt.git -b v17.01.3

17.01.2
git clone git: //github.com/openwrt/openwrt.git -b v17.01.2

17.01.1
git clone git: //github.com/openwrt/openwrt.git -b v17.01.1

17.01.0
git clone git: //github.com/openwrt/openwrt.git -b v17.01.0

15.05.1
git clone git: //github.com/openwrt/archive.git -b v15.05.1

15.05
git clone git: //github.com/openwrt/archive.git -b v15.05

14.07
git clone git: //github.com/openwrt/archive.git -b v14.07

12.09
git clone git: //github.com/openwrt/archive.git -b v12.09





Useful programs
WinSCPgraphical client SFTP and SCP
Settings for connecting to a router with LEDE (dropbear must be enabled)
Attached Image

Tftpd32
TFTP for Linux using Ubuntu as an example
Configure tftpd-hpa TFTP server

Install the tftpd-hpa package:
sudo apt-get install tftpd-hpa

After installation, edit the file
sudo nano / etc / default / tftpd-hpa
containing server settings. Let's bring it to the following form:

TFTP_USERNAME = "tftp"
TFTP_DIRECTORY = "/ var / tftp"
TFTP_ADDRESS = "0.0.0.0:69"
TFTP_OPTIONS = "- ipv4 --secure --create --umask 027 --permissive"


In the settings are additional options:
create allows the server to create new files,
ipv4 instructs it to wait for connections only on IPv4 addresses,
umask instructs to reset the write bit for the group and all access bits for other users,
permissive instructs not to carry out any file permissions checks in excess of the operating system.

Create a directory for the tftp server, give the server access to the directory:

sudo mkdir / var / tftp

sudo chown tftp: tftp / var / tftp


You can also change the home directory of the tftp user in the / etc / passwd file to / var / tftp.

Now we just write the ip addresses we need through the gnome network manager and that's it.

It remains to restart the daemon to start working with the new directory:
sudo /etc/init.d/tftpd-hpa restart


Instructions
Useful topics
OpenWrt project news


Post has been editedstp101 - 18.09.20, 23:04
Reason for editing: Issue OpenWrt 19.07.4



Rep: (111)
Pilot6 @ 08.03.20, 17:53*
Well meet another tulcheyn in its catalog, whom he interferes? He did not meet instead.

Oh, this is important
then even easier
thank!!



Rep: (228)
* segerist,
you can download the sdk, for example,openwrt-sdk-19.07.2-ramips-mt7621_gcc-7.5.0_musl.Linux-x86_64.tar.xzit has compiled toolchain, save time



Rep: (40)
Previously, there was a problem, I decided it. I get out of the text, so as not to clutter up the topic

Post has been editeddpinchyk951 - 08.03.20, 23:43



Rep: (42)
butaford @ 08.03.20, 19:32*
save time

With modern processors all this is going fast enough. Gone are the days when the clock going. So already irrelevant.



Rep: (111)
butaford @ 08.03.20, 19:32*
sdk can be downloaded, for example openwrt-sdk-19.07.2-ramips-mt7621_gcc-7.5.0_musl.Linux-x86_64.tar.xz it has collected the toolchain, save time

thank
you should try \ learn



Rep: (40)
Hey.
Please tell me how to push a custom theme in OpenWRT?
Collect .ipk and through opkg set in a working system, or embed in the assembly - for me both ways are suitable.

Here, for example, I wanted to imagine such a topic here:
https://github.com/ysoyipek/luci-theme-netgear

Firmware myself collect using Image Builder.
How to push this issue there?



Rep: (107)
* dpinchyk951, you use Image Builder, which collects the image of the ready-kernel and packages. And your link - sources, which first need to compile and package in the environment Buildroot (As they are in this environment to add the description states: Adding Netgear to your own LEDE / OpenWRT Build ).
This is the case in general, butin this particular- this is only a design theme, it arhitekturonezavisima, there are no executable files and there is nothing to compile, enough to place the package files with paths to the root of the collected image (although in this case it is not in the database of installed packagesopkg).
Image Builder - Adding to the image file
VariableFILESIt allows you to add custom files in the firmware. This is useful if the firmware must be preconfigured network configuration, etc. Procedure:
  1. Create a subfolderfiles /Measles in catalog Image Builder
  2. Add the necessary files c ways
  3. Executemake imagewith selected variables:make image PROFILE = XXX PACKAGES = "pkg1 pkg2 -pkg3 -pkg4" FILES = files /
(a source:Image Builder (openwrt.org))
Netgear theme - Screenshot
Attached Image
The attached archive - as the ipk package built in Buildroot, and separate files:

Attached files

Attached fileluci-theme-netgear.zip(418.89 KB)


Post has been editedsalexa - 09.03.20, 02:37



Rep: (228)
Pilot6 @ 08.03.20, 20:58*
With modern processors all this is going fast enough

Who is going to Dev
segerist @ 08.03.20, 16:42*
multiple virtual machines

Come and would be a thread Xeon Silver 4114 or Xeon E5-2630, no question, but some PC is not as powerful



Rep: (42)
butaford @ 09.03.20, 08:46*
Who is going to Dev

Do not ... well, you can be perverted and wrong.



Rep: (111)
butaford @ 09.03.20, 08:46*
but some PC is not as powerful

Pilot6 @ 09.03.20, 10:33*
Do not ... well, you can be perverted and wrong.

and then as a pervert and vseravno higher Core2Duo E8400 can not jump :)
otherwise there is no
tulcheyn going 4 hours, then the firmware significantly bstree, 15-30 minutes
and if already assembled to which is added (e.g. forgot config slip) then generally 5 minutes can be compiled
: D



Rep: (143)
* Pilot6 and I have even the basic operating system (windows) in the vhd and her pieces ... N virtual ok, each for a specific task. It "does not know the" do not understand, alas
Pilot6 @ 09.03.20, 10:33*
It can be perverted and wrong



Rep: (17)
I wanted to collect on your tl-wr741nd v4 firmware 19.07.02
In the Target Profile can not find your model. Where she Delhi?
18.06 In all there



Rep: (228)
* EvilDill
Target System ->(Atheros ATH79 (DTS))
Subtarget ->(Devices with small flash)
Target Profile ->(TP-Link TL-WR741N / ND v4)



Rep: (206)
Hello help collect firmware for Asus rt-ac750, even poke his nose where to start)



Rep: (80)
* Jedi Basil,
General instructions for actionopenwrt on site
And due to the rampant fashion to give the same piece of iron under different names - there is a chance that it is one of the variations asus rt-ac51u, which is already fully supported.
In general, specify the model, processor, flash drive size and partition as described in the reference.



Rep: (113)
Friends tried to collect openwrt in instructions fromcapsBut not in the config settings LUCI item!
here's proof!
Attached Image

Prior to that collected several times, experience is available, this item was always! What has happened, what to do, no one vkurse? : Scratch_one-s_head:

Post has been editedgrey087 - 25.03.20, 14:08



Rep: (16)
* grey087,
luci installed from a separate feed
Unless you upgrade and install the appropriate feed (or all feeds) in the config will not appear relevant packages.



Rep: (107)
* grey087,
./scripts/feeds update -a
./scripts/feeds install -a



Rep: (1)
The computer has a processor PentiumВ® G5400 he nuclear 2 4-x-line. Which configuration command compilationmakeis correct -
make -j5 V = -1 or make -j3 V = -1? Or is there a more correct option.

Post has been editedjournalist - 26.03.20, 17:10



Rep: (228)
* journalist,
make -j $ (( `nproc` + 1)) V = s


Full version    

Help     rules

Now: 10.11.20, 10:45