3 # To call this script, make sure mksquashfs is somewhere in PATH
8 ${0##*/} SRC_DIR OUTPUT_FILE [-s] [-m MOUNT_POINT] [-d PRODUCT_OUT] [-c FILE_CONTEXTS] [-b BLOCK_SIZE] [-z COMPRESSOR] [-zo COMPRESSOR_OPT]
12 echo "in mksquashfsimage.sh PATH=$PATH"
20 if [ ! -d $SRC_DIR ]; then
21 echo "Can not find directory $SRC_DIR!"
28 if [[ "$1" == "-s" ]]; then
34 if [[ "$1" == "-m" ]]; then
40 if [[ "$1" == "-d" ]]; then
46 if [[ "$1" == "-c" ]]; then
52 if [[ "$1" == "-b" ]]; then
59 if [[ "$1" == "-z" ]]; then
65 if [[ "$1" == "-zo" ]]; then
71 if [ -n "$MOUNT_POINT" ]; then
72 OPT="$OPT -mount-point $MOUNT_POINT"
74 if [ -n "$PRODUCT_OUT" ]; then
75 OPT="$OPT -product-out $PRODUCT_OUT"
77 if [ -n "$FILE_CONTEXTS" ]; then
78 OPT="$OPT -context-file $FILE_CONTEXTS"
80 if [ -n "$BLOCK_SIZE" ]; then
81 OPT="$OPT -b $BLOCK_SIZE"
84 MAKE_SQUASHFS_CMD="mksquashfs $SRC_DIR/ $OUTPUT_FILE -no-progress -comp $COMPRESSOR $COMPRESSOR_OPT -no-exports -noappend -no-recovery -android-fs-config $OPT"
85 echo $MAKE_SQUASHFS_CMD
92 SPARSE_SUFFIX=".sparse"
93 if [ "$SPARSE" = true ]; then
94 img2simg $OUTPUT_FILE $OUTPUT_FILE$SPARSE_SUFFIX
98 mv $OUTPUT_FILE$SPARSE_SUFFIX $OUTPUT_FILE