Skip to content

Commit

Permalink
system: break infite loop resolving rootfs type
Browse files Browse the repository at this point in the history
When running procd outside of OpenWrt, e.g. for debugging or research
situations inside a container environment, an inifite loop can occur
when trying to determine the rootfs type. Make sure that doesn't
happen.

Signed-off-by: Daniel Golle <[email protected]>
  • Loading branch information
dangowrt committed Feb 24, 2024
1 parent 2f94972 commit 1901aba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion system.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1901aba

Please sign in to comment.