Skip to content
Snippets Groups Projects
Commit d7ce8aa9 authored by Andrei Gherzan's avatar Andrei Gherzan :penguin:
Browse files

oniro-image.bbclass: Add rootfs function for cleaning up subid backup files

Podman requires subids configuration[1] but when creating them, shadow
does it using backup files. Clean them up too if available.

[1] https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md#etcsubuid-and-etcsubgid-configuration



Signed-off-by: Andrei Gherzan's avatarAndrei Gherzan <andrei.gherzan@huawei.com>
parent c9af7ceb
No related branches found
No related tags found
1 merge request!204Integrate podman in Oniro
...@@ -138,5 +138,17 @@ python deploy_boot_artifacts_to_rootfs() { ...@@ -138,5 +138,17 @@ python deploy_boot_artifacts_to_rootfs() {
os.path.join(rootfs_dir, dst_path)) os.path.join(rootfs_dir, dst_path))
run_cmd(install_cmd) run_cmd(install_cmd)
} }
ROOTFS_POSTPROCESS_COMMAND += "deploy_boot_artifacts_to_rootfs;" ROOTFS_POSTPROCESS_COMMAND += "deploy_boot_artifacts_to_rootfs;"
python () {
d.appendVar('ROOTFS_POSTPROCESS_COMMAND', ' clean_backup_files; ')
}
python clean_backup_files () {
# Cleanup other backup files generated by shadow-utils not covered by the
# sort_passwd existing rootfs postcommand.
# https://gitlab.eclipse.org/eclipse/oniro-core/oniro/-/issues/772
import rootfspostcommands
for file in ['subuid', 'subgid']:
filename = os.path.join(d.expand('${IMAGE_ROOTFS}${sysconfdir}'), file)
rootfspostcommands.remove_backup(filename)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment