Skip to content

Commit

Permalink
New test case for core.efi file check needed by grub and shim upgrade…
Browse files Browse the repository at this point in the history
… (New) (canonical#890)

If a device (x86 or arm with ebbr) uses grub and shim in classic image, we need to make sure grub and shim can be updated correctly when user tries to install a newer grub or shim deb package.

In some instances, the core.efi file was not present, creating problems on devices requiring it for subsequent updates to grub or shim, especially in the context of SecureBoot-enabled devices.

* Add a test case for core.efi file check needed by grub and shim upgrade

* Add the certification status and fix a typo

Fix OEMQA-2967
  • Loading branch information
eugene-yujinwu authored Jan 8, 2024
1 parent 61dfbe3 commit bc84c03
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
14 changes: 14 additions & 0 deletions providers/base/bin/grub_file_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

declare -A DICT_ARCH

DICT_ARCH=( [x86_64]='x86_64' [aarch64]='arm64' [armhf]='arm' )
FILE_CORE="/boot/grub/${DICT_ARCH[$(uname -m)]}-efi/core.efi"

if [ -e "${FILE_CORE}" ]; then
echo "The file ${FILE_CORE} exists, shim and grub can be upgraded."
exit 0
else
echo "Due to the absence of the file ${FILE_CORE}, upgrading shim and grub becomes impossible."
exit 1
fi
14 changes: 13 additions & 1 deletion providers/base/units/miscellanea/jobs.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -539,4 +539,16 @@ command:
if test -f "$PLAINBOX_SESSION_SHARE/ubuntu_drivers_list_oem_check"; then
cat "$PLAINBOX_SESSION_SHARE/ubuntu_drivers_list_oem_check"
fi
true
true

id: miscellanea/grub_file_check
category_id: com.canonical.plainbox::miscellanea
_summary: Check if the file core.efi exists to make sure shim and grub can be upgraded
plugin: shell
estimated_duration: 0.2
requires:
"Ubuntu Core" not in lsb.description
cpuinfo.platform in ("x86_64", "aarch64", "armhf")
bootloader.name == "grub"
command: grub_file_check.sh

1 change: 1 addition & 0 deletions providers/base/units/miscellanea/test-plan.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ include:
miscellanea/debsums certification-status=blocker
miscellanea/check_prerelease certification-status=blocker
miscellanea/ubuntu-desktop-recommends certification-status=blocker
miscellanea/grub_file_check certification-status=blocker
bootstrap_include:
fwts

Expand Down

0 comments on commit bc84c03

Please sign in to comment.