From: Viktor VM Mihajlovski <mihajlov@linux.vnet.ibm.com>
To: Thomas Huth <thuth@redhat.com>, qemu-s390x@nongnu.org
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
Cornelia Huck <cohuck@redhat.com>,
qemu-devel@nongnu.org, Collin Walling <walling@linux.ibm.com>,
Farhan Ali <alifm@linux.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 2/3] pc-bios/s390-ccw/net: Add support for pxelinux-style config files
Date: Wed, 30 May 2018 13:07:24 +0200 [thread overview]
Message-ID: <07fcdd6a-1ff2-0c14-aaa7-18457c8be1dd@linux.vnet.ibm.com> (raw)
In-Reply-To: <1527671818-23809-3-git-send-email-thuth@redhat.com>
On 30.05.2018 11:16, Thomas Huth wrote:
> Since it is quite cumbersome to manually create a combined kernel with
> initrd image for network booting, we now support loading via pxelinux
> configuration files, too. In these files, the kernel, initrd and command
> line parameters can be specified seperately, and the firmware then takes
> care of glueing everything together in memory after the files have been
> downloaded. See this URL for details about the config file layout:
> https://www.syslinux.org/wiki/index.php?title=PXELINUX
>
> The user can either specify a config file directly as bootfile via DHCP
> (but in this case, the file has to start either with "default" or a "#"
> comment so we can distinguish it from binary kernels), or a folder (i.e.
> the bootfile name must end with "/") where the firmware should look for
> the typical pxelinux.cfg file names, e.g. based on MAC or IP address.
> We also support the pxelinux.cfg DHCP options 209 and 210 from RFC 5071.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> pc-bios/s390-ccw/netboot.mak | 7 ++--
> pc-bios/s390-ccw/netmain.c | 79 +++++++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 82 insertions(+), 4 deletions(-)
[...]
> diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c
> index 7533cf7..e84bb2b 100644
> --- a/pc-bios/s390-ccw/netmain.c
> +++ b/pc-bios/s390-ccw/netmain.c
[...]
> @@ -301,6 +363,18 @@ static int net_try_direct_tftp_load(filename_ip_t *fn_ip)
> if (!strncmp("* ", cfgbuf, 2)) {
> return handle_ins_cfg(fn_ip, cfgbuf, rc);
> }
> + if (!strncasecmp("default", cfgbuf, 7) || !strncmp("# ", cfgbuf, 2)) {
Minor, but I'm wondering whether this is not too cautious and could rule
out valid config files. You might just unconditionally call
pxelinux_parse_cfg and let it find out if this is as pxelinux config
file or not.
> + /* Looks like it is a pxelinux.cfg */
> + struct pl_cfg_entry entries[MAX_PXELINUX_ENTRIES];
> + int num_ent, def_ent = 0;
> +
> + num_ent = pxelinux_parse_cfg(cfgbuf, sizeof(cfgbuf), entries,
> + MAX_PXELINUX_ENTRIES, &def_ent);
> + if (num_ent <= 0) {
> + return -1;
> + }
> + return load_kernel_with_initrd(fn_ip, &entries[def_ent]);
> + }> }
>
> /* Move kernel to right location */
> @@ -406,6 +480,9 @@ void main(void)
> if (fnlen > 0 && fn_ip.filename[fnlen - 1] != '/') {
> rc = net_try_direct_tftp_load(&fn_ip);
> }
> + if (rc <= 0) {
> + rc = net_try_pxelinux_cfg(&fn_ip);
> + }
>
> net_release(&fn_ip);
>
--
Regards,
Viktor Mihajlovski
next prev parent reply other threads:[~2018-05-30 11:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-30 9:16 [Qemu-devel] [PATCH 0/3] pc-bios/s390-ccw: Allow network booting via pxelinux.cfg Thomas Huth
2018-05-30 9:16 ` [Qemu-devel] [PATCH 1/3] pc-bios/s390-ccw/net: Update code for the latest changes in SLOF Thomas Huth
2018-05-30 9:16 ` [Qemu-devel] [PATCH 2/3] pc-bios/s390-ccw/net: Add support for pxelinux-style config files Thomas Huth
2018-05-30 11:07 ` Viktor VM Mihajlovski [this message]
2018-06-01 5:44 ` Thomas Huth
2018-05-31 21:25 ` Farhan Ali
2018-06-01 3:21 ` Thomas Huth
2018-06-01 20:19 ` Farhan Ali
2018-06-05 11:41 ` Thomas Huth
2018-05-30 9:16 ` [Qemu-devel] [PATCH 3/3] pc-bios/s390-ccw/net: Try to load pxelinux.cfg file accoring to the UUID Thomas Huth
2018-06-01 20:16 ` Farhan Ali
2018-06-04 9:36 ` Cornelia Huck
2018-06-05 12:04 ` Thomas Huth
2018-06-05 12:23 ` Cornelia Huck
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=07fcdd6a-1ff2-0c14-aaa7-18457c8be1dd@linux.vnet.ibm.com \
--to=mihajlov@linux.vnet.ibm.com \
--cc=alifm@linux.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
--cc=walling@linux.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).