From e9d02a27bb2128c559ddd32c332d0beab67e75cd Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 15 Feb 2022 11:23:48 +0100 Subject: [PATCH] skopeo stage: remove overlay/backingFsBlockDev file after install Each time the overlay backend runs on an xfs fs it creates the file "overlay/backingFsBlockDev" in the containers storage directory. It is not needed in the image as skopeo recreates it each boot, and since it is a block device its existance means we can't store the resulting tree in ostree. Lets just get rid of it. --- stages/org.osbuild.skopeo | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stages/org.osbuild.skopeo b/stages/org.osbuild.skopeo index 87357261..462726a6 100755 --- a/stages/org.osbuild.skopeo +++ b/stages/org.osbuild.skopeo @@ -98,6 +98,16 @@ def main(inputs, output, options): subprocess.run(["skopeo", "copy", source, dest], check=True) + if storage_driver == "overlay": + # Each time the overlay backend runs on an xfs fs it creates this file: + backing_fs_block_dev = os.path.join(output, storage_root.lstrip("/"), "overlay/backingFsBlockDev") + # It is not needed in the image as skopeo recreates it each + # boot, and since it is a block device its existance means we + # can't store the resulting tree in ostree. + # Lets just get rid of it. + if os.path.exists(backing_fs_block_dev): + os.unlink(backing_fs_block_dev) + return 0