Re: [PATCH 2/3] common: machine_id: introduce machine id generation and pass id on

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 17, 2019 at 04:02:45PM +0200, Bastian Krause wrote:
> 
> 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?

I don't think there's going to be a race for priorities. But anyway, I
think we can introduce priorities when we really have a need for them.
Just introducing them because we might need them some day seems like
unnecessary overhead to me.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux