#!/bin/bash | |
cfg_file_name=$1 | |
img_file_name=$2 | |
vol_name=$3 | |
file_size=$4 | |
vol_size=$[$file_size*942-512] | |
echo "[ubifs]" > $cfg_file_name | |
echo "mode=ubi" >> $cfg_file_name | |
echo "image=${img_file_name}" >> $cfg_file_name | |
echo "vol_id=0" >> $cfg_file_name | |
echo "vol_size=${vol_size}KiB" >> $cfg_file_name | |
echo "vol_type=dynamic" >> $cfg_file_name | |
echo "vol_name=${vol_name}" >> $cfg_file_name | |
echo "vol_flags=autoresize" >> $cfg_file_name |