Another few basic questions about the development process

Just suppose the openwrt is the release/stable/lts(long term support) branch, openwrt-18.06.

  1. Linux Kernel. I see there're two linux kernel versions which are 4.9 and 4.14 in the commit introductions, does this mean I could select 4.9 or 4.14 kernel in the menuconfig? If it is, where could I find the option in the menuconfig?

  2. Version Update. As we know, the branch will be updated or will get the new commits every day or every few days in its supported life cycle. If I want to update the local previous version which is the same main branch and downloaded in the local disks before to the latest version, how should I do? Just run the "git checkout openwrt-18.06" command again in the existing openwrt folder is OK? Does it will rebuild all the files if run the "make" command again? If it rebuilds all the files, will it delete the useless files, keep the useful system files and user's files, and download all the other necessary dependencies automatically in case to save the building time? And, is it necessary to update the version very frequently?

  3. Building. This's complex topic for me. At present, I only know about the process of building for the first time. For the first time, all of the dependencies will be downloaded from the git repository, then they will be built into the image. But, how is the following rebuild process if I don't modify any source files or menuconfig and just run "make" command again? If I modify a few source files or modify the menuconfig's configuration, how is the rebuild process? How could I do if I want to reduce the rebuild compiling time?

  4. Download. For the developers, they usually needs to download all the source files at the first building as far as possible, then they could continue to develop their project even if the computer can't connect the internet. How to config the menuconfig? Is there a detailed guide for the developers/beginners?

  5. About 802.11s, do you have a detailed guide for the developers?

Many thanks,
Yongsheng

No. Kernel versions to use are hardcoded per target, see the various KERNEL_PATCHVER assignments in the target/linux/*/Makefile files.

I've read the question multiple times but fail to understand what you're asking. In any case switching branches within a dirty buildroot (one that was compiled at least once already) works but can lead to strange issues, better use separate build envs for different branches.

Subsequent make invocations will still iterate over all targets but skip configure and compilation phases where possible. While this will be substantially faster compared to the initial full build, it can still take 1-2 minutes on IO constrained systems. To speed up the workflow even further, you can use specific make targets, e.g. make package/foo/{clean,compile} V=s to just rebuild package foo or make target/linux/install V=s to refresh kernel image and repack images.

I'm also not sure what you're asking here. You can force the download of the sources of all (enabled) packages by invoking make download. You can invoke menuconfig by running make menuconfig. The defaults are usually okay to get started and contain all essential packages plus a few optional ones like ppp or opkg.

The OpenWrt 802.11s implementation is the same as the official Linux mac80211 stack, so the same development principles apply.

Thank you, Jow.

About Q2 and Q4, here's a further explanation below.
Q2.
It is not about switching branches but about switching commits for a same main branch like openwrt-18.06.
For example, the current source files of openwrt-18.06 were downloaded yesterday, but there're new commits for openwrt-18.06 today. In this case, should I create a new folder and download the new commit separately like a new main branch or just could I update the old commit version to the new one directly? As we know, for the same main branch, the new commit only fixes the bugs without any new features added.
Q4.
In default status, many options are disabled in the menuconfig, in this case many related source files or dependencies will not be downloaded in the first initial full build, right? In the subsequent development, if I need to enable these options which are disabled in the first initial full build, these source files will be downloaded at this time, right? If the computer is off-line, it will fail. Right?

Thanks.

The normal workflow would be something like this:

git pull         # fetch latest branch head
make defconfig   # if any new options got introduced, fill them with defaults
make             # rebuild things that need rebuilding

Correct.

Correct.

Correct. You could consider mirroring http://sources.openwrt.org/ using rsync (rsync://downloads.openwrt.org/sources/)

Got it. Thanks.

git pull         # fetch latest branch head
make defconfig   # if any new options got introduced, fill them with defaults
make             # rebuild things that need rebuilding

@jow I'm a bit confused about the difference between "git pull" and "./scripts/feeds update -a" / "./scripts/feeds install -a". Each time after typing in "git pull", it will fetch some new information about the branch, then type in "./scripts/feeds update -a", it could also fetch some new feeds for this branch. Could you tell me what the difference between them is?

What I usually do for upgrading the local existing branch is shown below, is it recommended?

git pull                         # fetch latest branch head
./scripts/feeds update -a        # obtain all the latest package definitions
                                 # defined in feeds.conf / feeds.conf.default
./scripts/feeds install -a       # install symlinks for all obtained packages into package/feeds/
make defconfig                   # if any new options got introduced, fill them with defaults
make menuconfig                  # config options.
make                             # rebuild things that need rebuilding

Thanks.