diff options
author | Thomas Huth <thuth@redhat.com> | 2018-05-26 08:06:05 +0200 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2018-05-29 19:06:45 +1000 |
commit | 08e22e4019030b2f643f65c192c64f3a939fec24 (patch) | |
tree | 31b73ab866e1b205282a8a74d8b483f67cda1587 /slof | |
parent | 696e2036f44788769038e998a4465dfe58906d29 (diff) | |
download | SLOF-08e22e4019030b2f643f65c192c64f3a939fec24.zip SLOF-08e22e4019030b2f643f65c192c64f3a939fec24.tar.gz SLOF-08e22e4019030b2f643f65c192c64f3a939fec24.tar.bz2 |
libnet: Wire up pxelinux.cfg network booting
In case the normal network loading failed, try to load a pxelinux.cfg
config file. If that succeeds, load the kernel and initrd with the
information that could be found in this file.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'slof')
-rw-r--r-- | slof/helpers.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/slof/helpers.c b/slof/helpers.c index a8d575c..bd0742e 100644 --- a/slof/helpers.c +++ b/slof/helpers.c @@ -181,7 +181,16 @@ int write_mm_log(char *data, unsigned int len, unsigned short type) return forth_eval_pop("write-mm-log"); } -static void SLOF_encode_response(void *addr, size_t size,char *s) +void SLOF_set_chosen_int(const char *s, long val) +{ + forth_push(val); + forth_eval("encode-int"); + forth_push((unsigned long)s); + forth_push(strlen(s)); + forth_eval("set-chosen"); +} + +void SLOF_set_chosen_bytes(const char *s, const char *addr, size_t size) { forth_push((unsigned long)addr); forth_push(size); @@ -193,10 +202,10 @@ static void SLOF_encode_response(void *addr, size_t size,char *s) void SLOF_encode_bootp_response(void *addr, size_t size) { - SLOF_encode_response(addr, size, "bootp-response"); + SLOF_set_chosen_bytes("bootp-response", addr, size); } void SLOF_encode_dhcp_response(void *addr, size_t size) { - SLOF_encode_response(addr, size, "dhcp-response"); + SLOF_set_chosen_bytes("dhcp-response", addr, size); } |