From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cWEzV-0003vB-In for mharc-grub-devel@gnu.org; Tue, 24 Jan 2017 23:15:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWEzT-0003v5-OY for grub-devel@gnu.org; Tue, 24 Jan 2017 23:15:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWEzP-0007Qe-Pi for grub-devel@gnu.org; Tue, 24 Jan 2017 23:15:23 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:35454) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cWEzP-0007QS-Ik for grub-devel@gnu.org; Tue, 24 Jan 2017 23:15:19 -0500 Received: by mail-lf0-x244.google.com with SMTP id v186so19284103lfa.2 for ; Tue, 24 Jan 2017 20:15:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=Xz3lrta2ds5pSXnS1DmRaK4KQ1KFkxpGzCXwA8sKO4o=; b=DTXdvMVL1mJovsM2z7LhRaBacnYIzSwcrh5l2ukGUmNCwPTDZT5hTMj8ZF8DAaUPT6 6fukV10cfWGAp3OGfccCSO7MuGWEo2sPcjh+n7NiMOkzaYvYLYhzWooayhTJTmp7QFZI RaJECa0NbZT7xBuOJiGvAPo72kHoYkbB0e+6rGU6AGeFw5+v5nkXBpo1q9+sVNBU/tBG 97WF6s7uL1fvPHexhpnqpA8TXxWTN/ZRF3jjxtRkL9AZFuy5f+/GcnWWQUmgSfORLYJz SBS5D3XCLbSqZ5E+X1PctnW26DYAIrTjt1zh7FEpmI7f310MjxHlqDsamFNHRPYRWMoR l6+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Xz3lrta2ds5pSXnS1DmRaK4KQ1KFkxpGzCXwA8sKO4o=; b=KcIGtarbtcsW2za8eZH8sV8Ml9tB1i1tnEjbkMPVRO3aj7bu/xl+kaZusvdDzVhepe RQiiLfMlP4cyyM8xtB/IaOxPQyNK9b7K+nnWh1NJ8TTVffoJchP4uLGFJoUlsIAKlX90 zt0b7PgRqyjjW2f7OVWlAtSKaGovaieHPfLo83RyPQl8aWYhi6g8wpOazquiThoBMYOe YrK4PQWzigxBZUKIBAcgpTna7rK9NU60exx7IBjaNe9TfgxsvbU0XUcmM/cxEeiSLUSs jnXhQearMS72owwrqckClm8n4f2wzsaCkCRSLH31voCNw9bKlS7rsazBnCSJkNqb5oXg HaTA== X-Gm-Message-State: AIkVDXJRPx9r/B+A4HuG6aImyckygY7Njak7e3iQBmMSiwWNmDg5Lsxd28CU1vHVvIP/Yg== X-Received: by 10.25.195.151 with SMTP id t145mr12403864lff.149.1485317716493; Tue, 24 Jan 2017 20:15:16 -0800 (PST) Received: from [192.168.1.3] (ppp109-252-90-129.pppoe.spdop.ru. [109.252.90.129]) by smtp.gmail.com with ESMTPSA id 25sm8027810ljt.11.2017.01.24.20.15.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 20:15:15 -0800 (PST) Subject: Re: [PATCH 4/4] Allow protocol to be separated from host with a semicolon To: Matthew Garrett References: <20170124003601.24612-1-mjg59@coreos.com> <20170124003601.24612-5-mjg59@coreos.com> <411c7ef8-85a2-afd8-7446-0fd8d3d98616@gmail.com> Cc: The development of GNU GRUB From: Andrei Borzenkov Message-ID: Date: Wed, 25 Jan 2017 07:15:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::244 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2017 04:15:24 -0000 25.01.2017 07:06, Matthew Garrett пишет: > On Tue, Jan 24, 2017 at 7:48 PM, Andrei Borzenkov wrote: >> 24.01.2017 23:50, Matthew Garrett пишет: >>> On Mon, Jan 23, 2017 at 8:02 PM, Andrei Borzenkov wrote: >>>> 24.01.2017 03:36, Matthew Garrett пишет: >>>>> Some DHCP servers (such as dnsmasq) tokenise parameters with commas, making >>>>> it impossible to pass boot files with commas in them. Allow using a >>>> >>>> grub_net_open() operates on devices, not files. Please give more details >>>> about your problem. >>> >>> The DHCP server will return a string in the boot_file field. If you >>> want to indicate that this file should be obtained over http, the >>> easiest way to handle this is to provide a boot file in the form >>> (http,host)filename. Unfortunately dnsmasq uses commas to tokenise its >>> configuration parameters and there appears to be no way to override >>> that, which makes it impossible to provide a boot file in this form. >>> Allowing the use of an alternative character avoids this problem. >>> >> >> This won't work because (http,host) will never be interpreted as device >> in current code so you need to support this first before this patch can >> even be considered. Also I am not convinced that arbitrary changing >> syntax is good idea. > > I don't understand - grub_net_open_real() already handles this case: Because bootfile from DHCP packet is not used to set device part of $prefix. Setting bootfile to (http,host)filename will end up with full prefix "(tftp,$next_ip)(http,host)base-name-of-filename". If you mean something different, please explain. > > else > { > const char *comma; > comma = grub_strchr (name, ','); > if (comma) > { > protnamelen = comma - name; > server = comma + 1; > protname = name; > } > else > { > protnamelen = grub_strlen (name); > server = grub_net_default_server; > protname = name; > } > > >> You already can set $prefix when generating image. Why is it not enough? > > Because we ship prebuilt images but don't know what IP addresses users > will be using for their deployment servers. > I can think about implementing URI parsing (somewhat in line with UEFI HTTPboot spec) and/or supporting partial $prefix that sets only protocol, something like "grub-mknetdir --prefix=(http,)", where server part is filled from DHCP ACK.