diff options
| author | Erik Schilling <erik.schilling@linaro.org> | 2023-12-21 09:57:28 +0200 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2023-12-29 09:09:30 -0500 |
| commit | 57723ce65ebf4c8647fcf94e139c56cc4634913f (patch) | |
| tree | f58fd1d43fd14d0305764588327760886001dea3 | |
| parent | 3767ca82cf8134d454eb13bbde788d382161a2a1 (diff) | |
| download | meta-security-57723ce65ebf4c8647fcf94e139c56cc4634913f.tar.gz | |
dm-verity-img.bbclass: use bc-native
Build host may not have bc.
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
| -rw-r--r-- | classes/dm-verity-img.bbclass | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/classes/dm-verity-img.bbclass b/classes/dm-verity-img.bbclass index 045c860..3dd2b94 100644 --- a/classes/dm-verity-img.bbclass +++ b/classes/dm-verity-img.bbclass | |||
| @@ -49,6 +49,8 @@ DM_VERITY_SEPARATE_HASH ?= "0" | |||
| 49 | DM_VERITY_ROOT_GUID ?= "4f68bce3-e8cd-4db1-96e7-fbcaf984b709" | 49 | DM_VERITY_ROOT_GUID ?= "4f68bce3-e8cd-4db1-96e7-fbcaf984b709" |
| 50 | DM_VERITY_RHASH_GUID ?= "2c7357ed-ebd2-46d9-aec1-23d437ec2bf5" | 50 | DM_VERITY_RHASH_GUID ?= "2c7357ed-ebd2-46d9-aec1-23d437ec2bf5" |
| 51 | 51 | ||
| 52 | DEPENDS += "bc-native" | ||
| 53 | |||
| 52 | # Process the output from veritysetup and generate the corresponding .env | 54 | # Process the output from veritysetup and generate the corresponding .env |
| 53 | # file. The output from veritysetup is not very machine-friendly so we need to | 55 | # file. The output from veritysetup is not very machine-friendly so we need to |
| 54 | # convert it to some better format. Let's drop the first line (doesn't contain | 56 | # convert it to some better format. Let's drop the first line (doesn't contain |
| @@ -87,8 +89,8 @@ process_verity() { | |||
| 87 | # https://uapi-group.org/specifications/specs/discoverable_partitions_specification/ | 89 | # https://uapi-group.org/specifications/specs/discoverable_partitions_specification/ |
| 88 | 90 | ||
| 89 | ROOT_HASH=$(cat $ENV | grep ^ROOT_HASH | sed 's/ROOT_HASH=//' | tr a-f A-F) | 91 | ROOT_HASH=$(cat $ENV | grep ^ROOT_HASH | sed 's/ROOT_HASH=//' | tr a-f A-F) |
| 90 | ROOT_HI=$(echo "obase=16;ibase=16;$ROOT_HASH/2^80" | /usr/bin/bc) | 92 | ROOT_HI=$(echo "obase=16;ibase=16;$ROOT_HASH/2^80" | bc) |
| 91 | ROOT_LO=$(echo "obase=16;ibase=16;$ROOT_HASH%2^80" | /usr/bin/bc) | 93 | ROOT_LO=$(echo "obase=16;ibase=16;$ROOT_HASH%2^80" | bc) |
| 92 | 94 | ||
| 93 | # Hyphenate as per UUID spec and as expected by wic+sgdisk parameters. | 95 | # Hyphenate as per UUID spec and as expected by wic+sgdisk parameters. |
| 94 | # Prefix with leading zeros, in case hash chunks weren't using highest bits | 96 | # Prefix with leading zeros, in case hash chunks weren't using highest bits |
