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



Rep: (519)
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: (7)
* A123l,
No problem.



Rep: (519)
In general, for the sake of interest, I also installed java8 via webupd8team / java.
After that I tried to start collecting LEDE, everything is ok.
here's the exhaust if you're interested
sjdfk @ jsdkfh: ~ / test $ git clonehttps://git.lede-project.org/source.gitlede
Cloning into 'lede' ...
remote: Counting objects: 386486, done.
remote: Compressing objects: 100% (113008/113008), done.
remote: Total 386486 (delta 264470), reused 376320 (delta 256594)
Receiving objects: 100% (386486/386486), 128.39 MiB | 3.87 MiB / s, done.
Resolving deltas: 100% (264470/264470), done.
Checking connectivity ... done.
sjdfk @ jsdkfh: ~ / test $ cd ~ / test / lede
sjdfk @ jsdkfh: ~ / test / lede $ ./scripts/feeds update
Updating feed 'packages' from'https://git.lede-project.org/feed/packages.git ' ...
Cloning into './feeds/packages' ...
remote: Counting objects: 3855, done.
remote: Compressing objects: 100% (3254/3254), done.
remote: Total 3855 (delta 165), reused 3178 (delta 102)
Receiving objects: 100% (3855/3855), 2.35 MiB | 3.05 MiB / s, done.
Resolving deltas: 100% (165/165), done.
Checking connectivity ... done.
Create index file './feeds/packages.index'
Checking 'working-make' ... ok.
Checking 'case-sensitive-fs' ... ok.
Checking 'proper-umask' ... ok.
Checking 'gcc' ... ok.
Checking 'working-gcc' ... ok.
Checking 'g ++' ... ok.
Checking 'working-g ++' ... ok.
Checking 'ncurses' ... ok.
Checking 'zlib' ... ok.
Checking 'perl-thread-queue' ... ok.
Checking 'tar' ... ok.
Checking 'find' ... ok.
Checking 'bash' ... ok.
Checking 'patch' ... ok.
Checking 'diff' ... ok.
Checking 'cp' ... ok.
Checking 'seq' ... ok.
Checking 'awk' ... ok.
Checking 'grep' ... ok.
Checking 'getopt' ... ok.
Checking 'stat' ... ok.
Checking 'unzip' ... ok.
Checking 'bzip2' ... ok.
Checking 'wget' ... ok.
Checking 'perl' ... ok.
Checking 'python' ... ok.
Checking 'git' ... ok.
Checking 'file' ... ok.
Checking 'ldconfig-stub' ... ok.
Collecting package info: done
Collecting target info: done
Updating feed 'luci' from 'https://git.lede-project.org/project/luci.git ' ...
Cloning into './feeds/luci' ...
remote: Counting objects: 4509, done.
remote: Compressing objects: 100% (2400/2400), done.
remote: Total 4509 (delta 1032), reused 3061 (delta 551)
Receiving objects: 100% (4509/4509), 3.91 MiB | 3.26 MiB / s, done.
Resolving deltas: 100% (1032/1032), done.
Checking connectivity ... done.
Create index file './feeds/luci.index'
Collecting package info: done
Collecting target info: done
Updating feed 'routing' from 'https://git.lede-project.org/feed/routing.git ' ...
Cloning into './feeds/routing' ...
remote: Counting objects: 368, done.
remote: Compressing objects: 100% (287/287), done.
remote: Total 368 (delta 22), reused 198 (delta 13)
Receiving objects: 100% (368/368), 238.11 KiB | 0 bytes / s, done.
Resolving deltas: 100% (22/22), done.
Checking connectivity ... done.
Create index file './feeds/routing.index'
Collecting package info: done
Collecting target info: done
Updating feed 'telephony' from 'https://git.lede-project.org/feed/telephony.git ' ...
Cloning into './feeds/telephony' ...
remote: Counting objects: 205, done.
remote: Compressing objects: 100% (183/183), done.
remote: Total 205 (delta 14), reused 93 (delta 4)
Receiving objects: 100% (205/205), 146.26 KiB | 0 bytes / s, done.
Resolving deltas: 100% (14/14), done.
Checking connectivity ... done.
Create index file './feeds/telephony.index'
Collecting package info: done
Collecting target info: done
sjdfk @ jsdkfh: ~ / test / lede $

The same 16.10
On the main system 16.04 is still ok.
So what is wrong with you, try again with the complete removal of the catalog, maybe where it is.



Rep: (7)
put a clean 17.04 server, everything went. Thank you for your feedback :) sorry for nothing "raised dust" ...



Rep: (519)
usenkov999 @ 05.05.17, 13:28*
in vain "dust raised"

Yes, for good reason, I wonder what happened. Well, apparently we will not know.



Rep: (93)
Nakosyachil hardly. The thing is Ubunu (something is missing).
A123l @ 05/10/17, 1:30*
Well, apparently we will not know.

Now I remember that somehow I kind of had something like that, but somehow I was passing for some time and maybe not even with routers. I do not remember already ... so rather a flood.

Post has been editedA123l - 10.05.17, 13:42



Rep: (7)
* stp101,
It's not a problem to find out, that ubuntu is well worth it, to know what to pick. He swears at the make version. That's all i got



Rep: (519)
usenkov999 @ 05/10/17, 13:43*
He swears on the make version

And what version? make -v at 16.04 GNU Make 4.1 Virtualka from 16.10 has already been deleted.

Post has been editedstp101 - 10.05.17, 13:51



Rep: (93)
Not the topic.
Why do you install Ubuntu? Linux Mint (it's true based on Ubuntu) is more convenient for me (and not only mine). Linux Mint Mate is generally more familiar - "almost Windows". Not quite correct, but I would compare it like this: OpenWrt is Ubuntu, Lede is Mint. The taste and color of course - ...



Rep: (519)
* A123l,
UbuntuServer from Mint X will have to be removed and so on and so on. So why is it needed if, for example, a file washer is done, and not a desktop.



Rep: (7)
* stp101,
the answer to the make -v command pleased me: D

unifi @ ubuntu: ~ $ make -v
The program 'make' can be found in the following packages:
* make
* make-guile



Rep: (519)
* usenkov999,
sudo apt-get install make: rofl: that’s the problem



Rep: (7)
* A123l,
ubuntu is kind of like a classic, I'm used to it. just that, I immediately grab onto ubuntu, I did not try other options.

Posted on 05/10/2017, 14:19:

Taax, but let me torment you a little more :) Here I collect the firmware for unifi ap lr. There is an AR9287 radio module, and now I am faced with the problem of choosing a driver. In openwrt \ lede firmware, it is defined as MAC80211 802.11bgn, as I understand it is some standard driver, but even that I did not find something in the firmwares section.



Rep: (519)
* usenkov999,
So, there are already ready profiles there.
Attached Image



Rep: (93)
Stp101 @ 05/10/17, 14:15*
that’s the problem

well yes, lacked make (the "charms" of Linux: P)
Stp101 @ 05/10/17, 14:10*
not desktop

I meant just him
usenkov999 @ 05.05.17, 14:16*
I did not try other options

so I advised Mint
Attached Image


Post has been editedA123l - 10.05.17, 14:38



Rep: (7)
* stp101,
I chose the profile, but there is no description of what is included in it and with the very next step I ran into the firmware section and saw the choice of drivers there, so I was puzzled :)



Rep: (93)
Let's do better - forWHAT (why) you want to flash LEDE?



Rep: (7)
* A123l,
Well, I can say, the use of openwrt \ lede firmware on unifi equipment gives a lot of advantages. The points at least cease to hang, stop losing speed, respectively, customers become more satisfied with the work of the wi fi network.



Rep: (519)
usenkov999 @ 05.05.17, 14:16*
AR9287

I understand that you need ath9k-htc-firmware
Not exactly sure better google it.
Well, yes, if it is selected by profile and exposes
Attached Image
Although I would simply choose the default profile (all drivers)
That MAC80211 was found :)

Post has been editedstp101 - 10.05.17, 15:13



Rep: (93)
C it is clear. Have you viewed (read) the ability to roll back from OpenWrt / Lede to your native firmware?
p.s. I ask for a reason (chat). Always have time to assemble the firmware. But that would not get an inoperative device should be insured.
If you have already flashed the finished firmware from LEDE, then my questions (tips) are superfluous.
In general, the firmware assembled by default config (from LEDE) is first flashed — it is created automatically when a profile is selected. Checks, specifies that you need to add / remove. It is compiled and re-flashed (or repeatedly ...).

Post has been editedA123l - 10.05.17, 15:49



Rep: (7)
* A123l I, of course, stitched and almost no problems with rollback. And the manual assembly is rather a sporting interest and curiosity. As well as the desire to get the software of the first freshness


Full version    

Help     rules

Now: 02.08.19, 00:36