Skip to content

Instantly share code, notes, and snippets.

@lindwurm
Last active February 15, 2017 05:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lindwurm/90fc353413ed78c00b32 to your computer and use it in GitHub Desktop.
Save lindwurm/90fc353413ed78c00b32 to your computer and use it in GitHub Desktop.
6.0.1 (M4B30Z, Dec 2016)
#!/bin/sh
VENDOR=lge
DEVICE=hammerhead
echo "Please wait..."
wget -nc -q https://dl.google.com/dl/android/aosp/hammerhead-mmb29v-factory-62a68ee9.tgz
tar zxf hammerhead-mmb29v-factory-62a68ee9.tgz
cd hammerhead-mmb29v
unzip image-hammerhead-mmb29v.zip
cd ../
simg2img hammerhead-mmb29v/system.img system.ext4.img
mkdir system
sudo mount -o loop -t ext4 system.ext4.img system
BASE=../../../vendor/$VENDOR/$DEVICE/proprietary
rm -rf $BASE/*
for FILE in `cat proprietary-blobs.txt | grep -v ^# | grep -v ^$ | sed -e 's#^/system/##g'| sed -e "s#^-/system/##g"`; do
DIR=`dirname $FILE`
if [ ! -d $BASE/$DIR ]; then
mkdir -p $BASE/$DIR
fi
echo "cp $FILE $BASE/$FILE"
cp system/$FILE $BASE/$FILE
done
sudo umount system
rm -rf system
rm -rf hammerhead-mmb29v
rm system.ext4.img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment