mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] blspec: Fix once/default booting
Date: Fri, 18 Oct 2013 11:40:35 +0200	[thread overview]
Message-ID: <1382089235-19816-1-git-send-email-s.hauer@pengutronix.de> (raw)

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>
---
 common/blspec.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/common/blspec.c b/common/blspec.c
index f306ada..a564602 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)
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

                 reply	other threads:[~2013-10-18  9:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1382089235-19816-1-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox