]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[image] Support archive image formats independently of "imgextract" command
authorMichael Brown <mcb30@ipxe.org>
Wed, 12 May 2021 13:37:57 +0000 (14:37 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 12 May 2021 13:50:34 +0000 (14:50 +0100)
Support for the zlib and gzip archive image formats is currently
included only if the IMAGE_ARCHIVE_CMD is used to enable the
"imgextract" command.

The ability to transparently execute a single-member archive image
without using the "imgextract" command renders this unintuitive: a
user wanting to gain the ability to boot a gzip-compressed kernel
image would expect to have to enable IMAGE_GZIP rather than
IMAGE_ARCHIVE_CMD.

Reverse the inclusion logic, so that archive image formats must now be
enabled explicitly (via IMAGE_GZIP and/or IMAGE_ZLIB), with the
archive image management commands dragged in as needed if any archive
image formats are enabled.  The archive image management commands may
be explicitly disabled via IMAGE_ARCHIVE_CMD if necessary.

This matches the behaviour of IBMGMT_CMD and similar options, where
the relevant commands are included only when something else already
drags in the underlying feature.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/config/config.c
src/config/config_archive.c
src/config/general.h

index dd1fceb923046586bfe63b7b1e380eddfe16cb97..a81866132b2b388fc6936f2fa268ea4b99042cee 100644 (file)
@@ -182,6 +182,12 @@ REQUIRE_OBJECT ( efi_image );
 #ifdef IMAGE_SDI
 REQUIRE_OBJECT ( sdi );
 #endif
+#ifdef IMAGE_ZLIB
+REQUIRE_OBJECT ( zlib );
+#endif
+#ifdef IMAGE_GZIP
+REQUIRE_OBJECT ( gzip );
+#endif
 
 /*
  * Drag in all requested commands
@@ -284,9 +290,6 @@ REQUIRE_OBJECT ( cert_cmd );
 #ifdef IMAGE_MEM_CMD
 REQUIRE_OBJECT ( image_mem_cmd );
 #endif
-#ifdef IMAGE_ARCHIVE_CMD
-REQUIRE_OBJECT ( image_archive_cmd );
-#endif
 
 /*
  * Drag in miscellaneous objects
index 84f21b956bfb92a474185fd4a0db53f13a1a976a..746fc7e44d7bc41129eb31b1f573c96b05029cee 100644 (file)
@@ -31,9 +31,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 
 PROVIDE_REQUIRING_SYMBOL();
 
-#ifdef IMAGE_ZLIB
-REQUIRE_OBJECT ( zlib );
-#endif
-#ifdef IMAGE_GZIP
-REQUIRE_OBJECT ( gzip );
+#ifdef IMAGE_ARCHIVE_CMD
+REQUIRE_OBJECT ( image_archive_cmd );
 #endif
index fcfbaf5e930998c5ede346427e587d6f14be0bc9..2d15f500acf357d76f9ab41097e59dae1ee39d78 100644 (file)
@@ -117,8 +117,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #define        IMAGE_PNG               /* PNG image support */
 #define        IMAGE_DER               /* DER image support */
 #define        IMAGE_PEM               /* PEM image support */
-#define        IMAGE_ZLIB              /* ZLIB image support */
-#define        IMAGE_GZIP              /* GZIP image support */
+//#define      IMAGE_ZLIB              /* ZLIB image support */
+//#define      IMAGE_GZIP              /* GZIP image support */
 
 /*
  * Command-line commands to include
@@ -158,7 +158,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 //#define NTP_CMD              /* NTP commands */
 //#define CERT_CMD             /* Certificate management commands */
 //#define IMAGE_MEM_CMD                /* Read memory command */
-//#define IMAGE_ARCHIVE_CMD    /* Archive image management commands */
+#define IMAGE_ARCHIVE_CMD      /* Archive image management commands */
 
 /*
  * ROM-specific options