From: Jo-Philipp Wich Date: Tue, 17 Feb 2015 19:13:43 +0000 (+0100) Subject: block: support builtin fstab config X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b0c455bfc34fc7c7ac392b18a6c09f016230216d;p=project%2Ffstools.git block: support builtin fstab config Fall back to /etc/config/fstab if the file on the overlay cannot be loaded. Signed-off-by: Jo-Philipp Wich --- diff --git a/block.c b/block.c index c29017d..de8a3b7 100644 --- a/block.c +++ b/block.c @@ -410,14 +410,16 @@ static int config_load(char *cfg) uci_set_confdir(ctx, path); } - if (uci_load(ctx, "fstab", &pkg)) - { - char *err; - uci_get_errorstr(ctx, &err, "fstab"); - ERROR("extroot: failed to load %s/etc/config/%s\n", - cfg ? cfg : "", err); - free(err); - return -1; + if (uci_load(ctx, "fstab", &pkg)) { + uci_set_confdir(ctx, "/etc/config"); + if (uci_load(ctx, "fstab", &pkg)) { + char *err; + uci_get_errorstr(ctx, &err, "fstab"); + ERROR("extroot: failed to load %s/etc/config/%s\n", + cfg ? cfg : "", err); + free(err); + return -1; + } } vlist_update(&mounts);