Bug 238558

Summary: Correctly use BASEDIR when checking for src component in freebsd-update
Product: Base System Reporter: Waqar Ahmed <waqarahmedjoyia>
Component: miscAssignee: Michael Gmelin <grembo>
Status: Closed FIXED    
Severity: Affects Many People CC: freebsd-bugs, grembo
Priority: --- Keywords: patch
Version: CURRENTFlags: grembo: mfc-stable12+
grembo: mfc-stable11+
Hardware: Any   
OS: Any   

Description Waqar Ahmed 2019-06-14 06:31:15 UTC
When updating base system to the latest patch level using "freebsd-update", we encounter an error with it not correctly performing source checks as outlined by this PR I did - https://github.com/freebsd/freebsd/pull/404. This ticket is for reference so this can be tracked in freebsd's official bug tracker.
Comment 1 Christoph Kliemann 2019-07-14 15:06:41 UTC
Might I add that config_Components is never called.
COMPONENTS is initialised when config_Components is sourced.

Is this intended?

Additionally config_Components should check the "kernel" component.
That way users could update jails without a custom freebsd-update.conf (or warnings regarding missing kernel directories).
Let me know if I should open a separate feature request for this.
Comment 2 Christoph Kliemann 2019-07-14 15:11:54 UTC
Found the function call, please disregard.
Comment 3 Waqar Ahmed 2019-07-14 17:02:47 UTC
Hello Christoph, can you please confirm if you still require something from my end ?
Also when can i expect this to be reviewed ?
Thank you!
Comment 4 Christoph Kliemann 2019-07-14 19:15:23 UTC
Sorry, I'm not a FreeBSD developer.

Here is a list of current FreeBSD developers:
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/contributors/staff-committers.html

It may take some time.
Keep in mind that the git repository is a readonly mirror.
Providing your patch as an attachment created with svn diff or diff as described in the documentation might help.

See 4.3. Attaching Patches or Files:
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/problem-reports/pr-writing.html#pr-writing-attaching-patches

There are limited resources and this might not be a high priority issue.
Potential workaround: 
You could use a custom freebsd-update.conf and remove src from the Components line until this is resolved.

More information on the FreeBSD problem report process:
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/problem-reports/

More information on how FreeBSD problem reports are handled:
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/pr-guidelines/article.html

All that said: I have the same issue. Thats why I wrote a comment. :)
Comment 5 commit-hook freebsd_committer freebsd_triage 2019-09-22 19:54:01 UTC
A commit references this bug:

Author: grembo
Date: Sun Sep 22 19:53:29 UTC 2019
New revision: 352608
URL: https://svnweb.freebsd.org/changeset/base/352608

Log:
  MFC r352542: freebsd-update: Fix src component detection

  PR:	224048, 238558, 239997
  Reviewed by:    emaste
  Differential Revision:  https://reviews.freebsd.org/D21579

Changes:
_U  stable/12/
  stable/12/usr.sbin/freebsd-update/freebsd-update.sh
Comment 6 commit-hook freebsd_committer freebsd_triage 2019-09-22 20:04:04 UTC
A commit references this bug:

Author: grembo
Date: Sun Sep 22 20:03:26 UTC 2019
New revision: 352610
URL: https://svnweb.freebsd.org/changeset/base/352610

Log:
  MFC r352542: freebsd-update: Fix src component detection

  PR:		224048, 238558, 23999
  Reviewed by:	emaste
  Differential Revision:	https://reviews.freebsd.org/D21579

Changes:
_U  stable/11/
  stable/11/usr.sbin/freebsd-update/freebsd-update.sh
Comment 7 commit-hook freebsd_committer freebsd_triage 2019-09-23 15:59:26 UTC
A commit references this bug:

Author: grembo
Date: Mon Sep 23 15:58:55 UTC 2019
New revision: 352628
URL: https://svnweb.freebsd.org/changeset/base/352628

Log:
  MF stable/12 r352608

  Approved by:	re (gjb)

  r352608:
  freebsd-update: Fix src component detection

  In case BASEDIR was set to a directory that differed from the default
  filesystem root, freebsd-update wrongly checked for the existence
  of /usr/src/COPYRIGHT to determine if the src component was
  installed. Existing code to address this wasn't effective due to the
  order in which configuration options were evaluated.

  PR:		224048, 238558, 239997
  Reviewed by:	emaste
  Differential Revision:	https://reviews.freebsd.org/D21579

Changes:
_U  releng/12.1/
  releng/12.1/usr.sbin/freebsd-update/freebsd-update.sh