Skip to content

Conversation

@learmj
Copy link
Collaborator

@learmj learmj commented Dec 1, 2025

Remove mutual exclusion for post-image hooks - it's not needed.
Plug in a simple post-image hook for the AB layout that packs a compressed archive of slot sparse images.

fyi @pelwell @clowder

While runner can support X|Y logic for hooks, since the generic
post-image hook creates the IDP JSON, we want both image specific
and generic post-image hooks to run.
Other hooks are not mutually exclusive, so remove the logic for
post-image since it serves no purpose.
set -eu

upd="${1}/update"
rm -rf "${1}/update"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason this shouldn't be rm -rf $upd?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No. It is now.

ln -sf ../boot.sparse ${upd}/boot

msg "Packing..."
tar -I zstd -h -cf ${1}/update.tar.zst -C $upd .
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks neater than the version I was using, but it has the unfortunate side effect of generating entries in the tar file beginning ./, which causes problems because the name doesn't match that of one of the A/B slots. Could you use this instead?

(cd $upd; tar -I zstd -h -cf  ${1}/update.tar.zst *)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure.

Copy link
Contributor

@pelwell pelwell left a comment

Choose a reason for hiding this comment

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

That works for me!

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