# Updating LEDE Source/Recompiling

**URL:** <https://forum.openwrt.org/t/updating-lede-source-recompiling/9646>\
**Category:** For Developers\
**Created:** [December 13, 2017, 5:26pm UTC](https://forum.openwrt.org/t/updating-lede-source-recompiling/9646 "2017-12-13T17:26:13Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![algebro](https://forum.openwrt.org/letter_avatar/algebro/32/5_5575768a8748004e209b776fc1b2916d.png) [@algebro](https://forum.openwrt.org/u/algebro)\
**Post date:** [December 13, 2017, 5:26pm UTC](https://forum.openwrt.org/t/updating-lede-source-recompiling/9646/1 "2017-12-13T17:26:13Z")

</div>

Hey all,

I had a couple of newbie questions about the process of building LEDE from source and updating it. First, is it necessary to run `scripts/feeds install -a` each time you do a git pull to update the packages? Or is it sufficient to run `scripts/feeds/update -a` and then proceed to the configuration steps?

Second, I'm a bit confused about the various `make *config` options. I've been seeing mixed guidance on the process to follow when updating your source and compiling the firmware. What should the process be after a `git pull`? Currently, I'm doing `git pull && make oldconfig` and my custom-selected packages seem to be there. Guides mention diffconfig.sh, appending it to .config, running make menuconfig and makedefconfig, etc, but I'm not sure what the difference is compared to what I'm already doing.

Is there any danger if I mess up the config and then flash it, such as a bricked device due to missing modules or something? I've compared my manifest/config.seed files and they seem to contain all the same packages as my currently installed build, so I think I'm fine on that front.

Finally, I'm seeing two branches in the source tree, master and lede-17.01. Am I correct in assuming 17.01 is the stable branch and master is the latest snapshot/dev branch?

Thanks!

---

<div class="post-metadata">

**Author:** ![anon57995562](https://forum.openwrt.org/letter_avatar/anon57995562/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon57995562](https://forum.openwrt.org/u/anon57995562)\
**Post date:** [December 13, 2017, 9:28pm UTC](https://forum.openwrt.org/t/updating-lede-source-recompiling/9646/2 "2017-12-13T21:28:30Z")

</div>

Good place to start on doing your own builds is the LEDE documentation...

[https://lede-project.org/docs/guide-developer/start](https://lede-project.org/docs/guide-developer/start)

---

<div class="post-metadata">

**Author:** ![algebro](https://forum.openwrt.org/letter_avatar/algebro/32/5_5575768a8748004e209b776fc1b2916d.png) [@algebro](https://forum.openwrt.org/u/algebro)\
**Post date:** [December 13, 2017, 9:29pm UTC](https://forum.openwrt.org/t/updating-lede-source-recompiling/9646/3 "2017-12-13T21:29:44Z")

</div>

Thanks, I've read this, and it's a good high level overview but it doesn't answer my questions specifically. [https://lede-project.org/docs/guide-developer/use-buildsystem](https://lede-project.org/docs/guide-developer/use-buildsystem) for example doesn't discuss make oldconfig, or if there is a danger of bricking the device by misconfiguring the build. It's a little vague about whether you need to run `feeds install -a` on each git pull but I'm assuming the answer is no.

---

<div class="post-metadata">

**Author:** ![anomeome](https://forum.openwrt.org/user_avatar/forum.openwrt.org/anomeome/32/15002_2.png) [@anomeome](https://forum.openwrt.org/u/anomeome)\
**Post date:** [December 13, 2017, 9:37pm UTC](https://forum.openwrt.org/t/updating-lede-source-recompiling/9646/4 "2017-12-13T21:37:46Z")

</div>

- No, you can just update feeds, unless there is a new feed that you want
- As a cleanup / restart you can generate a diffconfig file, copy that file over top of your .config, and do a make defconfig;make oldconfig, leave out the oldconfig if you want
- Set aside your diffconfig files as you add / delete/ change builds, recall later if needed
- Yes, you can use whichever you need for your use-case

---

<div class="post-metadata">

**Author:** ![algebro](https://forum.openwrt.org/letter_avatar/algebro/32/5_5575768a8748004e209b776fc1b2916d.png) [@algebro](https://forum.openwrt.org/u/algebro)\
**Post date:** [December 13, 2017, 9:55pm UTC](https://forum.openwrt.org/t/updating-lede-source-recompiling/9646/5 "2017-12-13T21:55:04Z")

</div>

Thanks a lot @anomeome, I think I understand. So basically everytime I do a `git pull` + rebuild, I'd go through the process like this:

1. git pull
2. cat ../custom\_config \>\>.config
3. make defconfig && make oldconfig
4. make -j7

And I would only need to generate a new diffconfig if I want to alter the build by changing installed packages, correct? Or should I do this any time `make oldconfig` prompts me to set new options?

---

<div class="post-metadata">

**Author:** ![anomeome](https://forum.openwrt.org/user_avatar/forum.openwrt.org/anomeome/32/15002_2.png) [@anomeome](https://forum.openwrt.org/u/anomeome)\
**Post date:** [December 13, 2017, 10:15pm UTC](https://forum.openwrt.org/t/updating-lede-source-recompiling/9646/6 "2017-12-13T22:15:06Z")

</div>

Copy, not append/cat, something like:

```
#!/bin/sh
#
#CDBU=$(date +"%F_%H%M%S")
#BAK="../abu/$CDBU"
#cp .config "$BAK"
# or set aside the configdiff after it is generated, whatever
#make clean (dir/dist)
# i tend to the following rather than the previous, YMMV
# rm -rf bin build_dir tmp
#git pull
#./scripts/feeds update -a
#./scripts/feeds install -a
#./scripts/diffconfig.sh > configdiff
#cp configdiff .config
#make defconfig;make oldconfig

```

make a script and remove comment on the bits that work for you.

---

<div class="post-metadata">

**Author:** ![algebro](https://forum.openwrt.org/letter_avatar/algebro/32/5_5575768a8748004e209b776fc1b2916d.png) [@algebro](https://forum.openwrt.org/u/algebro)\
**Post date:** [December 14, 2017, 12:13am UTC](https://forum.openwrt.org/t/updating-lede-source-recompiling/9646/7 "2017-12-14T00:13:02Z")

</div>

Perfect, thanks again for your help.

---

<div class="post-metadata">

**Author:** ![linbox](https://forum.openwrt.org/user_avatar/forum.openwrt.org/linbox/32/28730_2.png) [@linbox](https://forum.openwrt.org/u/linbox)\
**Post date:** [April 16, 2018, 4:54pm UTC](https://forum.openwrt.org/t/updating-lede-source-recompiling/9646/8 "2018-04-16T16:54:09Z")

</div>

**This is awesome information and should be part of the documentation!!!**

```
"anomeome, post:6, topic:9646"]
#!/bin/sh
#
#CDBU=$(date +"%F_%H%M%S")
#BAK="../abu/$CDBU"
#cp .config "$BAK"
# or set aside the config diff after it is generated, whatever
#make clean (dir/dist)
# i tend to the following rather than the previous, YMMV
# rm -rf bin build_dir tmp
#git pull
#./scripts/feeds update -a
#./scripts/feeds install -a
#./scripts/diffconfig.sh &gt; configdiff
#cp configdiff .config
#make defconfig;make oldconfig

```

I have not added to the docs yet. Can anybody help howto, or just add it to the development docs?

Probably to this page  
[https://openwrt.org/docs/guide-developer/quickstart-build-images](https://openwrt.org/docs/guide-developer/quickstart-build-images)

---

<div class="post-metadata">

**Author:** ![jeff](https://forum.openwrt.org/letter_avatar/jeff/32/5_5575768a8748004e209b776fc1b2916d.png) [@jeff](https://forum.openwrt.org/u/jeff)\
**Post date:** [April 16, 2018, 7:58pm UTC](https://forum.openwrt.org/t/updating-lede-source-recompiling/9646/9 "2018-04-16T19:58:53Z")

</div>

As you read the docs, look at the "env" feature, which captures `.config` as well as `files/` in a separate git repo.

---

<div class="post-metadata">

**Author:** ![linbox](https://forum.openwrt.org/user_avatar/forum.openwrt.org/linbox/32/28730_2.png) [@linbox](https://forum.openwrt.org/u/linbox)\
**Post date:** [April 17, 2018, 12:19am UTC](https://forum.openwrt.org/t/updating-lede-source-recompiling/9646/10 "2018-04-17T00:19:05Z")

</div>

That is not my point.

My point is more about a quick summary on what is a good/best way to update the local trunk, which I think is not clearly documented.

But thanks for the heads up

---

<div class="post-metadata">

**Author:** ![mk24](https://forum.openwrt.org/letter_avatar/mk24/32/5_5575768a8748004e209b776fc1b2916d.png) [@mk24](https://forum.openwrt.org/u/mk24)\
**Post date:** [April 17, 2018, 2:23am UTC](https://forum.openwrt.org/t/updating-lede-source-recompiling/9646/11 "2018-04-17T02:23:57Z")

</div>

You only need to update and install the feeds to pick up new packages that may have been added. If an existing package version has been bumped up, the makefile (updated with git pull) will automatically download and compile the new source.
