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: (30)
* stp101,
Good guide you laid out earlier on the assembly. In general, in the TP-Link section, you need to create a theme about collecting firmware. Consider the configs for assembly by half the same for all TP-Links.

Have questions.
Here isLEDEassembly wavsky. You laid out how to initially start collecting.
But how to be like, for example, if for the first time (in the example with ice) I chose only the profile of 841 and rusik and collected the rest by default. I have downloaded the entire designer and the LEDE folder is now over 5 gigs. Those. for further collection dokachivat virtually (I guess) do not need anything.
The essence of the question is how to "start" the assembly next time in this case? Those. already with the existing constructor on the hard.
For example, I thought up the next day (or a week later) to assemble the firmware with the changes. Where to start?
cd lede
make menuconfig choosing the right one
make

And good luck? Or what other teams to refresh?

Getting started: For a 4-core processor, the command will be
make -j3 V = -1

And with 2 nuclear how to be? If it is possible with explanations, what are these commands?-j3 V = -1 ? I still linuksovod =>0: blush:

Another question aboutUltra litefirmware repeatedly mentioned here in the subject. Good stuff. The floor of megabyte is free and the Internet became faster with it.
If you start to collect and in the openedmake menuconfig to push Save then the LEDE folder is saved My_name.config .
The link to download ultra lightweight firmware in the dropbox isconfig.seed .
In the router (where is it there?) With the ultra light installed, there is also a config.
Is it possible to take to help the last two edit-comment outMy_name.config for example, even in Windows in Notepad ++ and slip into
make menuconfig for custom assembly?



Rep: (143)
BoBaH_13 @ 04.04.17, 09:29*
And good luck? Or what other teams to refresh?

cd lede
make clean (necessarily) - deletes the result of the previous build (clears the bin folder). Again -MANDATORY
make menuconfig choosing the right one
make or make -jx where x is the number of cores CPU + 1
BoBaH_13 @ 04.04.17, 09:29*
And with 2 nuclear how to be?

make -j3
with 4-core, respectively, make -j5 (and not 3 as it was incorrectly stated above)
BoBaH_13 @ 04.04.17, 09:29*
V = -1

unnecessaryparameter (disables detailed information in the console). V = s or V = 99 includes.
p.s.my answers relate to openwrt . LEDE (she was not interested) should be similar.

Post has been editedA123l - 28.04.17, 11:18



Rep: (445)
BoBaH_13 @ 04.04.17, 11:29*
In general, in the TP-Link section, you need to create a theme about collecting firmware.
All this has been on the Internet for a long time, we type in Yandex "we collect firmware from a trunk", information will come out above the belt, and all the subtleties come with experience and depend on the capabilities of the collector.
* A123l,
lede, same openwrt database.



Rep: (445)
A123l @ 04/04/17, 12:59*
make clean (required) - deletes the result of the previous build (clears the bin folder). Once again - MANDATORY
But this is not necessary, just before applying the patch. it is enough to remove .config, make clean does not remove the previously installed packages, and disabling them in the menu, there are tightened packages. If a patch is applied to create a new firmware, so that it appears in the menu, delete the / tmp folder, it will be created automatically by the subsequent configuration.

Post has been editedvovan26_ - 28.04.17, 13:18



Rep: (143)
vovan26_ @ 04/28/17, 12:50*
But this is not necessary

Do not distribute incorrect experience. The make clean command is required to avoid possible problems when re-compiling (and following) firmware compilations. This is not from my experience (this is the “wish” of OpenWrt and Linux in general) and there is an example from the user in my drugs. I always try to be correct (especially when compiling) and I advise others not for the sake of "smart words". And I don’t want to compete in knowledge. If someone is too lazy to perform a simple command, that is his business.

Post has been editedA123l - 28.04.17, 18:39



Rep: (0)
Guys, please tell me. I assembled for the OpenWRT router from the trunk .. but when I filled in the router it seemed to be ok ... connected via serial and there is firmware, that is .. Only ip does not send to the computer and the web muzzle is unavailable .. when trying to install luci it says installed, went to the network file and there is empty ... Who will tell me how to manually raise the dhcp server on it so that you can get ip and deliver the packages.?!



Rep: (577)
DS_ExPloID @ 05.05.17, 20:59*
Only ip does not send to the computer and the web muzzle is unavailable .. when trying to install luci it says that it is already installed

So all the same is not turned out.
I mean, they collected the base correctly, if you need to fix it without a web muzzle, here is the instruction//savagemessiahzine.com/forum/index.php?s=&showtopic=734671&view=findpost&p=52597411

Post has been editedstp101 - 01.05.17, 21:02



Rep: (0)
stp101 @ 01.05.17, 23:01*
So all the same is not turned out.

well, yes .. it is not a brick, but the ved snout is inaccessible ... and does not know how to work with the network ... maybe it was necessary to mark the network settings during the assembly?! or are they all configured in the def?



Rep: (577)
DS_ExPloID @ 05.05.17, 21:03*
maybe at assembly it was necessary to mark network settings?

What type of connection do you have?



Rep: (0)
What type of connection do you have?

DHCP



Rep: (577)
* DS_ExPloID,
Then it is strange, it should work right away, there is nothing to choose there, DHCP will be right away, try to rebuild.



Rep: (0)
Then it is strange, it should work right away, there is nothing to choose there, DHCP will be right away, try to rebuild.

Yes, I am already reassembling .. That's what I think is strange .. maybe I didn’t notice how I knocked out some component during assembly .. By the way, if uci is disabled, then this behavior can happen! I get an error message when I load it .. I looked in the assembly, disabled ..



Rep: (0)
* stp101,
Another question. Correctly, I realized that when assembling, if I note * then the component will be immediately in the assembly, and if M is noted, can it be delivered later? Does M affect the size of the assembly? I apologize for stupid questions ... just for the first time)



Rep: (577)
* DS_ExPloID,
Yes, that's right, if you note * it will be in the file. If M then the package will be assembled but without including the firmware file in the bin.
DS_ExPloID @ 05/01/17, 21:34*
I apologize for the dumb questions

These are not stupid questions, everything is ok;)



Rep: (143)
* DS_ExPloID, Did you do everything right (according to the instructions) after uploading the firmware to the router? If poured while on the drain, the password entered tfnet telnet?

Post has been editedA123l - 02.05.17, 22:16



Rep: (0)
A123l @ 05/02/17, 23:49*
Did you do everything right (according to the instructions) after uploading the firmware to the router? If poured while on the drain, the password entered tfnet telnet?

Yes, I have already figured out this .. the firmware works. I have another problem here .... There is no wifi in the firmware, that is, in general! choose in kernel? if so which one to choose for ar9341 ?!



Rep: (0)
all) understand) everything works) thanks to all for the help



Rep: (7)
Hello! Guys, please explain to the beginner, what is the advantage of collecting firmware manually?



Rep: (91)
Hello! Guys, please explain to the beginner, what is the advantage of collecting firmware manually?

1. The possibility of flexible configuration of the package in the firmware, the removal of unnecessary (for example ipv6) and the addition of the necessary (adblock, tor, etc.). Especially true for routers with a small amount of memory where each kilobyte counts, and there are many likes.
2. The latest release of OpenWRT was in March 2016. Over the year, a lot of changes were made to the stable repository, a number of packages and the kernel itself were updated. Self-assembly means that all these changes will eventually be in your firmware, while the rest will download the 2016 version.

With LEDE, the situation is slightly different. OpenWRT hasn’t been updated since February 2017, LEDE’s already received its service Jan. 17 release in April, making OpenWRT an even more ancient dinosaur.)) At the moment I see no reason to use OpenWRT at all.



Rep: (577)
TTB @ 05/09/17, 17:45*
At the moment, I see no reason to use OpenWRT at all.

Soon, perhaps everything will change, recently I came across the newsOpenWrt and LEDE Developers Consider Project Merger Plan

Post has been editedstp101 - 09.05.17, 17:48


Full version    

Help     rules

Time is now: 16/11/20, 9:01