system: break infite loop resolving rootfs type
[project/procd.git] / system.c
index 1f2be330892ef451d21459c789b9a3863271030a..8df606f7abada6c8c67a3301238321d6b6d580a1 100644 (file)
--- a/system.c
+++ b/system.c
@@ -94,8 +94,12 @@ static const char *system_rootfs_type(void) {
                         * lowerdir, as that can point to "/" being a previous
                         * overlay mount (after firstboot or sysuprade config
                         * restore). Hence just assume the lowerdir is "/rom" and
-                        * restart searching for that instead.
+                        * restart searching for that instead if that's not
+                        * already the case.
                         */
+                       if (!strcmp(mp, "/rom"))
+                               break;
+
                        mp = "/rom";
                        fseek(mounts, 0, SEEK_SET);
                        continue;