Re: [PATCH 2/4] OvmfPkg/AmdSev: add Grub Firmware Volume Package


James Bottomley <jejb@...>
 

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.

James

Join devel@edk2.groups.io to automatically receive all group messages.