diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-10-18 11:39:32 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-10-21 09:15:45 +0200 |
commit | 6b8b04c0abebfc01de2cc9f869a3327bb888b666 (patch) | |
tree | dcbeb01196066866e25d15adfeab871038967cfc /common | |
parent | 0d09ccdf75ad1e89a1cdf001817de858027f5665 (diff) | |
download | barebox-6b8b04c0abebfc01de2cc9f869a3327bb888b666.tar.gz barebox-6b8b04c0abebfc01de2cc9f869a3327bb888b666.tar.xz |
blspec: Fix once/default booting
The default/once files contain the full path to the entries, not
only the filename. This fixes booting the once and default entries.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/blspec.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/common/blspec.c b/common/blspec.c index f306adac0c..a564602d46 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -147,7 +147,7 @@ static int blspec_scan_directory(struct blspec *blspec, const char *root, char *abspath; int ret, found = 0; const char *dirname = "loader/entries"; - char *entry_default = NULL, *entry_once = NULL; + char *entry_default = NULL, *entry_once = NULL, *name; pr_debug("%s: %s %s\n", __func__, root, dirname); @@ -213,10 +213,12 @@ static int blspec_scan_directory(struct blspec *blspec, const char *root, entry->configpath = configname; entry->cdev = cdev; - if (entry_default && !strcmp(d->d_name, entry_default)) + name = asprintf("%s/%s", dirname, d->d_name); + if (entry_default && !strcmp(name, entry_default)) entry->boot_default = true; - if (entry_once && !strcmp(d->d_name, entry_once)) + if (entry_once && !strcmp(name, entry_once)) entry->boot_once = true; + free(name); devname = xstrdup(dev_name(entry->cdev->dev)); if (entry->cdev->dev->parent) |