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



Rep: (573)
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: (0)
A123l @ 10/18/17, 5:05*
works !

Dear A123l Well, why did you get the first assembly that you got, and not mine. They would help with the question what the build for my router includes and whether luci is included there.



Rep: (142)
Chikengod @ 10/18/17, 17:34*
why did you take the first available assembly, not mine

Because the method is not suitable for your firmware. So you toilya-fedin
Chikengod @ 10/18/17, 16:17*
How to remake an assembly with the .bin extension in .img

It will not tell (not aware) that would really
Chikengod @ 10/18/17, 16:17*
nothing broke


Post has been editedA123l - 18.10.17, 19:51



Rep: (2234)
A123l @ 10/18/17, 18:55*
Because the method is not suitable for your firmware.

Because he threw the link not on the request, but on the initramfs. His request is athttps: //downloads.open...quashfs-sysupgrade.bin
But the initramfs can be unpacked. It is enough to set binwalk again in the repacked image, by 40, in the unpacked 40 initramfs will be in the archive 30РЎ278, which is just a 7-zip archive :)
In general, everything is described very well here:https://habrahabr.ru/post/264843/

Post has been editedilya-fedin - 18.10.17, 21:42



Rep: (142)
* ilya-fedin all OK.
* chikengod Your
Attached filestatus.txt(20.26 KB)


Post has been editedA123l - 19.10.17, 12:03



Rep: (0)
Thank A123l and ilya-fedin. After installation I myself know that there luci is inside, but there was still a question for which answer packages kmod-usb-core, kmod-usb-dwc2, kmod-ledtrig-usbdev? My router with two radio modules, one of which is connected to the usb on the motherboard. But I doubt that this module works in the firmware, incidentally flashed lede 17.01.4. And why the mac addresses of all interfaces are identical, on the lan I changed, one of the wlan change is not necessary, it is specified, but the second is not the ipv6 wlan field to change the mac address. In general displayed radio-0 (2.4GHz) and radio-1 (5GHz), but setting radio-1 less than maximum power must be firmware in factory and in a manual.

Post has been editedchikengod - 19.10.17, 15:19



Rep: (0)
In general, the second radio module does not work, which is for usb, it is generally not in the settings. Can someone tell me, maybe it can be connected by creating a new interface?
Strange as that, assembly that for such router, and with adjustments a trouble both in lede and in openwrt (stitched by both).

P.S. I made a backup_art.bin made from the factory firmware and now I can not go to the router :))

Post has been editedchikengod - 19.10.17, 17:55



Rep: (25)
* chikengod where did you flash it?



Rep: (0)
Over openwrt from luci



Rep: (2234)
Chikengod @ 10/19/17, 15:49*
what are the kmod-usb-core, kmod-usb-dwc2, kmod-ledtrig-usbdev packages responsible for?

The first is, of course, USB support. The second is support for your USB2 controller. And the third is for the light bulb to respond to USB connections.



Rep: (25)
* chikengod .. He would not ask



Rep: (0)
Well, I poked at backup_fullflash, they went firmware, art and asked: sew? - well, I decided to look what happens. Start something flash, but no 192.168.1.1 any 192.168.10.1 (this plant) is not connected. While in the upper left corner of the luci appears for a while, but it's all garbage, programmer proshyut how to run a radio that connects usb? Who are these assemblies are constantly updated on the server and openwrt lede couple of days ago it was 17.01.3, and today we have patched up 17.01.4, or it will automatically patch? Someone there can ask a question?

Post has been editedchikengod - 19.10.17, 19:57



Rep: (25)
* chikengod , try to flash through tftp, well, after some kind of recovery



Rep: (573)
LEDE corrective update released 17.01.4https://lede-project.org/
git clone https://github.com/lede-project/source.git -b v17.01.4 Lede

Details can be read here.https: //www.opennet.ru…ws/art.shtml? num = 47415



Rep: (0)
Advise maybe you need to install some packages with usb, so that the usb radio module in the settings appears? For example, these packages are kmod-usb-rt305x-dwc_otg kmod-rt2500-usb kmod-rt2800-usb kmod-rt2x00-usb



Rep: (2234)
* chikengod
What chip does this radio module have?



Rep: (0)
ilya-fedin RT3572L 2x2 MIMO

After initramfs firmware appears wireless radio 0, and after sysupgrade firmware - 1 radio, radio is 0 3050f and 2.4GHz settings only, click enable, and can be seen on the status that the radio is trying to show the signal. In radio, you can select 1 2.4 / 5GHz and 2.4GHz choose if the result is like a radio 0, but if you choose to 5GHz, the status inactive. I'm on the radio module for usb needs to be a connected and 5GHz 24dbi power, and then only 20, as 3050f to be that radio 0. And another factory firmware WLAN LEDs are lit on the motherboard openwrt this LED does not light up when the radio 1 . usb LED, in which an external radio - lights. The result is the same that in the lede, that openwrt. Restore firmware bear on the roof of the usb antenna scan ether scans - so usb radio work, but then the question still remains why 5GHz is not working and that capacity.

Post has been editedchikengod - 20.10.17, 01:38



Rep: (0)
On the factory firmware, a bug or feature was found - with the chopped off wan on 3050f there is no connection to the usb radio module. Perhaps genes passed on to open source. But I connected both radio modules there and 5 GHz did not work.



Rep: (1)
Will I be able to roll up the settings on LEDE from the stock OpenWrt, if the LEDE is assembled with the same components as the stock OpenWrt?

Post has been editedmaliarr - 21.10.17, 11:19



Rep: (142)
View installed packages in the finished OpenWrt firmwarebefore firmwareher to the router .
Used method from userilya-fedin . MeAll actions were performed in Linux Mint 18.1 Serena x64
Instruction:
1. With the help of the program manager installSquashfs-tools and Binwalk
2. In the home folder, create a folder with an arbitrary name (I created with the name 11)
3. Download the required firmware xxxxxx-squashfs-factory.bin, for example, from herehttps: //downloads.open…/15.05/ar71xx/generic/and put it in folder 11
4. In the terminal we perform sequentially
cd 11
binwalk -e xxxxxx-squashfs-factory.bin

5. In folder 11, the folder _xxxxxxx-squashfs-factory.bin.extracted will be created, and in it along the path / squashfs-root / usr / lib / opkg / the file of intereststatus
6. Open it with a text editor and view the installed packages in the firmware.

Original method


Post has been editedA123l - 21.10.17, 15:57



Rep: (0)
About RT3572L chip connected to the main router for usb. On the 2.4GHz band channels running with no problems, but the 5GHz not start up on each channel without requiring a reboot. For example 5200 picks up at once, and if exposed to the channel 5300, then any remaining changes to the system leads to a non-working wifi, and that would start up to do a reboot, then it runs to first save the changes in the system. And another question with a power signal that lede 17.01, which is limited to a maximum of 15.05 openwrt the dbm 20, in the factory firmware up to 24 dbm. It depends on the packages on the assembly or where you need to make adjustments? But that is, more than 20 still not going to stand.

Post has been editedchikengod - 21.10.17, 20:28


Full version    

Help     rules

Time is now: 18/10/20, 4:06