From ba04fbba711217e2a7c10270fe932146564f6229 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 11 Jun 2021 10:43:20 +0800 Subject: [PATCH] create-user-key-store.sh: use grub2-mkpasswd-pbkdf2 rather than grub-mkpasswd-pbkdf2 on RHEL/CentOS/Fedora On RHEL/CentOS/Fedora, there is no grub-mkpasswd-pbkdf2 command but grub2-mkpasswd-pbkdf2. Update the script to locate the appropriate command. Signed-off-by: Yi Zhao --- meta-signing-key/scripts/create-user-key-store.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meta-signing-key/scripts/create-user-key-store.sh b/meta-signing-key/scripts/create-user-key-store.sh index 0d55d2a..0b4b9fa 100755 --- a/meta-signing-key/scripts/create-user-key-store.sh +++ b/meta-signing-key/scripts/create-user-key-store.sh @@ -304,7 +304,11 @@ create_ima_user_key() { create_boot_pw_key() { local bootprog=`which grub-mkpasswd-pbkdf2` if [ "$bootprog" = "" ] ; then - print_fatal "ERROR could not locate \"grub-mkpasswd-pbkdf2\" please install it or set the path to the host native sysroot" + # Locate grub2-mkpasswd-pbkdf2 on RHEL/CentOS/Fedora + bootprog=`which grub2-mkpasswd-pbkdf2` + if [ "$bootprog" = "" ] ; then + print_fatal "ERROR could not locate \"grub-mkpasswd-pbkdf2\" or \"grub2-mkpasswd-pbkdf2\" please install it or set the path to the host native sysroot" + fi fi (echo "$BOOT_PASS"; echo "$BOOT_PASS") | $bootprog > $BOOT_KEYS_DIR/boot_cfg_pw.tmp if [ $? != 0 ] ; then