diff --git a/extract-files.sh b/extract-files.sh index c3978eb..7852373 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -1,14 +1,41 @@ #!/bin/sh +<<<<<<< HEAD BASE=../../../vendor/samsung/hercules/proprietary +======= +set -e + +if [ $# -eq 0 ]; then + SRC=adb +else + if [ $# -eq 1 ]; then + SRC=$1 + else + echo "$0: bad number of arguments" + echo "" + echo "usage: $0 [PATH_TO_EXPANDED_ROM]" + echo "" + echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from" + echo "the device using adb pull." + exit 1 + fi +fi + +BASE=../../../vendor/samsung/hercules/proprietary +>>>>>>> f90cec0... add ability to extract blobs from unzipped ROM rm -rf $BASE/* for FILE in `egrep -v '(^#|^$)' proprietary-files.txt`; do + echo "Extracting /system/$FILE ..." DIR=`dirname $FILE` if [ ! -d $BASE/$DIR ]; then mkdir -p $BASE/$DIR fi - adb pull /system/$FILE $BASE/$FILE + if [ "$SRC" = "adb" ]; then + adb pull /system/$FILE $BASE/$FILE + else + cp $SRC/system/$FILE $BASE/$FILE + fi done ./setup-makefiles.sh