Commit db801c90 authored by Alessandro Elias's avatar Alessandro Elias
Browse files

Add parameters to mksquashfs to increase performance.


Signed-off-by: Alessandro Elias's avatarAlessandro Elias <ae11@c3sl.ufpr.br>
parent aa3afafd
......@@ -20,6 +20,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
set -x
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
......@@ -39,8 +41,25 @@ PREFIX=$PWD
source ${PREFIX}/common.sh
set -x
mksquashfs $CHROOTDIR ${TMP}/image/casper/filesystem.squashfs -b 1M -no-recovery -no-progress -processors $(nproc) ||\
#########################################
# WARNING:
# Sanity check if {dev,proc,sys} are mounted, cp from /proc will be recursive
# until run out RAM.
if chroot "$CHROOTDIR" mount | grep --quiet --only-matching 'on /dev/pts'; then
umount "$CHROOTDIR/dev/pts"
fi
if chroot "$CHROOTDIR" mount | grep --quiet --only-matching 'on /dev'; then
umount "$CHROOTDIR/dev"
fi
if chroot "$CHROOTDIR" mount | grep --quiet --only-matching 'on /sys'; then
umount "$CHROOTDIR/sys"
fi
if chroot "$CHROOTDIR" mount | grep --quiet --only-matching 'on /proc'; then
umount "$CHROOTDIR/proc"
fi
read a
mksquashfs $CHROOTDIR ${TMP}/image/casper/filesystem.squashfs -b 1M -no-recovery -processors $(nproc) ||\
log ERROR "Failed to compress ${CHROOTDIR}."
(cd ${TMP}/image && find . -type f -print0 | xargs -0 md5sum | grep -v "\./md5sum.txt" > md5sum.txt) ||\
log ERROR "Failed to generate md5sum."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment