lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #!/bin/bash |
2 | cfg_file_name=$1 | ||||
3 | img_file_name=$2 | ||||
4 | vol_name=$3 | ||||
5 | file_size=$4 | ||||
6 | |||||
7 | vol_size=$[$file_size*942-512] | ||||
8 | |||||
9 | |||||
10 | echo "[ubifs]" > $cfg_file_name | ||||
11 | echo "mode=ubi" >> $cfg_file_name | ||||
12 | echo "image=${img_file_name}" >> $cfg_file_name | ||||
13 | echo "vol_id=0" >> $cfg_file_name | ||||
14 | echo "vol_size=${vol_size}KiB" >> $cfg_file_name | ||||
15 | echo "vol_type=dynamic" >> $cfg_file_name | ||||
16 | echo "vol_name=${vol_name}" >> $cfg_file_name | ||||
17 | echo "vol_flags=autoresize" >> $cfg_file_name |