diff --git a/common/blspec.c b/common/blspec.c index ec63ddb..8132d14 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -732,3 +732,27 @@ return blspec_scan_device(bootentries, dev); } + +static int blspec_bootentry_provider(struct bootentries *bootentries, + const char *name) +{ + int ret, found = 0; + + ret = blspec_scan_devicename(bootentries, name); + if (ret > 0) + found += ret; + + if (*name == '/' || !strncmp(name, "nfs://", 6)) { + ret = blspec_scan_directory(bootentries, name); + if (ret > 0) + found += ret; + } + + return found; +} + +static int blspec_init(void) +{ + return bootentry_register_provider(blspec_bootentry_provider); +} +device_initcall(blspec_init); \ No newline at end of file diff --git a/common/boot.c b/common/boot.c index f0359cf..3280ac4 100644 --- a/common/boot.c +++ b/common/boot.c @@ -283,18 +283,6 @@ struct bootentry_provider *p; int found = 0, ret; - if (IS_ENABLED(CONFIG_BLSPEC)) { - ret = blspec_scan_devicename(bootentries, name); - if (ret > 0) - found += ret; - - if (*name == '/' || !strncmp(name, "nfs://", 6)) { - ret = blspec_scan_directory(bootentries, name); - if (ret > 0) - found += ret; - } - } - list_for_each_entry(p, &bootentry_providers, list) { ret = p->fn(bootentries, name); if (ret > 0)