Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
Retry creating smaller volume in case of invalid calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Feb 2, 2021
1 parent df38fbf commit c2990b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion release/src/router/rc/ubifs.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ void start_ubifs(void)

/* make ubi volume */
_dprintf("*** ubifs: create jffs2 volume\n");
eval("ubimkvol", UBI_DEV_PATH, "-s", vol_size_s, "-N", UBIFS_VOL_NAME);
while ((vol_size > 1024) && eval("ubimkvol", UBI_DEV_PATH, "-s", vol_size_s, "-N", UBIFS_VOL_NAME)) {
vol_size -= 1024;
snprintf(vol_size_s, sizeof(vol_size_s), "%dKiB", vol_size);
_dprintf("*** ubifs: create failed, decreasing size...\n");
}
}
}
#endif
Expand Down

0 comments on commit c2990b1

Please sign in to comment.