extern int loader_is_participating;
extern void hook_system_services(EFI_SYSTEM_TABLE *local_systab);
+extern void unhook_system_services(void);
#endif /* SHIM_REPLACEMENTS_H */
efi_status = init_grub(image_handle);
+#if defined(OVERRIDE_SECURITY_POLICY)
+ /*
+ * Clean up the security protocol hook
+ */
+ security_policy_uninstall();
+#endif
+
/*
* If we're back here then clean everything up before exiting
*/
uefi_call_wrapper(BS->UninstallProtocolInterface, 3, handle,
&shim_lock_guid, &shim_lock_interface);
-#if defined(OVERRIDE_SECURITY_POLICY)
+
/*
- * Clean up the security protocol hook
+ * Remove our hooks from system services.
*/
- security_policy_uninstall();
-#endif
+ unhook_system_services();
/*
* Free the space allocated for the alternative 2nd stage loader