Bug 236139 - dyn_sysctl KLD example no longer compiles, patch included
Summary: dyn_sysctl KLD example no longer compiles, patch included
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 12.0-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Oleksandr Tymoshenko
URL:
Keywords: patch-ready
Depends on:
Blocks:
 
Reported: 2019-03-01 20:21 UTC by Andrew Reiter
Modified: 2019-03-23 23:44 UTC (History)
2 users (show)

See Also:


Attachments
patch to fix build of dyn_sysctl kld example (679 bytes, patch)
2019-03-01 20:21 UTC, Andrew Reiter
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Reiter 2019-03-01 20:21:14 UTC
Created attachment 202489 [details]
patch to fix build of dyn_sysctl kld example

The dyn_sysctl example KLD for showing use of sysctls via a kernel module seems to have been broken since 11.0 release. I have not been tracking, so I am not sure, exactly. It seems that the quick fix is to adjust the API use for adding a root node, I believe. I am attaching a patch for this.

It seems a similar bug is affecting the compilation of a port, but I cannot for the life remember which one it is right now.
Comment 1 Conrad Meyer freebsd_committer 2019-03-01 20:39:48 UTC
LGTM.  We ran into a similar issue migrating an out of tree 10ish module that added a sysctl root to 11ish, so I believe you are also correct about the timeframe.
Comment 2 Andrew Reiter 2019-03-15 14:47:36 UTC
Anything I can do to move this forward? I know it is a minor change, so mostly just curious how I can help.
Comment 3 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-03-16 04:24:40 UTC
Committed, thanks for submitting it. I'll take care of MFC to stable branches in a week.
Comment 4 commit-hook freebsd_committer 2019-03-16 04:24:53 UTC
A commit references this bug:

Author: gonzo
Date: Sat Mar 16 04:24:02 UTC 2019
New revision: 345220
URL: https://svnweb.freebsd.org/changeset/base/345220

Log:
  Fix build for KLD dyn_sysctl example

  Looks like the example was broken by change of SYSCTL_STATIC_CHILDREN
  definition in r267992. Fix build by switching to using SYSCTL_ADD_ROOT_NODE

  PR:		236139
  Submitted by:	Andrew Reiter <arr@watson.org>
  MFC after:	1 week

Changes:
  head/share/examples/kld/dyn_sysctl/dyn_sysctl.c
Comment 5 Andrew Reiter 2019-03-22 15:28:38 UTC
Thank you!
Comment 6 commit-hook freebsd_committer 2019-03-23 23:44:56 UTC
A commit references this bug:

Author: gonzo
Date: Sat Mar 23 23:44:40 UTC 2019
New revision: 345463
URL: https://svnweb.freebsd.org/changeset/base/345463

Log:
  MFC r345220:

  Fix build for KLD dyn_sysctl example

  Looks like the example was broken by change of SYSCTL_STATIC_CHILDREN
  definition in r267992. Fix build by switching to using SYSCTL_ADD_ROOT_NODE

  PR:		236139
  Submitted by:	Andrew Reiter <arr@watson.org>

Changes:
_U  stable/12/
  stable/12/share/examples/kld/dyn_sysctl/dyn_sysctl.c