Skip to content
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

Support SquashFS compressed bundles on poky #747

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

om26er
Copy link
Contributor

@om26er om26er commented Jun 29, 2021

Adds support for LZO and ZSTD based rootfs bundles. This add support for both casync bundles and the "normal".

This PR also fixes a bug *.squashfs.caibx case as it doesn't work with ubivol

@om26er om26er force-pushed the support-squashfs-compression branch from 4c988b1 to c05a52f Compare June 29, 2021 11:05
@om26er
Copy link
Contributor Author

om26er commented Jun 29, 2021

For info, those rootfs image names come from http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/image_types.bbclass#n106

@ejoerns
Copy link
Member

ejoerns commented Jun 29, 2021

@om26er Thanks for your PR

Yes, this is not really necessary to support compressed bundles, it would only be necessary to support compressed bundles generated by the Yocto image.bbclass naming convention (as you just noted while I was writing 😏 ). However, it might make sense to support these as Yocto is kind of a 'standard'. The commit message should reflect this probably.
Maybe it is also more generic to make a glob match for *.squashfs* instead of listing each individually?

About your note on ubivol not being supported: Please have a look at: 2b6917a Did you check that? It is probably not that obvious in the code as it should be..

@codecov
Copy link

codecov bot commented Jun 29, 2021

Codecov Report

Merging #747 (a571725) into master (45a26c8) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #747   +/-   ##
=======================================
  Coverage   72.57%   72.57%           
=======================================
  Files          28       28           
  Lines        8937     8941    +4     
=======================================
+ Hits         6486     6489    +3     
- Misses       2451     2452    +1     
Impacted Files Coverage Δ
src/update_handler.c 55.48% <ø> (ø)
src/install.c 83.00% <0.00%> (-0.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed1fd63...a571725. Read the comment docs.

@jluebbe
Copy link
Member

jluebbe commented Jun 29, 2021

As there is no relevant difference between these images from rauc's perspective, it seems easier to solve this on the Yocto side instead of adding more and more extensions to rauc.

@om26er om26er force-pushed the support-squashfs-compression branch from c05a52f to 44df5cd Compare June 29, 2021 19:11
@om26er
Copy link
Contributor Author

om26er commented Jun 29, 2021

@ejoerns I have now updated the PR to use globbing, I think that makes sense as there are multiple support compression formats. Also updated the commit message

@om26er om26er changed the title Support SquashFS compressed bundles Support SquashFS compressed bundles on poky Jun 29, 2021
@ejoerns
Copy link
Member

ejoerns commented Jun 30, 2021

As there is no relevant difference between these images from rauc's perspective, it seems easier to solve this on the Yocto side instead of adding more and more extensions to rauc.

From my point of view (even if I don't have a super-strong opinion on this), it would be an acceptable trade-off to add a simple glob and be able to support the default image names generated by yocto. The alternative would be to have a workaround for each Yocto BSP generating compressed squashfs names. Or what do you mean by solving this on Yocto side?

However, if that should be acceptable, the commit message would still need to be extended.

@om26er
Copy link
Contributor Author

om26er commented Jul 1, 2021

However, if that should be acceptable, the commit message would still need to be extended.

Can you suggest a "good" commit message, please ;-)

@ejoerns
Copy link
Member

ejoerns commented Aug 20, 2021

something like

src/update_handler: support oe-core's default SquashFS image suffixes

The Yocto/OE 'image_types' class generates SquashFS images with different file name suffixes, depending on the compression selected (e.g. .squashfs-xz, .squashfs-lzo).
With our current image pattern, this would require an extra renaming step (to .squashfs) to allow RAUC to properly recognize the image as a SquashFS.

With the minimal invasive change of extending the glob to also match the squashfs-<compression> naming scheme, one could use the images directly.

As Yocto/OE is probably one of the most common build ecosystems RAUC is currently used with, this appears to be an acceptable compromise.

@jluebbe you may want to choose if you would follow this argumentation or not ;)

@jluebbe jluebbe force-pushed the support-squashfs-compression branch 2 times, most recently from 302574a to cfe63a7 Compare January 26, 2022 16:13
@jluebbe
Copy link
Member

jluebbe commented Jan 26, 2022

I've changed the commit message based on what @ejoerns suggested.

Instead of the *.squashfs* pattern I've added explicit matches for the currently existing image IMAGE_CMDs in Yocto/OE:
https://github.com/rauc/rauc/compare/44df5cda933b3cc947d4d3b88a1258c343e48b64..302574a64276ed383a842125be963e73f5f5ebbd

@jluebbe jluebbe requested a review from ejoerns January 26, 2022 16:15
@jluebbe jluebbe added the enhancement Adds new functionality or enhanced handling to RAUC label Jan 26, 2022
@jluebbe jluebbe added this to the Release v1.6 milestone Jan 26, 2022
The Yocto/OE 'image_types' class generates SquashFS images with different file
name suffixes, depending on the compression selected (e.g. .squashfs-xz,
.squashfs-lzo, ...). With our current image pattern, this would require an
extra renaming step (to .squashfs) to allow RAUC to properly recognize the
image as a SquashFS.

To avoid matching images by mistake (which contain .squashfs somewhere else in
the filename), use an explicit list.

As Yocto/OE is probably one of the most common build ecosystems RAUC is
currently used with, this appears to be an acceptable compromise.

Signed-off-by: Omer Akram <omer@thing.com>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
@jluebbe jluebbe force-pushed the support-squashfs-compression branch from cfe63a7 to a571725 Compare January 27, 2022 11:11
@jluebbe
Copy link
Member

jluebbe commented Jan 27, 2022

I've re-added the -zst extension which i lost during my previous rework.

Copy link
Member

@ejoerns ejoerns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine for me.

However, for similar future cases, having a mapping in meta-rauc might still be a more future-proof approach.

@ejoerns ejoerns merged commit 969874b into rauc:master Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adds new functionality or enhanced handling to RAUC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants