gprimelte: Move releasetools to common tree
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 6f321ae..b193b59 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -11,9 +11,6 @@
 TARGET_INIT_VENDOR_LIB := libinit_gprimelte
 TARGET_LIBINIT_DEFINES_FILE := $(LOCAL_PATH)/init/init_gprimelte.cpp
 
-# Release Tools
-TARGET_RELEASETOOLS_EXTENSIONS := $(LOCAL_PATH)/releasetools
-
 # Kernel
 TARGET_KERNEL_VARIANT_CONFIG := msm8916_sec_fortuna_can_defconfig
 
diff --git a/device.mk b/device.mk
index 07e1dda..2211d6a 100644
--- a/device.mk
+++ b/device.mk
@@ -21,11 +21,6 @@
 	$(LOCAL_PATH)/media/media_codecs.xml:system/etc/media_codecs.xml \
 	$(LOCAL_PATH)/media/media_profiles.xml:system/etc/media_profiles.xml
 
-# OTA scripts
- PRODUCT_COPY_FILES += \
-	$(LOCAL_PATH)/releasetools/copy_variant_blobs.sh:install/bin/copy_variant_blobs.sh \
-	$(LOCAL_PATH)/releasetools/update_baseband.sh:install/bin/update_baseband.sh
-
 # NFC prebuilt files
 PRODUCT_COPY_FILES += \
 	$(LOCAL_PATH)/nfc/libnfc-sec-hal.conf:system/etc/libnfc-sec-hal.conf \
diff --git a/releasetools/copy_variant_blobs.sh b/releasetools/copy_variant_blobs.sh
deleted file mode 100755
index 20e411c..0000000
--- a/releasetools/copy_variant_blobs.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/sbin/sh
-#
-# Copyright (C) 2017 The LineageOS Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Detect variant and copy its specific-blobs
-BOOTLOADER=`getprop ro.bootloader`
-
-case $BOOTLOADER in
-  G530W*)      VARIANT="can" ;;
-  G530T1*)           VARIANT="mtr" ;;
-  G530T*)           VARIANT="tmo" ;;
-  G530P*)           VARIANT="spr" ;;
-  *)           VARIANT="unknown" ;;
-esac
-
-echo "Device variant is $VARIANT"
-
-# exit if the device is unknown
-if [ $VARIANT == "unknown" ]; then
-	exit 1
-fi
-
-BLOBBASE=/system/blobs/$VARIANT
-
-DEVICE="gprimelte${VARIANT}"
-
-if [ -d $BLOBBASE ]; then
-
-	cd $BLOBBASE
-
-	# copy all the blobs
-	for FILE in `find . -type f` ; do
-		mkdir -p `dirname /system/$FILE`
-		echo "Copying $FILE to /system/$FILE ..."
-		cp $FILE /system/$FILE
-	done
-
-	# set permissions on binary files
-	for FILE in bin/* ; do
-		echo "Setting /system/$FILE executable ..."
-		chmod 755 /system/$FILE
-	done
-fi
-
-# update the device name in the prop
-echo "Updating device variant name ..."
-sed -i s/gprimelte/${DEVICE}/g /system/build.prop
-
-# remove the device blobs
-echo "Cleaning up ..."
-rm -rf /system/blobs
-
-exit 0
diff --git a/releasetools/releasetools.py b/releasetools/releasetools.py
deleted file mode 100755
index 10f4fbc..0000000
--- a/releasetools/releasetools.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2009 The Android Open Source Project
-# Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import common
-import re
-import os
-
-"""Custom OTA commands for gprimelte devices"""
-
-def FullOTA_InstallEnd(info):
-
-    info.script.Print("Mounting /system...")
-    info.script.Mount("/system")
-    info.script.Print("Copying device variant blobs ...")
-    info.script.AppendExtra('assert(run_program("/tmp/install/bin/copy_variant_blobs.sh") == 0);')
-    info.script.Print("Flashing baseband...")
-    info.script.AppendExtra('assert(run_program("/tmp/install/bin/update_baseband.sh") == 0);')
-    info.script.Unmount("/system")
-
-def FullOTA_PostValidate(info):
-    # run e2fsck
-    info.script.Print("Checking the file system on /system...")
-    info.script.AppendExtra('run_program("/sbin/e2fsck", "-fy", "/dev/block/bootdevice/by-name/system");')
-    # resize2fs: run and delete
-    info.script.Print("Resizing /system to maximal size...")
-    info.script.AppendExtra('run_program("/sbin/resize2fs", "-p", "/dev/block/bootdevice/by-name/system");')
-    # run e2fsck
-    info.script.Print("Checking the file system on /system again after resize...")
-    info.script.AppendExtra('run_program("/sbin/e2fsck", "-fy", "/dev/block/bootdevice/by-name/system");')
diff --git a/releasetools/update_baseband.sh b/releasetools/update_baseband.sh
deleted file mode 100755
index b24230a..0000000
--- a/releasetools/update_baseband.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/sbin/sh
-#
-# Copyright (C) 2017 The LineageOS Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Detect variant and copy its specific-blobs
-BOOTLOADER=`getprop ro.bootloader`
-
-case $BOOTLOADER in
-  G530W*)      VARIANT="can" ;;
-  G530T1*)           VARIANT="mtr" ;;
-  G530T*)           VARIANT="tmo" ;;
-  G530P*)           VARIANT="spr" ;;
-  *)           VARIANT="unknown" ;;
-esac
-
-echo "Device variant is $VARIANT"
-
-# exit if the device is unknown
-if [ $VARIANT == "unknown" ]; then
-	exit 1
-fi
-
-RADIO_DIR=/system/RADIO/$VARIANT
-BLOCK_DEV_DIR=/dev/block/bootdevice/by-name
-
-if [ -d ${RADIO_DIR} ]; then
-
-	cd ${RADIO_DIR} 
-
-	# flash the firmware
-	for FILE in `find . -type f` ; do
-		echo "Flashing ${FILE} to ${BLOCK_DEV_DIR}/${FILE} ..."
-		dd if=${FILE} of=${BLOCK_DEV_DIR}/${FILE}
-	done
-fi
-
-# remove the device blobs
-echo "Cleaning up ..."
-rm -rf /system/RADIO
-
-exit 0