This implements the binding extension introduced to barebox here:
https://lore.barebox.org/barebox/20230531145927.1399282-1-a.fat...@pengutronix.de/T/#t

With this, barebox,state backend can optionally point at a device
instead of a partition. If this device is GPT-partitioned and has
a partition with a specific partition type GUID of

  4778ed65-bf42-45fa-9c5b-287a1dc4aab1

It will be taken.

This series also fixes an annoying issue of barebox-state triggering
udev on every access, because the root block device corresponding
to the device tree node was opened r/w.

barebox-state will now open the disk read-only if possible and if
a partition exists that fits the barebox state location, it will
be opened instead.

Ahmad Fatoum (8):
  state: backend: direct: open block device in read-only mode if
    possible
  libdt: factor out u64 sysattr parsing into helper
  libdt: drop broken if-branch
  libdt: factor out __of_cdev_find helper
  libdt: use block device partition instead of parent if found
  state: align with barebox use of of_cdev_find
  libdt: use of_find_device_by_uuid for partuuid lookup
  state: allow lookup of barebox state partition by Type GUID

 src/barebox-state/backend_bucket_direct.c |   5 +-
 src/barebox-state/backend_storage.c       |   2 +-
 src/barebox-state/state.c                 |  58 +++-
 src/barebox-state/state.h                 |   3 +-
 src/dt/common.h                           |   8 +
 src/dt/dt.h                               |   8 +
 src/libdt-utils.sym                       |   5 +
 src/libdt.c                               | 341 ++++++++++++++++++----
 src/linux/uuid.h                          |  24 ++
 src/state.h                               |   4 +
 10 files changed, 380 insertions(+), 78 deletions(-)
 create mode 100644 src/linux/uuid.h

-- 
2.39.2


Reply via email to