From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=fuzziesquirrel.com (client-ip=173.167.31.197; helo=bajor.fuzziesquirrel.com; envelope-from=bradleyb@fuzziesquirrel.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=fuzziesquirrel.com Received: from bajor.fuzziesquirrel.com (mail.fuzziesquirrel.com [173.167.31.197]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 434qB34sbNzDr0C for ; Thu, 29 Nov 2018 05:36:42 +1100 (AEDT) X-Virus-Scanned: amavisd-new at fuzziesquirrel.com Received: from [192.168.253.30] (unknown [192.168.253.30]) by bajor.fuzziesquirrel.com (Postfix) with ESMTPSA id 1ADE36DC89; Wed, 28 Nov 2018 13:36:38 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: Re: Add TARGET_MACHINE to /etc/os-release From: Brad Bishop In-Reply-To: <966f717c-59a9-7f88-7b37-91edb9d72276@charter.net> Date: Wed, 28 Nov 2018 13:36:37 -0500 Cc: openbmc@lists.ozlabs.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <966f717c-59a9-7f88-7b37-91edb9d72276@charter.net> To: Joseph Reynolds X-Mailer: Apple Mail (2.3445.101.1) X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 18:36:44 -0000 Hi Joseph > On Nov 16, 2018, at 12:30 PM, Joseph Reynolds = wrote: >=20 >=20 > Proposal to add TARGET_MACHINE to /etc/os-release. >=20 > In an OpenBMC image, the /etc/os-release file includes distro = ("openbmc-phosphor") and version (as a git tag or commit). It should = also include the target machine (the kind of device the OpenBMC image is = intended to control). This is needed to be able to track the image back = to its source code: the distro and version indicate the exact source = code that was used, and the target says which Bitbake layer = configuration within that source was used. >=20 > Specifically, the proposal is to enhance the generated /etc/os-release = file with a new OS identification parameter like: > OPENBMC_PHOSPHOR_TARGET_MACHINE=3D"$MACHINE" > where MACHINE=3D"romulus", for example. >=20 > All OpenBMC images should define this os-release parameter. >=20 > Proposed documentation for the new parameter: Indicates the kind of = device the OpenBMC image is targeted to control. >=20 > ... tl;dr details follow ... snip ... >=20 > The MACHINE is set in = openbmc/meta-COMPANY/meta-MACHINE/conf/local.conf.sample. (This is = where TEMPLATECONF points to.) >=20 > Note MACHINE is not guaranteed to be unique across all future OpenBMC = layer configurations. (That is, meta-A/meta-B/conf and = meta-X/meta-Y/conf may inadvertently define the same machine name.) To = guarantee uniqueness, an alternate design would be to use the = TEMPLATECONF parameter as the machine name. (e.g., = "meta-ibm/meta-romulus/conf"). In practice I expect the machine name = will be sufficiently unique: as unique as different company's brand and = model names. >=20 > The manual page for "os-release" recommends prefixing the parameter = name with the distro name. Ideas for alternate parameter names are = welcome ("OBMC_TARGET_HARDWARE" anyone?). See = https://www.freedesktop.org/software/systemd/man/os-release.html. >=20 > The os-release file is generated by the os-release.bb and = os-release.bbappend recipes. Just FYI - MACHINE winds up in uname -a: root@palmetto:/var/lib/systemd# uname -a Linux palmetto 4.18.12-b29e57c654b8d7cfa15d632fbc0ebfe0897b8203 #1 Thu = Nov 15 21:52:09 UTC 2018 armv5tejl GNU/Linux Perhaps this meets your need without additional code? -brad=