Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* first of a few questions about kbuild system
@ 2019-07-30 11:09 Robert P. J. Day
  0 siblings, 0 replies; only message in thread
From: Robert P. J. Day @ 2019-07-30 11:09 UTC (permalink / raw)
  To: Kernel Newbies


  friend who is getting into kernel programming wants to submit a few
patches just to get experience contributing to kernel, and i suggested
there's always potential cleanup in the numerous Kconfig files, but i
want to make *absolutely* sure i'm giving good advice so if i could
clarify a couple things (and, yes, they look trivial, but i've been
burned before thinking things are straightforward).

  first, the doc file kconfig-language.rst proposes the equivalence
between a single "if M" conditional versus individually depending on
the same Kconfig variable in each directive:

  In practice, this is achieved by using one of the next two constructs::

  (1):
  menuconfig M
  if M
      config C1
      config C2
  endif

  (2):
  menuconfig M
  config C1
      depends on M
  config C2
      depends on M

as an example, consider this from the current version of init/Kconfig:

  menuconfig MODULES
        bool "Enable loadable module support"
        option modules
        help

        ... snip ...

  if MODULES

  ...

  config MODULE_SIG
        bool "Module signature verification"
        depends on MODULES        <---

  ...

  config MODULE_COMPRESS
        bool "Compress modules on installation"
        depends on MODULES        <---

  ... etc etc ...

  endif # MODULES

it *should* be obvious that, between "if MODULES" and the
corresponding "endif", there should be no need for an explicit
dependency on "MODULES", correct? i ask since i have vague memories of
there being some subtleties if Kbuild symbols are tristate rather than
simply bool but, in this case, since MODULES is bool, any such
dependencies should be redundant, correct? am i overlooking any
possible complications?

  as an associated (and much longer) example, in that same
init/Kconfig file:

  menuconfig EXPERT
        bool "Configure standard kernel features (expert users)"
        # Unhide debug options, to make the on-by-default options visible
        select DEBUG_KERNEL
        ... snip ...

after which there are *numerous* config options whose prompt string is
qualified with conditional "if EXPERT":

  config UID16
        bool "Enable 16-bit UID system calls" if EXPERT

all the way down to:

  # end of the "standard kernel features (expert users)" menu

  # syscall, maps, verifier
  config BPF_SYSCALL

assuming that, in the midst of all those config directives, there is
not a single directive that does *not* in some way depend on EXPERT,
could that entire section not simply be wrapped in "if EXPERT" and
"endif" as well?

  i just want to verify that i'm not overlooking, perhaps, any changes
to the Kbuild infrastructure that i'm unaware of. thanks.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                         http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-30 11:09 first of a few questions about kbuild system Robert P. J. Day

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox