Skip to content

eMMC Update Handler Refactoring #1752

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ejoerns
Copy link
Member

@ejoerns ejoerns commented Jul 4, 2025

Next to fixing a minor bug and improving manual testing of eMMC boot partition handling, this removes some unnecessary code duplication and prepares for a broader use of the eMMC update handling.

ejoerns added 2 commits July 1, 2025 15:05
And remove the unused part_active_str variable.

Fixes: fa87117 ("src/update_handler: update boot partition reporting")
Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
This avoids some code duplication.

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
Copy link

codecov bot commented Jul 4, 2025

Codecov Report

Attention: Patch coverage is 77.08333% with 11 lines in your changes missing coverage. Please review.

Project coverage is 84.52%. Comparing base (e6b6152) to head (980d062).

Files with missing lines Patch % Lines
src/update_handler.c 77.08% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1752      +/-   ##
==========================================
+ Coverage   84.51%   84.52%   +0.01%     
==========================================
  Files          76       76              
  Lines       22384    22375       -9     
==========================================
- Hits        18917    18913       -4     
+ Misses       3467     3462       -5     
Flag Coverage Δ
service=false 81.02% <77.08%> (+0.01%) ⬆️
service=true 84.48% <77.08%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ejoerns added 5 commits July 4, 2025 11:27
Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
In img_to_boot_emmc_handler(), instead of creating the dummy
'part_slot', we temporarily set the 'device' of the original slot to the
eMMC boot partition device.

This is a preparation for the follow up refactoring commit.

The main purpose is to allow using the same slot for the hooks as we use
for the actual copying.

To keep the hook env consistent, manually override the RAUC_SLOT_DEVICE
with the original eMMC base device.

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
The scope of this method is to update an eMMC boot partition
with the necessary force_ro disabling and re-enabling.

This allows to encapsulate the force_ro error path handling and provides
a method that can be used for emmc updates that don't require a boot
partition switch.

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
Since we don't need the goto label anymore, we can use immediate returns
now.

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
This adds a bootloader slot to the system.conf in case eMMC support is
available. This allows to interactively test eMMC handling.

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
@ejoerns ejoerns force-pushed the update-handler-emmc branch from e44c924 to 980d062 Compare July 4, 2025 09:27
@zentax-dev zentax-dev self-requested a review July 4, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants