8000 Add support for directories in bundles by jkehne · Pull Request #1625 · rauc/rauc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for directories in bundles #1625

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 2 commits into
base: master
Choose a base branch
from

Conversation

jkehne
8000 Copy link
@jkehne jkehne commented Feb 11, 2025

The FAQ says to contact you if someone uses subdirectories or symlinks. Unfortunately, we do: We have put some additional files into the bundle which are read by the target device before applying the update. We put those in the bundle because we wanted them to be signed along with the update, and we put them in a directory because it made deployment simpler on our side. At the time we did this, we were using Yocto Langdale/rauc 1.9 because our hardware vendor's BSP was not compatible with anything newer, so we did not know this was going to be problematic. Now, we have already shipped devices which expect the subdirectory to be present and will not accept bundles without a subdirectory.
I ran into the problem when I updated our build to Yocto Scarthgap/rauc 1.12. To fix this for the time being, I created the proposed patch which re-adds directory support. The patch recursively mirrors any directories found in the content directory to the work directory -- including permissions, but not including owner/group information as these are set to root:root anyway by mksquashfs -- and hardlinks any files found in those directories to the appropriate subdirectory in the workdir.
We have been using this patch in our internal development version (rauc 1.12 on real hardware) for a few weeks now, without problems. I have also built this branch for our target, and it worked fine; both 1.12 and the build from this branch accept the bundles created by the patched version. I have also tested a few additional cases like deeper directory structures and no subdirectories, all of which worked as well.
We do not use symlinks or special files, so the patch does not touch the code handling those.

Copy link
codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 72.22222% with 10 lines in your changes missing coverage. Please review.

Project coverage is 84.49%. Comparing base (a86560c) to head (447be62).

Files with missing lines Patch % Lines
src/bundle.c 72.22% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1625      +/-   ##
==========================================
- Coverage   84.50%   84.49%   -0.02%     
==========================================
  Files          76       76              
  Lines       22381    22397      +16     
==========================================
+ Hits        18913    18924      +11     
- Misses       3468     3473       +5     
Flag Coverage Δ
service=false 80.99% <72.22%> (-0.01%) ⬇️
service=true 84.44% <72.22%> (-0.02%) ⬇️

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.

@jluebbe
Copy link
Member
jluebbe commented Apr 2, 2025

One reason for this check was also to reserve directory names for use internally by RAUC. For example, it creates a .rauc-cfs-store/ when converting to composefs artifacts.

Would you be fine with only allowing non-hidden directories (i.e. ones that don't begin with .)? That way, we can still extend RAUC with less chances of conflicting directory names.

@jluebbe jluebbe added this to the Release v1.15 milestone Apr 2, 2025
@jkehne
Copy link
Author
jkehne commented Apr 2, 2025

Excellent idea! Yes, that would work for us. We don't use anything hidden in our bundles.

@jkehne
Copy link
Author
jkehne commented Apr 3, 2025

I added an additional check that throws an error if a directory starting with . is found. Let me know what you think.

@jluebbe jluebbe force-pushed the directory-support branch from 09df1a9 to b9de93b Compare May 28, 2025 10:27
@jluebbe
Copy link
Member
jluebbe commented May 28, 2025

I've force pushed to rebase on master and change the check to only reject top-level hidden subdirs. Would this work for you?

8000

@jluebbe jluebbe force-pushed the directory-support branch from b9de93b to cb7251f Compare May 28, 2025 10:33
@jkehne
Copy link
Author
jkehne commented May 28, 2025

Sure, that works. Thanks you!

jkehne and others added 2 commits May 28, 2025 15:06
In some cases, it's useful to store additional files in the bundle which
are not used directly by RAUC. To keep things organized, it can be
useful to place them in subdirectories.

As RAUC may need to store it's own data in subdirectories (e.g.
'.rauc-cfs-store' for composefs objects), hidden directories stay
reserved for internal use.

Signed-off-by: Jens Kehne <jens.kehne@agilent.com>
Co-developed-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
@jluebbe jluebbe force-pushed the directory-support branch from cb7251f to 447be62 Compare May 28, 2025 13:10
@jluebbe
Copy link
Member
jluebbe commented May 28, 2025

I've squashed our commits and updated the commit message:
61ec013

Could you try this version and confirm if it that it works for you?

@jluebbe jluebbe requested a review from ejoerns May 28, 2025 13:11
@jkehne
Copy link
Author
jkehne commented Jun 2, 2025

I just tried the latest version, and everything looks good to me:

  • All the files we need are there
  • I tried installing updates between different versions (new -> old, old -> new, new -> new) and they all worked.

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
0