blob: e98373dac7ede6c887fb29a6004698de3cd802e0 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#!/bin/bash
xf.lia7b0f332025-01-23 22:52:11 -08002#LYNQ_MODIFY_ZXW_TASK944_XF.Li_20250123_START
3if [ 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
12else
13 echo "default nand type"
14 NAND_PAGESIZE=$PAGESIZE
15 NAND_ERASEBLOCK=$ERASEBLOCK
lh9ed821d2023-04-07 01:36:19 -070016fi
17
xf.lia7b0f332025-01-23 22:52:11 -080018if [ x"$NAND_PAGESIZE" = x"" ]; then
19 NAND_PAGESIZE=0x800
lh9ed821d2023-04-07 01:36:19 -070020fi
21
xf.lia7b0f332025-01-23 22:52:11 -080022if [ x"$NAND_ERASEBLOCK" = x"" ]; then
23 NAND_ERASEBLOCK=0x20000
24fi
25#LYNQ_MODIFY_ZXW_TASK944_XF.Li_20250123_END
lh9ed821d2023-04-07 01:36:19 -070026JFFS2_COMPRESS_TYPE=$3
27COMPR_OPT="-X lzma"
28
29if [ x"$JFFS2_COMPRESS_TYPE" = x"zlib" ]; then
30 COMPR_OPT="-X zlib"
31fi
32
33if [ x"$JFFS2_COMPRESS_TYPE" = x"lzo" ]; then
34 COMPR_OPT="-X lzo"
35fi
xf.lia7b0f332025-01-23 22:52:11 -080036#LYNQ_MODIFY_ZXW_TASK944_XF.Li_20250123_START
37mkfs.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
lh9ed821d2023-04-07 01:36:19 -070039if [ $? -ne 0 ]; then
40 echo "mkfs.jffs2_lzma error"
41 exit -1
42else
43 echo "mkfs.jffs2_lzma ok"
44fi
45
46exit 0