msmcommd: add libmsmhll as dependency and bump PR
[openembedded.git] / contrib / image-convert / tar2ext2
blob03839d059de4296f993f5c298d4500a1e79b024e
1 #!/bin/sh
3 if [ $# -ne 2 ]; then
4 echo "Usage: $0 <tarball> <ext2 size>"
5 exit
6 fi
8 ext=`echo $1 | sed -r -e 's/.+\.([^.]+\.[^.]+)/\1/'`
9 base=$(basename $1 .$ext)
10 dir=$(dirname $1)
12 if [ "$ext" = "tar.bz2" ]; then
13 uncompress=j
14 else
15 uncompress=z
18 rm -rf mnt
19 mkdir -p mnt
21 fakeroot bash -c "\
22 tar -x$uncompress -f $1 -C mnt; \
23 genext2fs -d mnt -b $(($2 * 1024)) $dir/$base.img; \
24 rm -rf mnt; \