static struct blob_buf b;
static LIST_HEAD(devices);
static int anon_mount, anon_swap, auto_mount, auto_swap;
+static unsigned int delay_root;
enum {
CFG_ANON_MOUNT,
CFG_ANON_SWAP,
CFG_AUTO_MOUNT,
CFG_AUTO_SWAP,
+ CFG_DELAY_ROOT,
__CFG_MAX
};
[CFG_ANON_MOUNT] = { .name = "anon_mount", .type = BLOBMSG_TYPE_INT32 },
[CFG_AUTO_SWAP] = { .name = "auto_swap", .type = BLOBMSG_TYPE_INT32 },
[CFG_AUTO_MOUNT] = { .name = "auto_mount", .type = BLOBMSG_TYPE_INT32 },
+ [CFG_DELAY_ROOT] = { .name = "delay_root", .type = BLOBMSG_TYPE_INT32 },
};
enum {
if ((tb[CFG_AUTO_SWAP]) && blobmsg_get_u32(tb[CFG_AUTO_SWAP]))
auto_swap = 1;
+ if (tb[CFG_DELAY_ROOT])
+ delay_root = blobmsg_get_u32(tb[CFG_DELAY_ROOT]);
+
return 0;
}
return -1;
pr = find_block_info(m->uuid, m->label, NULL);
+
+ if (!pr && delay_root){
+ fprintf(stderr, "extroot: is not ready yet, retrying in %ui seconds\n", delay_root);
+ sleep(delay_root);
+ pr = find_block_info(m->uuid, m->label, NULL);
+ }
if (pr) {
if (strncmp(pr->id->name, "ext", 3)) {
fprintf(stderr, "extroot: %s is not supported, try ext4\n", pr->id->name);
printf("\toption\tanon_mount\t'0'\n");
printf("\toption\tauto_swap\t'1'\n");
printf("\toption\tauto_mount\t'1'\n\n");
+ printf("\toption\tdelay_root\t'0'\n\n");
list_for_each_entry(pr, &devices, list)
print_block_uci(pr);