#!/bin/sh
echo ‘Requesting password to allow running as root…’
sudo echo ‘Thanks :)!’
# Make folder
if [ ! -d “BuildOdin” ]
then
mkdir BuildOdin
fi
# Copy BaseRom files
cp BaseRom/adsp.mbn BuildOdin/adsp.mbn
cp BaseRom/amss.mbn BuildOdin/amss.mbn
cp BaseRom/cache.img.ext4 BuildOdin/cache.img.ext4
cp BaseRom/preload.img.ext4 BuildOdin/preload.img.ext4
# Copy boot image
if [ -s NewRom/boot.img ]
then
cp NewRom/boot.img BuildOdin/boot.img
else
cp BaseRom/boot.img BuildOdin/boot.img
fi
# Copy recovery image
if [ -s NewRom/recovery.img ]
then
cp NewRom/recovery.img BuildOdin/recovery.img
else
cp BaseRom/recovery.img BuildOdin/recovery.img
fi
# Create system image
mysyssize=`du -s -h NewRom/system | awk ‘BEGIN{FS=”[M]”} {print $1}’`
mysyssizeincreased=$((mysyssize+50))
echo ‘Filesize will be’ $mysyssizeincreased ‘MB’
echo ‘dd empty image…’
dd if=/dev/zero of=BuildOdin/system.img.ext4 bs=1M count=$mysyssizeincreased >&- 2>&-
echo ‘make it ext4…’
mke2fs -F -T ext4 BuildOdin/system.img.ext4 >&- 2>&-
echo ‘mounting…’
sudo mount -t ext4 -o loop BuildOdin/system.img.ext4 /mnt >&- 2>&-
echo ‘copying system…’
cp NewRom/system/* /mnt -rp
sync
echo ‘unmounting…’
sudo umount /mnt
# Create Odin and Odin MD5 files
cd BuildOdin
echo ‘tarring…’
tar -cf MyOdinpack.tar adsp.mbn amss.mbn boot.img cache.img.ext4 preload.img.ext4 recovery.img system.img.ext4
echo ‘copying…’
cp MyOdinpack.tar MyOdinpack.tar.md5
echo ‘md5sum…’
md5sum -t MyOdinpack.tar>>MyOdinpack.tar.md5
echo ‘done!’
อันนี้ ไม่เวิร์คครับ