meta-openembedded/meta-oe/classes
Bastian Krause 86f2dee014
image_types_verity.bbclass: remove breaking unit suffix from machine-readable verity parameters
Since cryptsetup 2.8.0 [1], "veritysetup format" prints " [bytes]"
suffixes for "Data block size" and "Hash block size" parameters:

  UUID:
  Hash type:              1
  Data blocks:            34655
  Data block size:        4096 [bytes]
  Hash blocks:            275
  Hash block size:        4096 [bytes]
  Hash algorithm:         sha256
  Salt:                   8a8d8d807bd9838a80397a13b3bc13c55780ff1677ee4489366b17dab1b29316
  Root hash:              bd85312151dc5c69efce943038e0ac4b92e14d8954cce5d3cc90513837f854bf

This output is directly converted to a shell sourcable form in
"${DEPLOY_DIR_IMAGE}/<IMAGE_LINK_NAME>.verity-params" used to
create the desired block device via "dmsetup" during runtime. The unit
suffix becomes part of the VERITY_DATA_BLOCK_SIZE and
VERITY_HASH_BLOCK_SIZE variables, breaking its consumers:

  /init: /verity-params: line 4: [bytes]: not found
  /init: /verity-params: line 6: [bytes]: not found
  verity root hash: bd85312151dc5c69efce943038e0ac4b92e14d8954cce5d3cc90513837f854bf
  [    3.323577] device-mapper: table: 253:0: verity: Invalid data device block size (-EINVAL)
  [    3.323595] device-mapper: ioctl: error adding target to table
  [    3.345301] /dev/dm-0: Can't lookup blockdev

Fix this by removing the unit suffixes from the values.

Ideally veritysetup should support machine-readable output, but that did
not spark joy on the maintainer's side [2] (at least in veritysetup
itself).

[1] commit f8788f34 ("Mark all sizes in status and dump output in the
correct units.")
[2] https://gitlab.com/cryptsetup/cryptsetup/-/issues/638

Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-09-02 08:57:41 -07:00
..
breakpad.bbclass Convert to new override syntax 2021-08-03 10:21:25 -07:00
capnproto.bbclass capnproto: remove binaries from target-build, add bbclass 2025-02-03 11:25:22 -08:00
check-version-mismatch.bbclass check-version-mismatch.bbclass: use oe.qemu and add QEMU_OPTIONS settings 2025-05-29 22:28:02 -07:00
discoverable-disk-image.bbclass classes: add discoverable disk image class 2025-06-25 06:44:54 -07:00
fitimage.bbclass meta-openembedded/all: adapt to UNPACKDIR changes 2025-06-25 06:44:52 -07:00
gitpkgv.bbclass gitpkgv.bbclass: inspect repository in UNPACKDIR 2025-08-18 07:50:01 -07:00
gitver.bbclass gitver: Pass git directory argument to gitrev_run 2019-06-15 17:17:09 -07:00
image_types_sparse.bbclass image_types_sparse: Fix syntax error 2023-08-01 10:26:51 -07:00
image_types_verity.bbclass image_types_verity.bbclass: remove breaking unit suffix from machine-readable verity parameters 2025-09-02 08:57:41 -07:00
itstool.bbclass Convert to new override syntax 2021-08-03 10:21:25 -07:00
machine_kernel_pr.bbclass remove True option to getVar calls 2016-12-02 09:16:17 +01:00
panel-mipi-dbi.bbclass panel-mipi-dbi.bbclass: initial addition of the firmware blob class 2024-11-01 06:43:16 -07:00
scancode.bbclass meta-oe: remove True option to getVar calls (again) 2019-01-13 10:28:01 -08:00
signing.bbclass signing.bbclass: create env with 0x600 2025-08-20 07:35:07 -07:00
socorro-syms.bbclass Convert to new override syntax 2021-08-03 10:21:25 -07:00
sysext-image.bbclass classes: add a systemd-sysext image class 2025-06-25 06:44:55 -07:00