aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/config/defaults/efi.h1
-rw-r--r--src/config/general.h2
-rw-r--r--src/hci/commands/shim_cmd.c14
3 files changed, 15 insertions, 2 deletions
diff --git a/src/config/defaults/efi.h b/src/config/defaults/efi.h
index 998bdcc..8e53b9a 100644
--- a/src/config/defaults/efi.h
+++ b/src/config/defaults/efi.h
@@ -47,7 +47,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define USB_BLOCK /* USB block devices */
#define REBOOT_CMD /* Reboot command */
-#define SHIM_CMD /* EFI shim command */
#if defined ( __i386__ ) || defined ( __x86_64__ )
#define IOAPI_X86
diff --git a/src/config/general.h b/src/config/general.h
index 2a371d0..6e8e86b 100644
--- a/src/config/general.h
+++ b/src/config/general.h
@@ -160,7 +160,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
//#define CERT_CMD /* Certificate management commands */
//#define IMAGE_MEM_CMD /* Read memory command */
#define IMAGE_ARCHIVE_CMD /* Archive image management commands */
-//#define SHIM_CMD /* EFI shim command */
+#define SHIM_CMD /* EFI shim command (or dummy command) */
/*
* ROM-specific options
diff --git a/src/hci/commands/shim_cmd.c b/src/hci/commands/shim_cmd.c
index 9150af3..1195629 100644
--- a/src/hci/commands/shim_cmd.c
+++ b/src/hci/commands/shim_cmd.c
@@ -36,6 +36,13 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
*
*/
+/* Exist as a dummy command on non-EFI platforms */
+#ifdef PLATFORM_efi
+#define shim_dummy 0
+#else
+#define shim_dummy 1
+#endif
+
/** "shim" options */
struct shim_options {
/** Download timeout */
@@ -79,6 +86,12 @@ static int shim_exec ( int argc, char **argv ) {
int download;
int rc;
+ /* Do absolutely nothing if this is a non-EFI platform */
+ if ( shim_dummy ) {
+ rc = 0;
+ goto err_dummy;
+ }
+
/* Parse options */
if ( ( rc = parse_options ( argc, argv, &shim_cmd, &opts ) ) != 0 )
goto err_parse;
@@ -105,6 +118,7 @@ static int shim_exec ( int argc, char **argv ) {
err_shim:
err_image:
err_parse:
+ err_dummy:
return rc;
}