Conversation
Store firecracker images and the storage blob to /usr/share/firecracker instead of /var/lib/firecracker. This serves the needs for SUSE's immutable mode and is also more consistent with other flake files e.g /usr/share/flakes. This Fixes jira#1054
3cf17e6 to
87ee356
Compare
@rjschwei Thanks, I added a %post. Can you please have a very close look to the %post coding :) I tend to make stupid mistakes with spec file scrips and I very much appreciate if you can double check it. Thanks |
package/flake-pilot.spec
Outdated
| %post -n flake-pilot-firecracker | ||
| if [ "$YAST_IS_RUNNING" != "instsys" ] && [ -d /var/lib/firecracker ];then | ||
| rsync -za /var/lib/firecracker/ /usr/share/firecracker/ | ||
| rm -rf /var/lib/firecracker |
There was a problem hiding this comment.
I think this might trigger an RPM error on package upgrade. RPM will try to remove any files that are not part of the new package on it's own. Since the new package no longer owns /var/lib/firecracker RPM will try to remove this directory, but it will already be gone due to the %post action. I am not sure if RPM ignores that error or complains.
There was a problem hiding this comment.
it's worse. I talked to some rpm experts. Here is the answer
you need to keep the old directory in the filelist or rpm will delete it on transaction which breaks your post script
I added a commit to address this situation
@rjschwei now the question is, if I have to keep the old location as a %dir in order to allow the move, does that break the idea of SUSE's immutable system concept ?
Thanks
There was a problem hiding this comment.
Sorry, when I reviewed this I completely lost track of the context as to why these changes are being made, my bad. There should actually not be any moving. On a transactional-update system /usr is immutable, meaning with the current code if a user actually wants to add a firecracker image that operation would fail. The location where the images are store has to remain the same, i.e. /var/lib/firecracker.
What you need to do is create flake-pilot.conf file which contains
d /var/lib/firecracker
d /var/lib/firecracker/images
d /var/lib/firecracker/storage
and then in the spec file own those directories as %ghost.
Sorry for not picking up on this on the first review.
8d158b9 to
267f2aa
Compare
Store firecracker images and the storage blob to
/usr/share/firecracker instead of /var/lib/firecracker. This serves the needs for SUSE's immutable mode and is also more consistent with other flake files e.g /usr/share/flakes. This Fixes jira#1054