lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | if [ x"$PAGESIZE" = x"" ]; then |
| 4 | PAGESIZE=0x800 |
| 5 | fi |
| 6 | |
| 7 | if [ x"$ERASEBLOCK" = x"" ]; then |
| 8 | ERASEBLOCK=0x20000 |
| 9 | fi |
| 10 | |
| 11 | JFFS2_COMPRESS_TYPE=$3 |
| 12 | COMPR_OPT="-X lzma" |
| 13 | |
| 14 | if [ x"$JFFS2_COMPRESS_TYPE" = x"zlib" ]; then |
| 15 | COMPR_OPT="-X zlib" |
| 16 | fi |
| 17 | |
| 18 | if [ x"$JFFS2_COMPRESS_TYPE" = x"lzo" ]; then |
| 19 | COMPR_OPT="-X lzo" |
| 20 | fi |
| 21 | |
| 22 | mkfs.jffs2_lzma -v $COMPR_OPT --pagesize=$PAGESIZE --eraseblock=$ERASEBLOCK --little-endian --no-cleanmarkers --squash -d $1 -o $2 |
| 23 | if [ $? -ne 0 ]; then |
| 24 | echo "mkfs.jffs2_lzma error" |
| 25 | exit -1 |
| 26 | else |
| 27 | echo "mkfs.jffs2_lzma ok" |
| 28 | fi |
| 29 | |
| 30 | exit 0 |