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.
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
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.
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
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
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
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
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