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



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


Build OpenWrt / LEDE from source


Attached Image
In this topic, you must post images under the 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
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.
For convenience, create a directory, for example, with the name 1 and go into it
mkdir 1 && cd ~ / 1

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 have downloaded. Our initial path was ~ / 1 and we ran the command above along this path, we created the openwrt directory, we need to go to it to continue
cd ~ / 1 / 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 a 4-core processor, to include all cores, the command will be as follows:
make -j5 V = -1

Attached Image

We are waiting, in half an hour or an hour we find our firmware in the directory ~ / 1 / 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

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
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 - 30.07.19, 00:39
Reason for editing: OpenWrt release 06/18/04



Rep: (523)
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



Rep: (88)
STP101 @ 05/09/17, 17:48*
Soon, perhaps everything will change, recently the news came across Developers of OpenWrt and LEDE are considering a plan for merging projects

Well, the second approach is already at the merger, the first ended in nothing (and good). Just what will change? LEDE is the same OpenWRT only everything is fresh and actively sawn further. In fact, only a brand is needed from OpenWRT, but here in Linux we are not collecting firmware for the sake of a nameplate, right?)



Rep: (523)
TTB @ 05/09/17, 18:02*
Just what will change?

So they want to use LEDE rap in OpenWrt. It's just that a bunch of farkov is also not good, as a beginner can get confused. : D so if you think about it, it looks like openwrt / lede - debian / ubuntu.



Rep: (7)
* ttb , i.e. collecting firmware manually do I get fresh components, drivers?



Rep: (88)
Usenkov999 @ 05/09/17, 10:28*
ttb, i.e. collecting firmware manually do I get fresh components, drivers?

I won’t say anything about drivers, but you’ll get the latest versions of all packages (including those that directly route and network functions) and kernels. If the OpenWRT / LEDE team made these changes, of course. Do not forget to synchronize your repository with the fresh one just before assembly. Usually the git pull command does this, but it depends on the firmware.



Rep: (523)
Usenkov999 @ 05/09/17, 10:28*
those. collecting firmware manually do I get fresh components, drivers?

When assembling manually, you get firmware for your device, with the components that you need. A simple example, I put OpenWrt on a Dir-300 and out of the box I get English localization, without L2TP, without QOS, without UPnP, etc. I configure, install the components I need, the Russian language, etc., but if I decide to do a reset, then everything needs to be reinstalled. Having assembled the firmware myself, I add to it everything that I need for my device (including settings for me so that everything works out of the box). When reset, everything will remain.



Rep: (7)
And now I have encountered a problem. When executing the script ./scripts/feeds update I get the result:
Can't exec "make": No such file or directory at ./scripts/feeds line 22.
Unsupported version of make found: make
Did on ubuntu server 16.10. In linukha is not strong, I will not decide. I understand that swears on the make version.

Post has been editedusenkov999 - 10.05.17, 11:13



Rep: (93)
Usenkov999 @ 05/10/17, 11:12*
When executing the script ./scripts/feeds update

actually correct ./scripts/feeds update -a



Rep: (523)
* usenkov999,
Are you trying to do something from the root?



Rep: (7)
* A123l,
actually wrote by hand, and do not save with paste, I'm not blind and I see how it is right, the essence does not change.
* stp101,
and from the root and from the user.



Rep: (93)
Usenkov999 @ 05/10/17, 12:16*
I'm not blind and see how right

blind and would not try to help ...



Rep: (7)
* A123l,
so have any ideas? Or maybe there are requirements for the same ubuntu? Sorry if rude.



Rep: (523)
* usenkov999,
Hmm, for fun, I repeated everything on the virtual machine from 16.10 without the installed set of tools for the compiler
All OK.
Collecting package info: done
Collecting target info: done
Try to delete the entire directory (it will be more convenient through mc) and repeat the steps.



Rep: (93)
* usenkov999, You simply did not enter (cd openwrt) into the downloaded openwrt directory in the terminal
Usenkov999 @ 05/10/17, 11:12*
No such file or directory at


Post has been editedA123l - 10.05.17, 12:55



Rep: (7)
* stp101,
* A123l,
that's all I have already tried and done. Of course, I entered the catalog, by the way I did lede
git clonehttps://git.lede-project.org/source.gitlede, then cd lede and then trying to execute the script. I have java and unifi controller on this server, so does it not conflict with everything.



Rep: (93)
Usenkov999 @ 05/10/17, 12:54*
I have java and unifi controller on this server, so does it not conflict with everything.

I don’t know that. I just checked on openwrt too - everything is done.



Rep: (7)
* A123l,
with lede, after all, it’s all the same, right?



Rep: (93)
* usenkov999, similarly. And just checked with Lede - everything is done too

Posted on 05/10/2017, 13:04:

Usenkov999 @ 05/10/17, 12:58*
* A123l,
with lede, after all, it’s all the same, right?

everything works the same way (checked now)



Rep: (7)
Attached Image

Attached Image

Attached Image



Rep: (93)
Now I will not prompt. Perhaps because of 16.10 (I tried on 16.04 - Linux Mint).
And when did you download, everything went fine?

Post has been editedA123l - 10.05.17, 13:19


Full version    

Help     rules

Now: 08/14/19, 12:26