From: "Erik Schilling" <erik.schilling@linaro.org>
To: "Mikko Rapeli" <mikko.rapeli@linaro.org>, <yocto@lists.yoctoproject.org>
Subject: Re: [meta-security][PATCH 2/4] dm-verity-img.bbclass: use bc-native
Date: Thu, 21 Dec 2023 09:37:34 +0100 [thread overview]
Message-ID: <CXTVIYYUNZXF.3RFTUGF77AC9Q@ablu-work> (raw)
In-Reply-To: <20231221075730.201111-2-mikko.rapeli@linaro.org>
On Thu Dec 21, 2023 at 8:57 AM CET, Mikko Rapeli wrote:
> From: Erik Schilling <erik.schilling@linaro.org>
>
> Build host may not have bc.
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
> ---
> classes/dm-verity-img.bbclass | 6 ++++--
> 1 file 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"
> DM_VERITY_ROOT_GUID ?= "4f68bce3-e8cd-4db1-96e7-fbcaf984b709"
> DM_VERITY_RHASH_GUID ?= "2c7357ed-ebd2-46d9-aec1-23d437ec2bf5"
>
> +DEPENDS += "bc-native"
> +
> # Process the output from veritysetup and generate the corresponding .env
> # file. The output from veritysetup is not very machine-friendly so we need to
> # convert it to some better format. Let's drop the first line (doesn't contain
> @@ -87,8 +89,8 @@ process_verity() {
> # https://uapi-group.org/specifications/specs/discoverable_partitions_specification/
>
> ROOT_HASH=$(cat $ENV | grep ^ROOT_HASH | sed 's/ROOT_HASH=//' | tr a-f A-F)
> - ROOT_HI=$(echo "obase=16;ibase=16;$ROOT_HASH/2^80" | /usr/bin/bc)
> - ROOT_LO=$(echo "obase=16;ibase=16;$ROOT_HASH%2^80" | /usr/bin/bc)
> + ROOT_HI=$(echo "obase=16;ibase=16;$ROOT_HASH/2^80" | bc)
> + ROOT_LO=$(echo "obase=16;ibase=16;$ROOT_HASH%2^80" | bc)
>
> # Hyphenate as per UUID spec and as expected by wic+sgdisk parameters.
> # Prefix with leading zeros, in case hash chunks weren't using highest bits
next prev parent reply other threads:[~2023-12-21 8:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-21 7:57 [meta-security][PATCH 1/4] tpm2-tss: support native builds Mikko Rapeli
2023-12-21 7:57 ` [meta-security][PATCH 2/4] dm-verity-img.bbclass: use bc-native Mikko Rapeli
2023-12-21 8:37 ` Erik Schilling [this message]
2023-12-21 7:57 ` [meta-security][PATCH 3/4] dm-verity-img.bbclass: remove IMAGE_NAME_SUFFIX Mikko Rapeli
2023-12-21 8:37 ` Erik Schilling
2023-12-21 7:57 ` [meta-security][PATCH 4/4] dm-verity-img.bbclass: add DM_VERITY_DEPLOY_DIR Mikko Rapeli
2023-12-21 8:39 ` Erik Schilling
2023-12-21 8:39 ` [meta-security][PATCH 1/4] tpm2-tss: support native builds Erik Schilling
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CXTVIYYUNZXF.3RFTUGF77AC9Q@ablu-work \
--to=erik.schilling@linaro.org \
--cc=mikko.rapeli@linaro.org \
--cc=yocto@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.