Updating LEDE Source/Recompiling

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!

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

https://lede-project.org/docs/guide-developer/start

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

  • 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

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?

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.

1 Like

Perfect, thanks again for your help.

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

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

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

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.