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

base: lmp: sota_var_cleanup: use the ostree_rmdir_helper #1148

Merged
merged 1 commit into from
May 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions meta-lmp-base/classes/lmp.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ sota_var_cleanup() {
if ${@bb.utils.contains('IMAGE_FSTYPES', 'ota-ext4', 'true', 'false', d)}; then
# Remove /var stuff (ignored by ostree)
cd ${IMAGE_ROOTFS}/var
rmdir -v backups spool local lib/misc
rmdir -v volatile ${@'' if oe.types.boolean('${VOLATILE_LOG_DIR}') else 'log'}
ostree_rmdir_helper backups
ostree_rmdir_helper spool
ostree_rmdir_helper local
ostree_rmdir_helper lib/misc
ostree_rmdir_helper volatile
ostree_rmdir_helper ${@'' if oe.types.boolean('${VOLATILE_LOG_DIR}') else 'log'}
Copy link
Member

Choose a reason for hiding this comment

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

This will call helper with empty inputs when VOLATILE_LOG_DIR is not set, we should probably have an if here instead to avoid surprises later on.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have tested it explicit call one only with just ostree_rmdir_helper and it works with an empty arg, because it check if the arg is a directory and not a link before removing and when the arg is empty the functions does nothing.

# symlinks
rm -v run lock tmp ${@'log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}
cd -
Expand Down