Skip to content

Machine ID Support

Bastian Krause barebox 4 versions – Applied

Status from this message: Applied, thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 1 replyApplied
  2. v34 patches 2 repliesSuperseded
  3. v23 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches10 repliesSuperseded

Changes in v4 from the cover letter

- nvmem: ocotp: use existing OCOTP_UNIQUE_ID instead of introducing a new define
- convert imx_ocotp_set_unique_machine_id() to void as it's return is not used, simplify it

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/4digest.h: needs errno definitionsinclude/digest.h+1 -00 replies
2/4common: machine_id: introduce machine id generationcommon/Kconfig common/Makefile common/machine_id.c +1 more+104 -00 replies
3/4nvmem: ocotp: set unique id as machine-id hashabledrivers/nvmem/ocotp.c+19 -00 replies
4/4bootm: allow providing machine id to Kernelcommon/bootm.c include/bootm.h+24 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/4] Machine ID Support

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 system updates.

It is possible to pass a machine id to the kernel which will be used by systemd (systemd.machine_id=).

This series adds a way to provide device-specific hashable information to generate a unique, persistent id. The i.MX unique id from the OCOTP registers is added as hashable exemplarily. The id is available as global.machine_id in barebox. It can be overwritten with nv.machine_id if necessary.
The machine id is passed on to the Kernel by bootm based on global.bootm.provide_machine_id.

Changes since v3:
- nvmem: ocotp: use existing OCOTP_UNIQUE_ID instead of introducing a new define
- convert imx_ocotp_set_unique_machine_id() to void as it's return is not used, simplify it

Changes since v2:
- set id to global.machine_id in init call instead of preparing the bootarg already (so it's usable within barebox, too)
- move global.linux.bootargs.machine_id preparations to bootm code
- make global.linux.bootargs.machine_id preparations conditionally, based on bootm.provide_machine_id
- free machine id char pointer after globalvar_add_simple()
- make global.machine_id a magicvar
- make global.bootm.provide_machine_id a magicvar

Changes since (implicit) v1:
- depend on SHA1 instead of selecting DIGEST/DIGEST_SHA1_GENERIC
- add note about multiple sources providing hashables to kconfig
- add note about no hashable provided to kconfig
- remove warning about "no hashable info provided" along with pr_fmt
- make machine_id_set_hashable()'s hashable parameter const
- make a copy of the hashable provided rather than storing the pointer
- hash data instead of pointer address
- use basprintf() and dedicated variables for hex machine id/machine id bootarg
- add static inline wrapper if CONFIG_MACHINE_ID is disabled
- nvmem: ocotp: remove explicit address-of operator for unique_id_parts

Regards,
Bastian

Bastian Krause (3):
common: machine_id: introduce machine id generation
nvmem: ocotp: set unique id as machine-id hashable
bootm: allow providing machine id to Kernel

Juergen Borleis (1):
digest.h: needs errno definitions

 common/Kconfig        | 18 +++++++++++
 common/Makefile       |  1 +
 common/bootm.c        | 19 ++++++++++++
 common/machine_id.c   | 69 +++++++++++++++++++++++++++++++++++++++++++
 drivers/nvmem/ocotp.c | 19 ++++++++++++
 include/bootm.h       |  5 ++++
 include/digest.h      |  1 +
 include/machine_id.h  | 16 ++++++++++
 8 files changed, 148 insertions(+)
 create mode 100644 common/machine_id.c
 create mode 100644 include/machine_id.h
Signature · 7 lines
2.23.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox