From owner-freebsd-arch@freebsd.org Fri Nov 8 06:23:41 2019 Return-Path: Delivered-To: freebsd-arch@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 0BF821A879F for ; Fri, 8 Nov 2019 06:23:41 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Vb00wxMz3wj8 for ; Fri, 8 Nov 2019 06:23:39 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id SxgDiwf9w17ZDSxgEi4rhF; Thu, 07 Nov 2019 23:23:37 -0700 X-Authority-Analysis: v=2.3 cv=ZsqT1OzG c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=MeAgGD-zjQ4A:10 a=9qa3YWOjAAAA:8 a=e5mUnYsNAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=jTdHeBC3IP_Sng2e4SAA:9 a=lc6Hvb3KbnopHPgo:21 a=7SpNMSnedhXlLx3j:21 a=CjuIK1q_8ugA:10 a=N6PBoGjP6LMA:10 a=2_lZy0vNFpoA:10 a=2Su-2_OBkbdmYqucsK2F:22 a=Vxmtnl_E_bksehYqCbjh:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 4CF9F1621; Thu, 7 Nov 2019 22:23:32 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id xA86NCob070011; Thu, 7 Nov 2019 22:23:12 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id xA86NCcO070007; Thu, 7 Nov 2019 22:23:12 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201911080623.xA86NCcO070007@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Warner Losh cc: "freebsd-arch@freebsd.org" Subject: Re: Creating /etc/os-release In-reply-to: References: Comments: In-reply-to Warner Losh message dated "Thu, 07 Nov 2019 11:10:38 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 07 Nov 2019 22:23:12 -0800 X-CMAE-Envelope: MS4wfM5VaKhtkAVT6NvM9tXav1170ZBba1543Hj3AFaMYorN7y4/TEHItXg+J2IETctQdwSNHLtqXIire4rJl04ucokbmgKhnpFDOcNH0IURng3+70MhedXc hnJgLMQ4bWavTWc1TWQ3VCFCzdbacze+gcPwtdUr66KvW4nJnPXCAZ+S03WmIU/+e7nWrxWNqTlx+hpSB7DH/epf4NsmfJ6SUUo= X-Rspamd-Queue-Id: 478Vb00wxMz3wj8 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.137) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-3.94 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; REPLYTO_EQ_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[137.136.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.24)[ip: (-5.78), ipnet: 64.59.128.0/20(-3.02), asn: 6327(-2.33), country: CA(-0.09)]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 06:23:41 -0000 In message , Warner Losh writes: > Greetings, > > A standard has evolved in other communities to communicate certain key > aspects of the system to interested parties. The /etc/os-release file. The > standard is defined here http://0pointer.de/blog/projects/os-release and > here https://www.freedesktop.org/software/systemd/man/os-release.html . It > has become a de-facto standard for the graphical systems. > > FreeBSD currently tries to address this with a port > sysutils/etc_os-release, but there's a number of issues with it, see for > example https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238953. The > biggest issue being that we can't install a static file: it has to change > as the system is updated. > > To that end, I propose the following: First, we create a /etc/os-release > symlink to /var/run/os-release. This will place the file in the standard > place, but allow its generation on each boot in a friendly to > read-only-root manner. Second, we create a /etc/rc.d/os-release script that > will populate /var/run/os-release. Since this is a standard rc script, we > can allow people to opt-out of generating this file in a standardized way > (although it contains information that's available to anybody on the > system, some reduced configurations may not have all the scripts / programs > used to generate it). If the file isn't generated, then opening it will > return the same not found error as before. Since this is a symlink, it's > friendly to etcupdate / mergemaster updating schemes. Finally, we'd > obsolete the port since it is flawed anyway. > > I opted for every boot rather than a file in /etc that gets generated as > part of mergemaster / etcupdate because it's more robust (the change > happens right away, and works in all environments, even if /etc isn't > updated). The amount of work here is tiny as well, so all but the most > demanding of users won't notice it at all. While this does come from the > Linux community, it has become a de-facto standard. DragonflyBSD has it, > for example, since 9c172c37, but their implementation is flawed for us to > use directly since it creates it at installworld time and we don't touch > /etc as part of installworld. We also have a port, but there's enough flaws > in the port approach that we should just make this be part of the base > system to place nicely with software that expects it today. It also means > we don't need hacks for freebsd-update. Finally, since this change is > additive, we can also MFC it to 12. > > I've created a change that I think covers all these aspects. Please see > https://reviews.freebsd.org/D22271 for the specifics. Comments about the > code should go there, while comments about the plan should go here. And, with pkgbase, assign it the actual release of the O/S so that we can do pkg info -aI | grep ... similar to rpm -aq | grep ... Why? Automation such as HP SA, Tower, cfengine, and others could be used to query package names in a mysql or Oracle database of packages. One could write an sql query to display all servers in a network with, for examle, package freebsd-12.1 (or whatever we choose to call it) installed. Of course this wouldn't work with -current or -stable unless installworld generates the appropriate package registrations at the time. Users of binary releases based on -RELEASE might see immediate benefit though. This might help integration into large shops -- making FreeBSD more visible to shops at the enterprise level -- which use that sort of automation. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.