From b0c455bfc34fc7c7ac392b18a6c09f016230216d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 17 Feb 2015 20:13:43 +0100 Subject: [PATCH] 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 --- block.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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); -- 2.30.2