From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Yrmct-0007X7-3N for mharc-grub-devel@gnu.org; Mon, 11 May 2015 08:16:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrmcq-0007VH-2c for grub-devel@gnu.org; Mon, 11 May 2015 08:16:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yrmcn-0000ew-4l for grub-devel@gnu.org; Mon, 11 May 2015 08:16:00 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::11]:35659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrmcm-0000eL-RF for grub-devel@gnu.org; Mon, 11 May 2015 08:15:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1431346554; l=953; s=domk; d=aepfle.de; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Subject:Cc:To:From:Date; bh=ZZHixwP2kGKyCwkzW31SbTtQGNdouZWzpmGfS26165A=; b=RHGZHlgUtxewW85uhNR7FEQO0tbhLJfu7nwqUH15m7P8f8CcAbK+zlzgDlL4PiMiQiX icX+K1RVKuyGGZpx1wSqRWGIV9TeHBQlDadnOTGyxcD18qlOgKfZTPzIrn0KBkHSgRMRY KOyLPMdiaFvtpm3b1tsw0R0BH8Woinqrfe4= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWi/zfN1cLnBYfssVY1SE5ClEYfb5sQvxDNUdfk3GFAM3xrxaZN0YQ== X-RZG-CLASS-ID: mo00 Received: from probook.fritz.box ([2001:a60:10a3:eb01:1ec1:deff:feb9:bb48]) by smtp.strato.de (RZmta 37.5 AUTH) with ESMTPSA id 60588er4BCFsDsY (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve sect571r1 with 571 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Mon, 11 May 2015 14:15:54 +0200 (CEST) Received: by probook.fritz.box (Postfix, from userid 1000) id 6DB67502A7; Mon, 11 May 2015 14:15:54 +0200 (CEST) Date: Mon, 11 May 2015 14:15:54 +0200 From: Olaf Hering To: Andrei Borzenkov Subject: Re: [PATCH] Parse commandline in grub-xen Message-ID: <20150511121554.GA3180@aepfle.de> References: <1431336508-17290-1-git-send-email-olaf@aepfle.de> <20150511094320.GB17438@aepfle.de> <20150511104130.GA29233@aepfle.de> <20150511110143.GA3595@aepfle.de> <20150511115148.GA18883@aepfle.de> <20150511150339.3f303f6a@opensuse.site> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150511150339.3f303f6a@opensuse.site> User-Agent: Mutt/1.5.22.rev6346 (2013-10-29) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:238:20a:202:5300::11 Cc: The development of GNU GRUB X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2015 12:16:01 -0000 On Mon, May 11, Andrei Borzenkov wrote: > Either by allowing ${grub.arg.XXX} (not sure if current grammar accepts > it) or by adding getarg command, something like > > getarg --name debug --set debug What would such format buy us? > You do not control what arguments grub gets - end use (admin) controls > it. You cannot force end user to actually strictly comply with what you > expect. As example, grub.cfg you recently submitted has > > if [ -n "hddev" ] > > without initializing it first. So administrator setting this variable > will unintentionally change behavior of script. That should have been hdcfg of hddev, thanks for spotting it. The use of uninitialized vars has to be caught by the script author no? Code like that is valid IMO: set localvar="" if [ -n "${whatever}" ];then echo "do whatever implies" set localvar="val" fi if [ -n "${localvar}" ];then echo "do whatever local things" fi Olaf