mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Bastian Krause <bst@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH 2/3] common: machine_id: introduce machine id generation and pass id on
Date: Wed, 17 Jul 2019 16:02:45 +0200	[thread overview]
Message-ID: <91ce3e31-4c30-4021-78bd-5c8e3f6fffc1@pengutronix.de> (raw)
In-Reply-To: <25663bf3-7e13-20ed-5686-07bf5d353f59@pengutronix.de>


On 7/17/19 12:31 PM, Ahmad Fatoum wrote:
> 
> 
> On 17/7/19 12:02, Roland Hieber wrote:
>> On Tue, Jul 16, 2019 at 12:58:36PM +0200, Bastian Krause wrote:
>>> By default systemd generates a machine id on first boot and tries to
>>> persist it (see `man machine-id`). When the root file system is read-only
>>> systemd cannot persist the machine id. In case multiple redundant slots
>>> are used the machine id will vary. When not handled explicitly the
>>> machine id will also change during updates.
>>>
>>> It is possible to pass a machine id to the kernel which will be used by
>>> systemd (systemd.machine_id=).
>>>
>>> This adds functionality to pass device-specific information that will be
>>> hashed to generate a persistent unique machine id. The machine id will
>>> be finally added to the kernel parameters via the
>>> linux.bootargs.machine_id global variable.
>>>
>>> Note: if multiple sources provide hashable device-specific information
>>> (via machine_id_set_hashable()) the information provided by the last call
>>> prior to the late initcall set_machine_id() is used to generate the
>>> machine id from. Thus when updating barebox the machine id might change.
>>
>> I would also add this paragraph to the kconfig help text, so it is more
>> visible for users.
> 
> Maybe add a priority parameter like we do with e.g. reset reason?
> That way we can have a base machine-id in the OTP, but board code can
> override it with e.g. an EEPROM value which is given higher priority.

Hm, that makes things complicated. At the end everybody will have their
own high priority call like..

  machine_id_set_hashable(my_board_specific_info, len, 99);

.. to have a machine id that persists such an update scenario? That does
not sound too good to me..

Any opinions on this?

Bastian

-- 
Pengutronix e.K.
Industrial Linux Solutions
http://www.pengutronix.de/
Peiner Str. 6-8, 31137 Hildesheim, Germany
Amtsgericht Hildesheim, HRA 2686

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2019-07-17 14:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-16 10:58 [PATCH 1/3] digest.h: needs errno definitions Bastian Krause
2019-07-16 10:58 ` [PATCH 2/3] common: machine_id: introduce machine id generation and pass id on Bastian Krause
2019-07-17  9:48   ` Sascha Hauer
2019-07-17  9:58     ` Bastian Krause
2019-07-17 10:31       ` Sascha Hauer
2019-07-17 10:34         ` Bastian Krause
2019-07-17  9:53   ` Ahmad Fatoum
2019-07-17 10:02   ` Roland Hieber
2019-07-17 10:31     ` Ahmad Fatoum
2019-07-17 14:02       ` Bastian Krause [this message]
2019-07-17 14:18         ` Sascha Hauer
2019-07-16 10:58 ` [PATCH 3/3] nvmem: ocotp: set unique id as machine-id hashable Bastian Krause
2019-07-17  9:50   ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91ce3e31-4c30-4021-78bd-5c8e3f6fffc1@pengutronix.de \
    --to=bst@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox