From e9ecb4686695cdcbeb76e02977c2e04a86d0c718 Mon Sep 17 00:00:00 2001 From: Michael Reed Date: Thu, 15 Aug 2024 11:04:31 -0500 Subject: [PATCH] Fix grep command for KVM_IMAGE Fix issue https://github.com/canonical/checkbox/issues/1248 --- .../tools/canonical-certification-precheck | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/certification-server/tools/canonical-certification-precheck b/providers/certification-server/tools/canonical-certification-precheck index 8eefac691e..2bb38949c9 100755 --- a/providers/certification-server/tools/canonical-certification-precheck +++ b/providers/certification-server/tools/canonical-certification-precheck @@ -391,7 +391,7 @@ fi # Check local availability of KVM image or pull from Internet, which tends to be slow KVM_Image_Check(){ echoname "KVM Image Check" -if grep "^KVM_IMAGE =" /etc/xdg/$configfile >/dev/null; then +if grep "^KVM_IMAGE =" $configfile >/dev/null; then kvmurl=$(grep ^KVM_IMAGE $configfile|awk '{print $3}') if [[ "$kvmurl" =~ .*\.img$ ]] ; then /usr/bin/qemu-img check $kvmurl >/dev/null 2>&1 @@ -405,7 +405,7 @@ if grep "^KVM_IMAGE =" /etc/xdg/$configfile >/dev/null; then if [[ $YN == "Y" ]]; then read -e -p " Enter the path of your KVM Image: " kvm sudo sed -i "s,KVM_IMAGE =.*,KVM_IMAGE = $kvm,g" $configfile - kvmurl=$(grep ^KVM_IMAGE $configfilen|awk '{print $3}') + kvmurl=$(grep ^KVM_IMAGE $configfile|awk '{print $3}') /usr/bin/qemu-img check $kvmurl >/dev/null 2>&1 if [ $? = "0" ]; then echo -e " $kvmurl is a valid image.\n Continuing to use this image"