Compressing in the back to speed up "build-all images" process
This commit is contained in:
parent
b81058c002
commit
6c29696a0e
@ -456,20 +456,35 @@ create_image()
|
||||
# stage: write u-boot
|
||||
write_uboot $LOOP
|
||||
|
||||
cp $CACHEDIR/sdcard/etc/armbian.txt $CACHEDIR/
|
||||
|
||||
# unmount /boot first, rootfs second, image file last
|
||||
sync
|
||||
[[ $BOOTSIZE != 0 ]] && umount -l $CACHEDIR/mount/boot
|
||||
[[ $ROOTFS_TYPE != nfs ]] && umount -l $CACHEDIR/mount
|
||||
losetup -d $LOOP
|
||||
|
||||
mv $CACHEDIR/tmprootfs.raw $CACHEDIR/${version}.raw
|
||||
cd $CACHEDIR/
|
||||
if [[ $BUILD_ALL == yes ]]; then
|
||||
TEMP_DIR="$(mktemp -d $CACHEDIR/${version}.XXXXXX)"
|
||||
cp $CACHEDIR/sdcard/etc/armbian.txt "${TEMP_DIR}/"
|
||||
mv "$CACHEDIR/tmprootfs.raw" "${TEMP_DIR}/${version}.raw"
|
||||
cd "${TEMP_DIR}/"
|
||||
sign_and_compress &
|
||||
else
|
||||
cp $CACHEDIR/sdcard/etc/armbian.txt $CACHEDIR/
|
||||
mv $CACHEDIR/tmprootfs.raw $CACHEDIR/${version}.raw
|
||||
cd $CACHEDIR/
|
||||
sign_and_compress
|
||||
fi
|
||||
} #############################################################################
|
||||
|
||||
# sign_and_compress
|
||||
#
|
||||
# signs and compresses the image
|
||||
#
|
||||
sign_and_compress()
|
||||
{
|
||||
# stage: compressing or copying image file
|
||||
if [[ $COMPRESS_OUTPUTIMAGE != yes ]]; then
|
||||
mv -f $CACHEDIR/${version}.raw $DEST/images/${version}.raw
|
||||
mv -f ${version}.raw $DEST/images/${version}.raw
|
||||
display_alert "Done building" "$DEST/images/${version}.raw" "info"
|
||||
else
|
||||
display_alert "Signing and compressing" "Please wait!" "info"
|
||||
@ -482,14 +497,22 @@ create_image()
|
||||
fi
|
||||
if [[ $SEVENZIP == yes ]]; then
|
||||
local filename=$DEST/images/${version}.7z
|
||||
7za a -t7z -bd -m0=lzma2 -mx=3 -mfb=64 -md=32m -ms=on $filename ${version}.raw armbian.txt *.asc sha256sum >/dev/null 2>&1
|
||||
if [ ${BUILD_ALL} = TRUE ]; then
|
||||
nice -n 19 7za a -t7z -bd -m0=lzma2 -mx=3 -mfb=64 -md=32m -ms=on $filename ${version}.raw armbian.txt *.asc sha256sum >/dev/null 2>&1
|
||||
else
|
||||
7za a -t7z -bd -m0=lzma2 -mx=3 -mfb=64 -md=32m -ms=on $filename ${version}.raw armbian.txt *.asc sha256sum >/dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
local filename=$DEST/images/${version}.zip
|
||||
zip -FSq $filename ${version}.raw armbian.txt *.asc sha256sum
|
||||
fi
|
||||
rm -f ${version}.raw *.asc armbian.txt sha256sum
|
||||
local filesize=$(ls -l --b=M $filename | cut -d " " -f5)
|
||||
display_alert "Done building" "$filename [$filesize]" "info"
|
||||
if [ ${BUILD_ALL} = TRUE ]; then
|
||||
cd .. && rmdir "${TEMP_DIR}"
|
||||
else
|
||||
local filesize=$(ls -l --b=M $filename | cut -d " " -f5)
|
||||
display_alert "Done building" "$filename [$filesize]" "info"
|
||||
fi
|
||||
fi
|
||||
} #############################################################################
|
||||
|
||||
@ -550,4 +573,4 @@ unmount_on_exit()
|
||||
losetup -d $LOOP >/dev/null 2>&1
|
||||
rm -rf $CACHEDIR/sdcard
|
||||
exit_with_error "debootstrap-ng was interrupted"
|
||||
} #############################################################################
|
||||
} #############################################################################
|
||||
Loading…
Reference in New Issue
Block a user