-
Notifications
You must be signed in to change notification settings - Fork 77
Add AB post-image #133
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
base: master
Are you sure you want to change the base?
Add AB post-image #133
Conversation
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.
image/gpt/ab_userdata/post-image.sh
Outdated
| set -eu | ||
|
|
||
| upd="${1}/update" | ||
| rm -rf "${1}/update" |
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.
Is there any reason this shouldn't be rm -rf $upd?
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.
No. It is now.
image/gpt/ab_userdata/post-image.sh
Outdated
| ln -sf ../boot.sparse ${upd}/boot | ||
|
|
||
| msg "Packing..." | ||
| tar -I zstd -h -cf ${1}/update.tar.zst -C $upd . |
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.
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 *)
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.
Sure.
pelwell
left a comment
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.
That works for me!
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