Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fxUF6-0006zi-7B for mharc-grub-devel@gnu.org; Wed, 05 Sep 2018 05:36:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxUF3-0006zD-Mj for grub-devel@gnu.org; Wed, 05 Sep 2018 05:36:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxUF0-0004Hv-EX for grub-devel@gnu.org; Wed, 05 Sep 2018 05:36:53 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:52928) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fxUF0-0004Fb-5F for grub-devel@gnu.org; Wed, 05 Sep 2018 05:36:50 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w859YAlW176405; Wed, 5 Sep 2018 09:36:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to; s=corp-2018-07-02; bh=bhcibR0CkBnViMBMDkrS7AoqOPVFAp/QLGuRaWrpxhw=; b=rewVxN3Pt0t1qCbJKQTqxbrE5D0KEnLPiIy72hbAiXecwtGBMQxHKzGAJ1FqSHk6TK6G bOUeCURuEDxjbDQLtfn1j1UUbuscib9TfJklLnXx0GHqh3/OSaqjAs88Hm1Ez155cW6b F0kJo7EwYJSvGysfKGIhC22na+vMUgoO9Yva/c0lj+zEz5whiz/iQUORwZwjsB8Qi4/Y ta6EEA56nxXITTmMSnHcDXKs2CTW3MRAHeYMUYyZGJe2XcM5eUyFsKj4x529WEkcz6Ve gUh/+GHUbVevDnGOha9O4OA7UO55PTuE8e1Sue5v7mnQZfqXCI9m2YcrsrCfK2YcSYzN Fw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2m7j6tjsbt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Sep 2018 09:36:47 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w859akWA003887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Sep 2018 09:36:46 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w859aj71012107; Wed, 5 Sep 2018 09:36:45 GMT Received: from olila.i.net-space.pl (/10.175.208.50) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 05 Sep 2018 02:36:44 -0700 Date: Wed, 5 Sep 2018 11:36:40 +0200 From: Daniel Kiper To: Eric Snowberg Cc: The development of GNU GRUB , John Paul Adrian Glaubitz Subject: Re: [PATCH v2] ieee1275: obdisk driver Message-ID: <20180905093640.GB4543@olila.i.net-space.pl> References: <20180621165822.GA20016@olila.local.net-space.pl> <20180716135117.GF26572@olila.local.net-space.pl> <0F674D8E-77C2-4208-8C50-1B5D0A0C4866@oracle.com> <20180717133857.GI26572@olila.local.net-space.pl> <465A56C4-8481-4DEC-9367-A64CB7A82B31@oracle.com> <20180830140653.GE4616@olila.i.net-space.pl> <3CA5742D-C75B-43DF-8C2D-C40D0DEFF311@oracle.com> <20180901171046.GE4462@olila.i.net-space.pl> <57CA67F7-B43E-48F9-808E-D09441A4159E@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <57CA67F7-B43E-48F9-808E-D09441A4159E@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9006 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=785 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809050102 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by userp2130.oracle.com id w859YAlW176405 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.86 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, 05 Sep 2018 09:36:54 -0000 On Tue, Sep 04, 2018 at 09:45:14AM -0600, Eric Snowberg wrote: > > On Sep 1, 2018, at 11:10 AM, Daniel Kiper w= rote: [...] > > I think that it is correct. If you use one '\' then after shell > > processing you will get > > > > (ieee1275//pci@308/pci@1/usb@0/hub@1/storage@3/disk@0,0) > > > > or > > > > (ieee1275//pci@308/pci@1/usb@0/hub@1/storage@3/disk@0,0,gpt1) > > > > And I suppose that this is not what you want. So, you need two '\'. > > This way the layer below will get after shell processing > > > > (ieee1275//pci@308/pci@1/usb@0/hub@1/storage@3/disk@0\,0) > > > > or > > > > (ieee1275//pci@308/pci@1/usb@0/hub@1/storage@3/disk@0\,0,gpt1) > > > > Then new driver should get > > > > ieee1275//pci@308/pci@1/usb@0/hub@1/storage@3/disk@0,0 > > > > or > > > > ieee1275//pci@308/pci@1/usb@0/hub@1/storage@3/disk@0\,0 > > > > if you really need escaped ',' in the path. > > For obdisk devices that are displayed thru the shell, I didn't want > the escaped =E2=80=98,=E2=80=99 in the path. But you rejected my chang= e that > substituted it with __ instead. Therefore we are left with making > this work with code above obdisk without changing it. > > > However, I do not think so. > > It seems to me that OF expects ',' as ','. Hence, I have a feeling th= at > > we can reduce number of escaping/unescaping in the driver. > > > > Am I right? > > No. > > The driver provides the name of the device which is displayed in the > shell. It must be in a format that will allow it to get back to the > driver at a later time. If a =E2=80=98,=E2=80=99 is in the name, it mu= st be escaped. > Otherwise the code above the driver will trim off everything to the > right of the =E2=80=98,=E2=80=99. Then the driver will be sent a device= name that does > not exist. > > For example with this device: /pci@306/pci@1/LSI,mrsas@0/disk@0,0,gpt3 > > If the =E2=80=98,=E2=80=99 is not escaped properly, either (obdisk or o= fdisk) will be > sent an open to device: /pci@306/pci@1/LSI. The upper level code will > think everything to the right of the =E2=80=98,=E2=80=99 is the partiti= on. Once the > driver receives this open, it will fail, since it isn=E2=80=99t a valid > device. So, AIUI, the driver has to use device paths with escaped ',', e.g. ieee1275//pci@308/pci@1/usb@0/hub@1/storage@3/disk@0\,0 I am OK with that. Though we should think how to display such paths. We can show them as is without additional escaping. And right now I think that it is preferred form. Even GRUB doc shows paths with ',' that way. I know that then user cannot just copy-and-paste the device path. However, I think that we should update the doc in relevant place and say that he/she has to take care about special characters for GRUB2 shell like '\' because shell will eat them. So, they have to be properly escaped. This way everything will be in line with common GRUB2 shell escaping rules and we will not introduce exceptions which may make confusion in the future. Daniel