lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #!/bin/bash |
xf.li | a7b0f33 | 2025-01-23 22:52:11 -0800 | [diff] [blame] | 2 | #LYNQ_MODIFY_ZXW_TASK944_XF.Li_20250123_START |
| 3 | if [ x"$4" = x"lynq" ]; then |
| 4 | echo "lynq nand type" |
| 5 | if [ x"$LYNQ_NAND_TYPE" = x"M22" ]; then |
| 6 | NAND_PAGESIZE=$LYNQ_M22_PAGESIZE |
| 7 | NAND_ERASEBLOCK=$LYNQ_M22_ERASEBLOCK |
| 8 | else |
| 9 | NAND_PAGESIZE=$PAGESIZE |
| 10 | NAND_ERASEBLOCK=$ERASEBLOCK |
| 11 | fi |
| 12 | else |
| 13 | echo "default nand type" |
| 14 | NAND_PAGESIZE=$PAGESIZE |
| 15 | NAND_ERASEBLOCK=$ERASEBLOCK |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 16 | fi |
| 17 | |
xf.li | a7b0f33 | 2025-01-23 22:52:11 -0800 | [diff] [blame] | 18 | if [ x"$NAND_PAGESIZE" = x"" ]; then |
| 19 | NAND_PAGESIZE=0x800 |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 20 | fi |
| 21 | |
xf.li | a7b0f33 | 2025-01-23 22:52:11 -0800 | [diff] [blame] | 22 | if [ x"$NAND_ERASEBLOCK" = x"" ]; then |
| 23 | NAND_ERASEBLOCK=0x20000 |
| 24 | fi |
| 25 | #LYNQ_MODIFY_ZXW_TASK944_XF.Li_20250123_END |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 26 | JFFS2_COMPRESS_TYPE=$3 |
| 27 | COMPR_OPT="-X lzma" |
| 28 | |
| 29 | if [ x"$JFFS2_COMPRESS_TYPE" = x"zlib" ]; then |
| 30 | COMPR_OPT="-X zlib" |
| 31 | fi |
| 32 | |
| 33 | if [ x"$JFFS2_COMPRESS_TYPE" = x"lzo" ]; then |
| 34 | COMPR_OPT="-X lzo" |
| 35 | fi |
xf.li | a7b0f33 | 2025-01-23 22:52:11 -0800 | [diff] [blame] | 36 | #LYNQ_MODIFY_ZXW_TASK944_XF.Li_20250123_START |
| 37 | mkfs.jffs2_lzma -v $COMPR_OPT --pagesize=$NAND_PAGESIZE --eraseblock=$NAND_ERASEBLOCK --little-endian --no-cleanmarkers --squash -d $1 -o $2 |
| 38 | #LYNQ_MODIFY_ZXW_TASK944_XF.Li_20250123_END |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 39 | if [ $? -ne 0 ]; then |
| 40 | echo "mkfs.jffs2_lzma error" |
| 41 | exit -1 |
| 42 | else |
| 43 | echo "mkfs.jffs2_lzma ok" |
| 44 | fi |
| 45 | |
| 46 | exit 0 |