freebsd / crochet

Build FreeBSD images for RaspberryPi, BeagleBone, PandaBoard, and others.
BSD 2-Clause "Simplified" License
612 stars 189 forks source link

Add lzop as compression option to CompressImage #274

Open manonfgoo opened 5 years ago

manonfgoo commented 5 years ago

Hello, would it be posstible to add lzop to CompressImage ?

diff --git a/config.sh.sample b/config.sh.sample
index 47157a5..ceeb8cd 100644
--- a/config.sh.sample
+++ b/config.sh.sample
@@ -108,9 +108,9 @@
 #option Email me@gmail.com

 # Compress the final image.
-# Takes an optional argument of xz or gzip. Defaults to xz.
+# Takes an optional argument of lzop, xz or gzip. Defaults to xz.
 #
-#option CompressImage <xz|gzip>
+#option CompressImage <xz|gzip|lzop>

 # Same as 'CompressImage gzip'
 #option GzipImage
diff --git a/option/CompressImage/setup.sh b/option/CompressImage/setup.sh
index c8f8e0c..017e9e2 100644
--- a/option/CompressImage/setup.sh
+++ b/option/CompressImage/setup.sh
@@ -11,6 +11,16 @@ compress_image() {
             fi
             gzip -k $IMG
             ;;
+        lzop)
+           if [ -e /usr/local/bin/lzop ] ; then
+                   if [ -f $IMG.lzo ]; then
+                       rm $IMG.lzo
+                   fi
+                   lzop -k $IMG
+           else 
+               echo Please install lzop 
+           fi
+            ;;
         *)
             if [ -f $IMG.xz ]; then
                 rm $IMG.xz