I would like to know what is the order followed by kbuild when configuring the kernel and what is the order that it's more convenient to use when writing CONFIG_ options in the .config file .

I have read the docs about kbuild but so far no specs on the order of the operations .


You should strive to not have order dependencies!

The system starts at the first line of the top level Kconfig file, and processes each line in turn. When it sees a 'source' line, it suspends reading the current file, processes the specified file. When it gets to the end of a file it resumes where it was in the previous file.

  • ok, but consider the 3 subfolders fs arch and init, there are configuration options related to them, should I write arch related options before fs ones ? after ? – user31223 Nov 12 '16 at 20:51
  • If the options are related to the file system put them in the fs, if they are architecture specific put them in arch, if they relate to the kernel starting put them in init. If they are driver specific put them in some some subdirectory of drivers. – icarus Nov 12 '16 at 21:11
  • Sorry, probably I wasn't explaining this in the best possible way, I was talking about the options in the .config file, the ones that usually start with CONFIG_ and what it's their optimal order . – user31223 Nov 12 '16 at 21:21
  • OK, so you are not adding new options to Kconfig files, you are just providing pre-selected answers for generating a new kernel. The order should not matter, put them in whatever order is simplest for you. the build system will read all of them before it starts processing the Kconfig files. – icarus Nov 12 '16 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.