lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | if [ $1 = ] ;then |
| 3 | echo "Please entry inpath outpath and size(MB)" |
| 4 | exit 0 |
| 5 | fi |
| 6 | |
| 7 | if [ $2 = ] ;then |
| 8 | echo "Please entry inpath outpath and size(MB)" |
| 9 | exit 0 |
| 10 | fi |
| 11 | |
| 12 | if [ $3 = ] ;then |
| 13 | echo "Please entry inpath outpath and size(MB)" |
| 14 | exit 0 |
| 15 | fi |
| 16 | |
| 17 | CUSTOM_IN_DIR=$1 |
| 18 | CUSTOM_OUT_DIRR=$2 |
| 19 | CUSTOM_FS_SIZE=$3 |
| 20 | |
| 21 | CUSTOM_FS_PEB=$[$CUSTOM_FS_SIZE* 8 - 1] |
| 22 | |
| 23 | mkfs.ubifs -r ${CUSTOM_IN_DIR} -m 2048 -e 129024 -c ${CUSTOM_FS_PEB} -x zlib -o custom.img; \ |
| 24 | bash ubifs.sh customfs.cfg custom.img customfs ${CUSTOM_FS_SIZE}; \ |
| 25 | ubinize -o ${CUSTOM_OUT_DIRR} -m 2048 -p 128KiB -s 512 customfs.cfg; \ |
| 26 | rm custom.img customfs.cfg;\ |