summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/avirt-config.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/avirt-config.c b/src/avirt-config.c
index 5fb714f..db3965d 100644
--- a/src/avirt-config.c
+++ b/src/avirt-config.c
@@ -61,10 +61,16 @@ static bool card_sealed = false;
static int mount_configfs()
{
int err;
-
+ struct stat st = {0};
+ if (stat("/config", &st) == -1)
+ mkdir("/config", S_IRWXU | S_IRWXG | S_IRWXO);
+
err = mount("none", "/config", "configfs", 0, NULL);
if (!err)
+ {
+ AVIRT_DEBUG("Successfully mounted configfs");
configfs_mounted = true;
+ }
else
AVIRT_ERROR("Failed to mount configfs filesystem!");