[edk2-devel] [PATCH 2/4] OvmfPkg/AmdSev: add Grub Firmware Volume Package

Laszlo Ersek lersek at redhat.com
Thu Nov 19 07:59:39 UTC 2020


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 at jarvis:~> command -v ls
> alias ls='ls -F'
> jejb at 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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#67695): https://edk2.groups.io/g/devel/message/67695
Mute This Topic: https://groups.io/mt/78198619/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list