From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web08.6202.1605772788580454298 for ; Wed, 18 Nov 2020 23:59:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QN6lfF8n; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605772787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tbL64anSLtl8fhcaTXEr+rUpYAra1UhTFqb2VAMqEVw=; b=QN6lfF8n76FdhTxEBm9r44K0f9uz4nDmqZF5QjWfwrkxSzlFC41Q9N/mbQZCsM8hNO7VKK SBj3SlEKFuSdn5+p3ZtfbMwk1c5j/8zSggQjtR/ajxoRgn/5oCByn3h4VQyRXdjLkLVlFu N8A9ggnlooS2Ua1jORIrnWgt9yKuiEo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-512-S35R1nJoPR-MvyGQtLHuLw-1; Thu, 19 Nov 2020 02:59:44 -0500 X-MC-Unique: S35R1nJoPR-MvyGQtLHuLw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DCA2C8144E6; Thu, 19 Nov 2020 07:59:42 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-236.ams2.redhat.com [10.36.112.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 556D310013BD; Thu, 19 Nov 2020 07:59:40 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 2/4] OvmfPkg/AmdSev: add Grub Firmware Volume Package To: jejb@linux.ibm.com, devel@edk2.groups.io Cc: dovmurik@linux.vnet.ibm.com, Dov.Murik1@il.ibm.com, ashish.kalra@amd.com, brijesh.singh@amd.com, tobin@ibm.com, david.kaplan@amd.com, jon.grimm@amd.com, thomas.lendacky@amd.com, frankeh@us.ibm.com, "Dr . David Alan Gilbert" References: <20201112001316.11341-1-jejb@linux.ibm.com> <20201112001316.11341-3-jejb@linux.ibm.com> <64377f9f-da65-d0ca-e473-c14a69e16a66@redhat.com> <0716c83736d9786a2d3257a06582a2c7221edc3e.camel@linux.ibm.com> From: "Laszlo Ersek" Message-ID: <2aeb42c4-972c-b2a2-9286-16c6bc602030@redhat.com> Date: Thu, 19 Nov 2020 08:59:39 +0100 MIME-Version: 1.0 In-Reply-To: <0716c83736d9786a2d3257a06582a2c7221edc3e.camel@linux.ibm.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 11/19/20 00:00, James Bottomley wrote: > On Mon, 2020-11-16 at 21:42 +0100, Laszlo Ersek wrote: >> On 11/12/20 01:13, James Bottomley wrote: > [...] >>> +## >>> +# different distributions have different names for grub-mkimage, >>> so >>> +# search all the known ones >>> +## >>> +for b in grub2-mkimage grub-mkimage; do >>> + if which $b > /dev/null 2>&1; then > > I did everything except this: > >> (11) s/which/command -v/ > > The problem with command -v is that it picks up aliases, which we > definitely don't want (in the incredibly unlikely case that grub- > mkimage has an alias). You can see the effects with ls which I've got > aliased: > > jejb@jarvis:~> command -v ls > alias ls='ls -F' > jejb@jarvis:~> which ls > /bin/ls > > We definitely want the latter behaviour in the script above ... I need > the absolute path to the command, so I kept the which. Right -- we could forcibly unalias each $b before running "command -v" (or even invoke '\unalias -a' near the top of the script): https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html#tag_20_22_17 https://pubs.opengroup.org/onlinepubs/9699919799/utilities/unalias.html but I don't insist! :) If we seriously get into how self-defeating a user's shell environment can possibly be, we'll never get to the bottom of that. Thanks! Laszlo