system/extras
Revision | 9485e34c47b651aee323303928d7e445d13e4bc0 (tree) |
---|---|
Time | 2019-02-26 22:59:39 |
Author | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
mkuserimg_mke2fs.sh: calculate size automatically
Add extra size by the $SRC_DIR size plus 10%.
@@ -160,6 +160,9 @@ fi | ||
160 | 160 | if [ -z $SIZE ]; then |
161 | 161 | echo "Need size of filesystem" |
162 | 162 | exit 2 |
163 | +elif [ 0 -eq 0$SIZE ]; then | |
164 | + s=$(du -sm $SRC_DIR | cut -f1) | |
165 | + SIZE=$(($s / 10 + $s))M | |
163 | 166 | fi |
164 | 167 | |
165 | 168 | # Round down the filesystem length to be a multiple of the block size |