diff --git a/debootstrap-ng.sh b/debootstrap-ng.sh index b4cacd610c..b6484f9a14 100644 --- a/debootstrap-ng.sh +++ b/debootstrap-ng.sh @@ -494,15 +494,22 @@ create_image() mv -f $CACHEDIR/$VERSION.raw $DEST/images/$VERSION.raw display_alert "Done building" "$DEST/images/$VERSION.raw" "info" else - display_alert "Signing and compressing" "$VERSION.zip" "info" + display_alert "Signing and compressing" "Please wait!" "info" # stage: sign with PGP if [[ -n $GPG_PASS ]]; then echo $GPG_PASS | gpg --passphrase-fd 0 --armor --detach-sign --batch --yes $VERSION.raw echo $GPG_PASS | gpg --passphrase-fd 0 --armor --detach-sign --batch --yes armbian.txt fi - zip -FSq $DEST/images/$VERSION.zip $VERSION.raw* armbian.txt + if [[ $SEVENZIP == yes ]]; then + FILENAME=$DEST/images/$VERSION.7z + 7za a -t7z -bd -m0=lzma2 -mx=4 -mfb=64 -md=32m -ms=on $FILENAME $VERSION.raw* armbian.txt >/dev/null 2>&1 + else + FILENAME=$DEST/images/$VERSION.zip + zip -FSq $FILENAME $VERSION.raw* armbian.txt + fi rm -f $VERSION.raw *.asc armbian.txt - display_alert "Done building" "$DEST/images/$VERSION.zip" "info" + FILESIZE=$(ls -l --b=M $FILENAME | cut -d " " -f5) + display_alert "Done building" "$FILENAME [$FILESIZE]" "info" fi } ############################################################################# diff --git a/debootstrap.sh b/debootstrap.sh index 4ab597ae4d..91475d42b2 100644 --- a/debootstrap.sh +++ b/debootstrap.sh @@ -292,14 +292,22 @@ if [[ $GPG_PASS != "" ]] ; then echo $GPG_PASS | gpg --passphrase-fd 0 --armor --detach-sign --batch --yes imagewriter.exe echo $GPG_PASS | gpg --passphrase-fd 0 --armor --detach-sign --batch --yes armbian.txt fi -display_alert "Create and sign" "$VERSION.zip" "info" +display_alert "Signing and compressing" "Please wait!" "info" mkdir -p $DEST/images if [[ $COMPRESS_OUTPUTIMAGE == no ]]; then rm -f *.asc imagewriter.* armbian.txt mv *.raw $DEST/images/ else - zip -FSq $DEST/images/$VERSION.zip $VERSION.raw* armbian.txt imagewriter.* - rm -f $VERSION.raw *.asc imagewriter.* armbian.txt + if [[ $SEVENZIP == yes ]]; then + FILENAME=$DEST/images/$VERSION.7z + 7za a -t7z -bd -m0=lzma2 -mx=4 -mfb=64 -md=32m -ms=on $FILENAME $VERSION.raw* armbian.txt imagewriter.* >/dev/null 2>&1 + else + FILENAME=$DEST/images/$VERSION.zip + zip -FSq $FILENAME $VERSION.raw* armbian.txt imagewriter.* + fi + rm -f $VERSION.raw *.asc armbian.txt + FILESIZE=$(ls -l --b=M $FILENAME | cut -d " " -f5) + display_alert "Done building" "$FILENAME [$FILESIZE]" "info" fi } diff --git a/documentation/geek-faq.md b/documentation/geek-faq.md index 7d750c7c88..16c7f03e49 100644 --- a/documentation/geek-faq.md +++ b/documentation/geek-faq.md @@ -68,6 +68,7 @@ Run the script - **FORCE_USE_RAMDISK** (yes|no): overrides autodetect for using tmpfs in new debootstrap and image creation process. Takes effect only if `EXTENDED_DEBOOTSTRAP` is set to "yes" - **FIXED_IMAGE_SIZE** (integer): create image file of this size (in megabytes) instead of minimal. Takes effect only if `EXTENDED_DEBOOTSTRAP` is set to "yes" - **COMPRESS_OUTPUTIMAGE** (**yes**|no): create zip archive with image file and GPG signature for redistribution +- **SEVENZIP** (yes|**no**): create .7z archive with extreme compression ratio instead of .zip - **ROOTFS_TYPE** (**ext4**|f2fs|btrfs|nfs|fel): create image with different root filesystems instead of default ext4. Requires setting FIXED_IMAGE_SIZE to actual size of your SD card for F2FS and BTRFS. Takes effect only if `EXTENDED_DEBOOTSTRAP` is set to "yes" ### Supplying options via command line parameters