File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -447,6 +447,13 @@ function load_kernel() {
447447 /sbin/kexec -a -l " $KERNEL_IMAGE " --initrd=" $INITRD " --append=" $BOOT_OPTIONS "
448448}
449449
450+ function load_kernel_secure() {
451+ # Load kernel into the memory secure
452+ # -s flag is for enforcing the new load kernel(vmlinuz) to be signed and verify.
453+ # not using -a flag, this flag can fallback to an old kexec load that do not support Secure Boot verification
454+ /sbin/kexec -l " $KERNEL_IMAGE " --initrd=" $INITRD " --append=" $BOOT_OPTIONS " -s
455+ }
456+
450457function unload_kernel()
451458{
452459 # Unload the previously loaded kernel if any loaded
@@ -597,9 +604,13 @@ if [[ "$sonic_asic_type" == "mellanox" ]]; then
597604 fi
598605fi
599606
607+ # check if secure boot is enable in UEFI
608+ SECURE_UPGRADE_ENABLED=$( bootctl status 2> /dev/null | grep -c " Secure Boot: enabled" )
600609
601610if is_secureboot && grep -q aboot_machine= /host/machine.conf; then
602611 load_aboot_secureboot_kernel
612+ elif [ ${SECURE_UPGRADE_ENABLED} -eq 1 ]; then
613+ load_kernel_secure
603614else
604615 load_kernel
605616fi
You can’t perform that action at this time.
0 commit comments