Page MenuHomeFreeBSD

config: Only warn if duplicate option/device comes from the same file
ClosedPublic

Authored by manu on Mar 1 2019, 5:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 12 2024, 2:46 AM
Unknown Object (File)
Oct 4 2024, 4:37 PM
Unknown Object (File)
Oct 2 2024, 10:04 AM
Unknown Object (File)
Oct 2 2024, 7:51 AM
Unknown Object (File)
Sep 27 2024, 5:37 PM
Unknown Object (File)
Sep 23 2024, 4:35 AM
Unknown Object (File)
Sep 22 2024, 7:46 PM
Unknown Object (File)
Sep 19 2024, 2:19 AM
Subscribers

Details

Summary

This is useful for arm (possibly other arches too) where we want to have
a GENERIC kernel that only include files for the different SoC. Since
multiple SoCs/Board needs the same device we would need to do either :

  1. Include the device in a generic file
  2. Include the device in each file that really needs it

Option 1 works but if someone wants to create a specific kernel config
(which isn't uncommon for embedded system), he will need to add a lots
of nodevice to it.

Option 2 also works but produce a lots of warnings.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

usr.sbin/config/config.h
129

s/device/options/
Will correct that

usr.sbin/config/config.y
390

Maybe add a "first included in blah" message ?

usr.sbin/config/config.y
390

Hmm? This doesn't seem to make sense to me; you're only emitting a warning if it's duplicated within the same file to lower the noise if we duplicate across files. Adding a 'first included in blah' message seems counterproductive at a glance.

usr.sbin/config/config.y
390

Yeah, sorry.

"WARNING: duplicate device `%s' encountered. in <filename>\n" is what we want.

usr.sbin/config/config.y
390

I agree, mentioning which file contained duplicate entries here and in the options case below would be useful, then I think this will be ready to commit.

usr.sbin/config/config.y
390

So the consensus is to say where things were duplicated and not suppress it?

usr.sbin/config/config.y
390

When it is duplicated within the same file, mention the file. If the duplicate entries come from separate files, be quiet about it.

manu marked 2 inline comments as done.
This revision is now accepted and ready to land.Apr 8 2019, 4:10 PM
This revision was automatically updated to reflect the committed changes.