]> git.ipfire.org Git - pakfire.git/commitdiff
Revert "pakfire: Ignore if we cannot mount tmpfs"
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 22 Nov 2024 11:50:25 +0000 (11:50 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 22 Nov 2024 11:50:25 +0000 (11:50 +0000)
This reverts commit 5b0ccac2677bfaf1821c13571f68d3191dd10e5b.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c

index 4aff554b2ce5709a2773159c90d3188cd0cab94d..462ecf1ac9a0335555da104fb4a89b1f7439d227 100644 (file)
@@ -796,30 +796,6 @@ ERROR:
        return r;
 }
 
-static int pakfire_mount_tmpfs(struct pakfire* pakfire, const char* path) {
-       int r;
-
-       // Mount!
-       r = mount("pakfire_root", path, "tmpfs", 0, NULL);
-       if (r) {
-               switch (errno) {
-                       // We might not have permission to mount tmpfs. Ignore that...
-                       case EPERM:
-                               DEBUG(pakfire->ctx, "We don't have permission to mount tmpfs. Ignoring.\n");
-                               return 0;
-
-                       default:
-                               ERROR(pakfire->ctx, "Could not mount tmpfs: %m\n");
-                               return -errno;
-               }
-       }
-
-       // Umount path later
-       pakfire->internal_flags |= PAKFIRE_UMOUNT_PATH;
-
-       return 0;
-}
-
 PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, struct pakfire_ctx* ctx,
                const char* path, const char* arch, FILE* conf, int flags) {
        struct pakfire* p = NULL;
@@ -957,9 +933,15 @@ PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, struct pakfire_ctx*
 
                // Mount a tmpfs
                } else {
-                       r = pakfire_mount_tmpfs(p, path);
-                       if (r < 0)
+                       r = mount("pakfire_root", path, "tmpfs", 0, NULL);
+                       if (r) {
+                               ERROR(p->ctx, "Could not mount tmpfs: %m\n");
+                               r = -errno;
                                goto ERROR;
+                       }
+
+                       // Umount path later
+                       p->internal_flags |= PAKFIRE_UMOUNT_PATH;
                }
        }