I have downloaded the latest linux kernel and the Next tree, I want to run sparse on 'drivers/staging' tree, I tried enabling all the drivers via make menuconfig and then did

make C=1 M=drivers/staging

But the above command only builds some of the drivers, not all.

How do I enable more staging drivers to be built ?

  • Did you try make allyesconfig? – Stephen Kitt Jul 27 '17 at 9:17
  • Yes, does that include all of the modules ?.. I just tried it out though, but still the same behaviour – RishabhHardas Jul 27 '17 at 9:25

There is a special symbol in the Kconfig files called BROKEN. Code which doesn't work correctly at all (usually catastrophically fails) is marked in the Kconfig files with a dependency on this symbol, which is not defined anywhere by Kconfig itself, and therefore is not set by allyesconfig or any other automatic config targets. A reasonable percentage of the drivers in the staging tree fall into this category, and thus make allyesconfig will not include many of them. I'm not 100% certain, but I believe that you can manually add BROKEN=y at the end of the .config file in your build directory, then manually enable the Kconfig symbols either by adding them by hand in a similar manner to BROKEN, or through make menuconfig. You may also need to enable the COMPILE_TEST symbol, but that one has an entry in the menuconfig UI (it's in the first sub-menu, near the top), and even then there is a possibility that some of the drivers may be architecture dependent.

  • I tried adding BROKEN=y as well as setting the CONFIG_COMPILE_TEST flag. The I ran a make clean then again make C=1 M=drivers/staging... Still the same – RishabhHardas Jul 28 '17 at 7:07
  • Even after setting those explicitly, you'll still need to enable the individual drivers. Also, I forgot, the BROKEN symbol might be CONFIG_BROKEN instead, I'm not 100% sure. – Austin Hemmelgarn Jul 28 '17 at 11:15
  • Ok... But How are Individual Drivers Enabled ? via menuconfig ? – RishabhHardas Jul 28 '17 at 11:59
  • I checked for CONFIG_BROKEN, there is no flag by that name. – RishabhHardas Jul 28 '17 at 12:02
  • Also I wanted to know that, it is not necessary to compile the whole kernel for compiling these drivers right ? Sorry if I sound silly – RishabhHardas Jul 28 '17 at 12:08

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.