-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tee-supplicant: Allow to control RPMB emulation during runtime #354
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall.
The comment in the Makefile should preferably be adjusted because the meaning of RPMB_EMU changes slightlty (from "use RPMB emulation" to "support RPMB emulation and use it when --rpmb-emu
is given). The wording in CMakeLists.txt
is fine though.
-# Emulate RPMB ioctl's by default
+# Support RPMB emulation by default (--rpmb-emu command line argument)
RPMB_EMU ?= 1
@@ -890,7 +887,13 @@ static uint32_t rpmb_data_req(int fd, struct rpmb_data_frame *req_frm, | |||
goto out; | |||
} | |||
|
|||
st = IOCTL(fd, MMC_IOC_MULTI_CMD, mcmd); | |||
if (use_rpmb_emu()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it is very helpful to modify all the call sites to test for emu enabled. In this particular case we could define a ioctl
wrapper for example do_ioctl()
which would call either ioctl()
or ioctl_emu()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have multiple call sites for those, that's why I left the if-else there and didn't add another level of wrappers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I see what you mean. Please disregard my comment then.
This permits to build with RPMB_EMU=1 without breaking real usage. Specifically helpful for distros. Signed-off-by: Jan Kiszka <[email protected]>
abe6ab9
to
c5cc1f6
Compare
Please add something about the new --rpmb-emu command line option in the commit message. |
This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time. |
Continued by #355 |
This permits to build with RPMB_EMU=1 without breaking real usage. Specifically helpful for distros. Closes #353.
Still testing, thus "draft".