Skip to content

base: move var clean up from base-files to lmp.bbclass#1125

Merged
ricardosalveti merged 2 commits intofoundriesio:mainfrom
ricardosalveti:main
Apr 26, 2023
Merged

base: move var clean up from base-files to lmp.bbclass#1125
ricardosalveti merged 2 commits intofoundriesio:mainfrom
ricardosalveti:main

Conversation

@ricardosalveti
Copy link
Copy Markdown
Member

Var directories, created by base-files, are also used by the rootfs task while performing the image bootstrap process (via packages), so they can't be removed at the base-files package level.

Move the removal logic to lmp.bbclass via ROOTFS_POSTPROCESS_COMMAND task, which is executed only when ota-ext4 is set in IMAGE_FSTYPES (only way to know when an ostree image is to be created), after all required rootfs packages are installed. Only dirs that can't be removed at this stage are /var/lib and /var/cache as they are used to store packaging related metadata.

This folder is created at runtime via systemd tmpfiles.d.

Signed-off-by: Ricardo Salveti <[email protected]>
Var directories, created by base-files, are also used by the rootfs task
while performing the image bootstrap process (via packages), so they
can't be removed at the base-files package level.

Move the removal logic to lmp.bbclass via ROOTFS_POSTPROCESS_COMMAND
task, which is executed only when ota-ext4 is set in IMAGE_FSTYPES (only
way to know when an ostree image is to be created), after all required
rootfs packages are installed. Only dirs that can't be removed at this
stage are /var/lib and /var/cache as they are used to store packaging
related metadata.

Signed-off-by: Ricardo Salveti <[email protected]>
Copy link
Copy Markdown
Member

@quaresmajose quaresmajose left a comment

Choose a reason for hiding this comment

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

LGTM

@ricardosalveti ricardosalveti merged commit 930481c into foundriesio:main Apr 26, 2023
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.

3 participants