Bug 213665 - [PATCH] make bin/freebsd-version not depend on binutils
Summary: [PATCH] make bin/freebsd-version not depend on binutils
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Dag-Erling Smørgrav
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-10-21 09:02 UTC by Pawel Worach
Modified: 2017-12-20 00:30 UTC (History)
2 users (show)

See Also:
des: mfc-stable11+
des: mfc-stable10+


Attachments
freebsd-version patch (867 bytes, patch)
2016-10-21 09:02 UTC, Pawel Worach
no flags Details | Diff
Proposed patch (3.20 KB, patch)
2016-10-25 14:33 UTC, Dag-Erling Smørgrav
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Worach 2016-10-21 09:02:07 UTC
Created attachment 176011 [details]
freebsd-version patch

This fixes "freebsd-version -k" on systems built with WITHOUT_BINUTILS, WITHOUT_TOOLCHAIN where strings(1) is not present. The patch makes freebsd-version use what(1) instead which is built unconditionally.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2016-10-21 20:49:46 UTC
This seems like a reasonable change.

I wonder if strings ought to be installed unconditionally though. From the SUBDIR.${MK_TOOLCHAIN} entries in usr.bin/Makefile these are obviously (to me) toolchain components that may not be desired on a target system:
 
addr2line
ar
c89
c99
ctags
cxxfilt
elfcopy
file2c
gprof
indent
lex
mkstr
nm
rpcgen
unifdef
xlint
xstr
yacc

whereas I think these are arguably sensible to install on the target:

readelf
size
strings
Comment 2 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2016-10-25 14:33:12 UTC
Created attachment 176144 [details]
Proposed patch

This patch incorporates Pawel's and adds an option to print the running kernel version, unaffected by UNAME_r.
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-11-04 17:03:11 UTC
A commit references this bug:

Author: des
Date: Fri Nov  4 17:02:42 UTC 2016
New revision: 308297
URL: https://svnweb.freebsd.org/changeset/base/308297

Log:
  Use what(1) instead of strings(1).  It's simpler and always available.

  PR:		213665
  Submitted by:	Pawel Worach <pawel.worach@gmail.com>
  MFC after:	1 week

Changes:
  head/bin/freebsd-version/freebsd-version.sh.in
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-12-10 20:21:31 UTC
A commit references this bug:

Author: des
Date: Sat Dec 10 20:20:33 UTC 2016
New revision: 309828
URL: https://svnweb.freebsd.org/changeset/base/309828

Log:
  MFH (r308297): use what(1) instead of strings(1).

  PR:		213665
  Submitted by:	Pawel Worach <pawel.worach@gmail.com>

Changes:
_U  stable/11/
  stable/11/bin/freebsd-version/freebsd-version.sh.in
Comment 5 commit-hook freebsd_committer freebsd_triage 2016-12-10 20:24:36 UTC
A commit references this bug:

Author: des
Date: Sat Dec 10 20:24:22 UTC 2016
New revision: 309830
URL: https://svnweb.freebsd.org/changeset/base/309830

Log:
  MFH (r308297): use what(1) instead of strings(1).

  PR:		213665
  Submitted by:	Pawel Worach <pawel.worach@gmail.com>

Changes:
_U  stable/10/
  stable/10/bin/freebsd-version/freebsd-version.sh.in
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-11-20 20:55:47 UTC
A commit references this bug:

Author: emaste
Date: Mon Nov 20 20:55:41 UTC 2017
New revision: 326030
URL: https://svnweb.freebsd.org/changeset/base/326030

Log:
  Install strings unconditionally

  Previously it was enabled by WITH_/WITHOUT_TOOLCHAIN, but it is commonly
  expected to be available and may have non-toolchain consumers.  As it
  is now taken from the BSD-licensed ELF Tool Chain project, just install
  it unconditionally.

  PR:		213665, 223725
  Reviewed by:	bdrewery
  MFC after:	1 month
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D8398

Changes:
  head/lib/Makefile
  head/usr.bin/Makefile
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-12-20 00:30:41 UTC
A commit references this bug:

Author: emaste
Date: Wed Dec 20 00:30:31 UTC 2017
New revision: 327010
URL: https://svnweb.freebsd.org/changeset/base/327010

Log:
  MFC r326030: Install strings unconditionally

  Previously it was enabled by WITH_/WITHOUT_TOOLCHAIN, but it is commonly
  expected to be available and may have non-toolchain consumers.  As it
  is now taken from the BSD-licensed ELF Tool Chain project, just install
  it unconditionally.

  PR:		213665, 223725
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/11/
  stable/11/lib/Makefile
  stable/11/usr.bin/Makefile