mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: Dennis Menschel <menschel-d@posteo.de>
Subject: [PATCH] ARM: omap: xload: Fix network boot filename
Date: Mon, 17 Sep 2018 12:10:06 +0200	[thread overview]
Message-ID: <20180917101006.13490-1-s.hauer@pengutronix.de> (raw)
In-Reply-To: <df6edf8c-d15a-5e7b-58ad-6fc32ad56590@posteo.de>

The dhcp code no longer exports the "bootfile" environment variable.
It now uses global.dhcp.bootfile. Since global variable support is
not necessarily part of the MLO we instead use struct dhcp_result *
to get the bootfile information.

Fixes: 528298b702 ("net: dhcp: rework")

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-omap/xload.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c
index d8b1c9ee1c..bb58825dcf 100644
--- a/arch/arm/mach-omap/xload.c
+++ b/arch/arm/mach-omap/xload.c
@@ -236,6 +236,7 @@ static void *am33xx_net_boot(void)
 	char *file;
 	char ip4_str[sizeof("255.255.255.255")];
 	struct eth_device *edev;
+	struct dhcp_result *dhcp_res;
 
 	am33xx_register_ethaddr(0, 0);
 
@@ -248,12 +249,14 @@ static void *am33xx_net_boot(void)
 		return NULL;
 	}
 
-	err = dhcp(edev, &dhcp_param);
+	err = dhcp_request(edev, &dhcp_param, &dhcp_res);
 	if (err) {
 		printf("dhcp failed\n");
 		return NULL;
 	}
 
+	dhcp_set_result(edev, dhcp_res);
+
 	/*
 	 * Older tftp server don't send the file size.
 	 * Then tftpfs needs temporary place to store the file.
@@ -276,7 +279,7 @@ static void *am33xx_net_boot(void)
 		return NULL;
 	}
 
-	bootfile = getenv("bootfile");
+	bootfile = dhcp_res->bootfile;
 	if (!bootfile) {
 		printf("bootfile not found.\n");
 		return NULL;
-- 
2.19.0


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

  reply	other threads:[~2018-09-17 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-15 12:33 Booting AM335x MLO from network no longer works Dennis Menschel
2018-09-17 10:10 ` Sascha Hauer [this message]
2018-09-17 10:11 ` Sascha Hauer
2018-09-17 16:50   ` Dennis Menschel

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=20180917101006.13490-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=menschel-d@posteo.de \
    /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