From 52fe2c6da7055e326870485b972a660788c7e943 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 6 Mar 2024 14:54:24 +0100 Subject: [PATCH] bib: mount `devtmpfs` inside the container too This ensures that the new `partscan` feature in osbuild works. By default the containers only have a static snapshot of /dev on a tmpfs. This means that anything later added by losetup will be missing inside the container. It also means that https://github.com/osbuild/osbuild/pull/1468 can be reverted. --- bib/internal/setup/setup.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bib/internal/setup/setup.go b/bib/internal/setup/setup.go index 944a64d0c..d3c9ec8d7 100644 --- a/bib/internal/setup/setup.go +++ b/bib/internal/setup/setup.go @@ -53,6 +53,14 @@ func EnsureEnvironment() error { if err := util.RunCmdSync("mount", "--bind", destPath, osbuildPath); err != nil { return err } + + // Ensure we have devfs inside the container to get dynamic loop + // loop devices inside the container. + devMnt := "/dev/" + if err := util.RunCmdSync("mount", "-t", "devtmpfs", "devtmpfs", devMnt); err != nil { + return err + } + return nil }