From owner-freebsd-hackers@freebsd.org Wed Aug 21 20:06:49 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2014D2AC1 for ; Wed, 21 Aug 2019 20:06:49 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46DJbD5YrPz4Sxc; Wed, 21 Aug 2019 20:06:48 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x7LK6kSu055365; Wed, 21 Aug 2019 13:06:46 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x7LK6kIK055364; Wed, 21 Aug 2019 13:06:46 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201908212006.x7LK6kIK055364@gndrsh.dnsmgr.net> Subject: Re: uname -a default options In-Reply-To: <67A10C58-7A1A-4E8E-A567-6A2AD3E195B1@gmail.com> To: Gordon Bergling Date: Wed, 21 Aug 2019 13:06:46 -0700 (PDT) CC: "Rodney W. Grimes" , freebsd-hackers@freebsd.org, Ian Lepore X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46DJbD5YrPz4Sxc X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.84 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.23)[0.233,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.59)[0.594,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.07)[0.067,0]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.04)[ip: (0.15), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.05), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2019 20:06:49 -0000 > Hi Rod, > > after reading the POSIX spec [1] I agree that the default options behind ?-a" can not be changed. > > While reading the source of usr.bin/uname/uname.c I recognized that FreeBSD?s uname is getting its information from sysctl calls. Can you point me to right direction where in sys/ the sysctl ?kern.version? (KERN_VERSION internally) is set? > > I would like create a small patch that changes ?-v? > from "FreeBSD 12.0-STABLE r351343 GENERIC? > to ?r351343 GENERIC? for a further discussion. > > Kind Regards, > > Gordon /usr/src/sys/conf/newvers.sh Is the source of that data... > [1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/uname.html > > > Am 17.08.2019 um 18:16 schrieb Rodney W. Grimes : > > > >> On Sat, 2019-08-17 at 15:08 +0200, Gordon Bergling wrote: > >>> Hello List, > >>> > >>> "uname -a" is currently mapping the -a option to ?-mnrsv?, which > >>> results in something similar like > >>> > >>> $ uname -a > >>> FreeBSD lion.0xfce3.net 12.0-STABLE FreeBSD > >>> 12.0-STABLE r350835 GENERIC amd64 > >>> > >>> What would you think about reducing the option mapping for ?-a? to ?- > >>> vmn? , which would result in a less repetitive version string like > >>> the one below. > >>> > >>> $ uname -vmn > >>> lion.0xfce3.net FreeBSD 12.0-STABLE r350835 > >>> GENERIC amd64 > >>> > >>> Adapting this would be trivial, but before I hack something together, > >>> I would like to get some feedback if such a change would be welcomed? > >>> > >>> Best regards, > >>> > >>> Gordon > >>> > >> > >> I think there are likely very many existing scripts in the world that > >> parse the output of uname -a and would break if the fields moved around > >> or disappeared. > > > > I agree that we should not change the output of uname -a, for one > > it is a POSIX spec'ed command, though I would not expect scripts > > to be parsing the output of -a, they should actually invoke the > > more specific item(s) they need and parse those, a much less error > > prone methods. > > > > I would however like to note that Linux (or atleast Ubuntu 19.04) > > has a man page that -a says "All of the below" and are infact returning > > more info than the Posix man page which says -a is -mnrsv > > > > rgrimes@mgmt:~$ uname -a > > Linux mgmt 5.1.0-rc2+ #14 SMP Sun Aug 4 09:23:12 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux > > rgrimes@mgmt:~$ man uname > > rgrimes@mgmt:~$ uname -mnrsv > > Linux mgmt 5.1.0-rc2+ #14 SMP Sun Aug 4 09:23:12 UTC 2019 x86_64 > > rgrimes@mgmt:~$ uname -m > > x86_64 > > rgrimes@mgmt:~$ uname -n > > mgmt > > rgrimes@mgmt:~$ uname -r > > 5.1.0-rc2+ > > rgrimes@mgmt:~$ uname -s > > Linux > > rgrimes@mgmt:~$ uname -v > > #14 SMP Sun Aug 4 09:23:12 UTC 2019 > > > > FreeBSD: > > root {1003}# uname -a > > FreeBSD w530a.dnsmgr.net 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC amd64 > > root {1004}# uname -m > > amd64 > > root {1005}# uname -n > > w530a.dnsmgr.net > > root {1006}# uname -r > > 12.0-RELEASE > > root {1007}# uname -s > > FreeBSD > > root {1008}# uname -v > > FreeBSD 12.0-RELEASE r341666 GENERIC > > > > So it is really our -v string that is full of redundant > > data that MAY want to be evaluated for trimming. > > > > -- > > Rod Grimes rgrimes@freebsd.org > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > -- Rod Grimes rgrimes@freebsd.org