qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Viktor VM Mihajlovski <mihajlov@linux.vnet.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	qemu-s390x@nongnu.org
Cc: 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 v2 2/4] pc-bios/s390-ccw/net: Add support for pxelinux-style config files
Date: Tue, 24 Apr 2018 16:13:19 +0200	[thread overview]
Message-ID: <e7a8083e-aeda-ef03-a431-77eb23e9e561@redhat.com> (raw)
In-Reply-To: <13a57e92-10ff-d89c-907b-3e927f6a9f3d@linux.vnet.ibm.com>

On 24.04.2018 15:41, Viktor VM Mihajlovski wrote:
> On 23.04.2018 09:58, Thomas Huth wrote:
> [...]
>> +
>> +static int net_try_pxelinux_cfgs(filename_ip_t *fn_ip)
>> +{
>> +    int rc, idx;
>> +    char basedir[256];
>> +    int has_basedir;
>> +
>> +    cfgbuf[sizeof(cfgbuf) - 1] = 0;   /* Make sure that it is NUL-terminated */
>> +
>> +    /* Did we get a usable base directory via DHCP? */
>> +    idx = strlen((char *)fn_ip->filename);
>> +    if (idx > 0 && idx < sizeof(basedir) - 40 &&
>> +        fn_ip->filename[idx - 1] == '/') {
>> +        has_basedir = true;
>> +        strcpy(basedir, (char *)fn_ip->filename);
>> +    } else {
>> +        has_basedir = false;
>> +        strcpy(basedir, "pxelinux.cfg/");
>> +    }
>> +
>> +    printf("Trying pxelinux.cfg files...\n");
>> +
>> +    /* Look for config file with MAC address in its name */
>> +    sprintf((char *)fn_ip->filename, "%s%02x-%02x-%02x-%02x-%02x-%02x",
>> +            basedir, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
> Just noticed that the filename has to be <basedir>/pxelinux.cfg/01-<mac>
> per [1].

Ok. I just also had a closer look at the URL that you've mentioned on
IRC (http://jk.ozlabs.org/blog/post/158/netbooting-petitboot/), and
noticed that there is even an additional DHCP option (210) for
specifying the prefix path ... so I'll try to rework my patches accordingly.

 Thomas

  reply	other threads:[~2018-04-24 14:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23  7:58 [Qemu-devel] [PATCH v2 0/4] pc-bios/s390-ccw: Network boot improvements Thomas Huth
2018-04-23  7:58 ` [Qemu-devel] [PATCH v2 1/4] pc-bios/s390-ccw/net: Split up net_load() into init, load and uninit parts Thomas Huth
2018-04-23  7:58 ` [Qemu-devel] [PATCH v2 2/4] pc-bios/s390-ccw/net: Add support for pxelinux-style config files Thomas Huth
2018-04-24 11:07   ` Viktor VM Mihajlovski
2018-04-24 11:23     ` Thomas Huth
2018-04-24 12:19       ` Viktor VM Mihajlovski
2018-04-24 13:41   ` Viktor VM Mihajlovski
2018-04-24 14:13     ` Thomas Huth [this message]
2018-04-23  7:58 ` [Qemu-devel] [PATCH v2 3/4] pc-bios/s390-ccw/net: Add support for .INS " Thomas Huth
2018-04-23  7:58 ` [Qemu-devel] [PATCH v2 4/4] pc-bios/s390-ccw/net: Use diag308 to reset machine before jumping to the OS Thomas Huth
2018-04-23 14:55 ` [Qemu-devel] [PATCH v2 5/4] pc-bios/s390-ccw/net: Try to load pxelinux.cfg file accoring to the UUID Thomas Huth

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=e7a8083e-aeda-ef03-a431-77eb23e9e561@redhat.com \
    --to=thuth@redhat.com \
    --cc=alifm@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=mihajlov@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --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).