Add support to decompress LZO images.

Reviewed-by: Tom Rini <tr...@konsulko.com>
Signed-off-by: Stephen Boyd <swb...@chromium.org>
---
 cmd/ximg.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/cmd/ximg.c b/cmd/ximg.c
index 29d7c3279b39..a6341a078019 100644
--- a/cmd/ximg.c
+++ b/cmd/ximg.c
@@ -14,6 +14,9 @@
 #include <cpu_func.h>
 #include <env.h>
 #include <gzip.h>
+#if IS_ENABLED(CONFIG_LZO)
+#include <linux/lzo.h>
+#endif
 #if IS_ENABLED(CONFIG_ZSTD)
 #include <linux/zstd.h>
 #endif
@@ -238,6 +241,18 @@ do_imgextract(struct cmd_tbl *cmdtp, int flag, int argc, 
char *const argv[])
                        }
                        break;
 #endif /* CONFIG_BZIP2 */
+#if IS_ENABLED(CONFIG_LZO)
+               case IH_COMP_LZO:
+                       {
+                               int ret;
+                               size_t size = unc_len;
+                               printf("   Uncompressing part %d ... ", part);
+
+                               ret = lzop_decompress((void *)data, len, (void 
*)dest, &size);
+                               len = size;
+                       }
+                       break;
+#endif /* CONFIG_LZO */
 #if IS_ENABLED(CONFIG_ZSTD)
                case IH_COMP_ZSTD:
                        {
-- 
Sent by a computer, using git, on the internet

Reply via email to