Quickstart guide compiling OpenWrt

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.


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


@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.

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:

How about if we invite you? Thanks!

@richb-hanover: sure, go ahead.

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!

ok, thanks!

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.

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

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

@mwarning what is your username in the LEDE wiki?

@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.

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.

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:

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.

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

@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.

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.

NIce, thanks for contributing.

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: