Quickstart guide compiling OpenWrt


#1

I seldom see a very quick way to compile your own images.
Here is one:

Install dependencies for building OpenWrt (Debian/Ubuntu):

sudo apt install subversion g++ zlib1g-dev build-essential git python time
sudo apt install libncurses5-dev gawk gettext unzip file libssl-dev wget

Get the source code:

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig

The last command will open a menu.

If you want to build images for the TL-WR841N v11, select:

"Target System" => "Atheros AR7xxx/AR9xxx"
"Subtarget" => "Devices with small flash"
"Target Profile" => "TP-LINK TL-WR841N/ND v11"

In the menu, select Exit and then Yes to save your settings.
Now build the images. That may take some time.

make

The images can now be found in bin/targets/ar71xx/generic/ - done. :slight_smile:

  • Speed up compilation with make -j4 to utilize four CPU cores.
  • For recompiling the images, just execute make again.
    This will now be much faster as well.
  • You can change settings with make menuconfig and compile again.
  • Files placed into a directory called files, will be placed into the root file system of the images. E.g. files/etc/config/my_config.

EDIT: remove subversion and use openwrt repository


Replace Dropbear with OpenSSH
Supporting ZSUN Wifi Card Reader (16MB Flash, 64MB RAM, AR9331)
[GCC 7.2 BUILD] Optimized TP-Link Archer C7 V2 AC1750 LEDE Firmware
#2

@mwarning - thanks for sending this in.

How is it different from the information that's already on the Developer Guide page at https://www.lede-project.org/docs/guide-developer/start?

And if you think that it offers new information that's not already there, please consider adding a page to the Developer Guide with this info.


#3

The information is in the wiki, but distributed and heavily annotated.
Some people might be discouraged because of that somewhat steep entry.

I will move it to the documentation section if nobody stops me. :stuck_out_tongue:


#4

How about if we invite you? Thanks!


#5

@richb-hanover: sure, go ahead.


#6

OK. You're invited!

Let me know if you have any questions about editing the Developer Guide main page and adding your new page. Thanks!


#7

ok, thanks!


#8

I seldom see a very quick way to compile your own images.
Here is one:

Install dependencies for building LEDE (Debian/Ubuntu):

sudo apt-get install subversion g++ zlib1g-dev build-essential git python
sudo apt-get install libncurses5-dev gawk gettext unzip file libssl-dev wget

Get the source code:

git clone https://git.lede-project.org/source.git
cd source

./scripts/feeds update -a
./scripts/feeds install -a

make defconfig

you should insert the alternative of grabbing the .config from an existing build
and running make oldconfig.


#9

@dlang: well; we need to keep it short and build on top of that.


#10

@richb-hanover: I do not seem to have the rights to edit the documentation


#11

@mwarning what is your username in the LEDE wiki?


#12

@tmomas: it is mwarning. It was created a few minutes ago. I thought it to be the same as the forum.

I added the entry. Everyone, feel free to improve it.


#13

This was very useful to me, and I realize that you want to keep it as short as possible. However, I think it would be very helpful for most users if it was added how to check out a specific release tag. It's only two lines that need to be added between the cd lede and the scripts:
git tag
to get a list of the tag names, and then
git checkout <tag name>

This will give a much more stable build.


#14

Hi Per,

this would be an improvement, but also would make the instructions more complex.
What about creating successive sites with more complex/annotated versions of the howto?
Some way so that we can keep a minimal howto and make it possible that people can deepen their knowledge and deal with more custom setups.

I'm not sure how this would look like, but I like to encourage you to keep a minimal version.
Aside from that, feel welcome to improve the site. :slight_smile:


#15

On the other hand, you could remove the warning about development branch which would shorten it by about the same amount of text. Another thing, make defconfig is redundant. make menuconfig will do it if it hasn't been done.


#16

ok that was a little too easy lol, like using android kitchen basically.


#17

@Per: fair point. :slight_smile:
How about this then:

  • use git clone -b v17.01.3
  • remove make defconfig

Feel free to change the site if you agree.
Imho, teaching about git tag is not necessary for compiling lede.
But maybe we can add that to the list notes below.


#18

I think I'll try go write a beginners step by step guide to building that will also include things like setting up a Virtualbox server for Windows users. I can include the extra git commands there, and then link to guides like yours where it's relevant.


#19

NIce, thanks for contributing.


#20

yeah @Per i noticed the same thing, so with the menuconfig after updating and installing feeds, then selecting a target, does it automatically configure kernel based modules and firmware for the specific target? if so, that with just packages would make things a bit more simplified, wish i could help!! then maybe place other options in developer menu, i understand its all WIP as they say in dd-wrt :slight_smile: