Prepare self-extractors to deal with two toro variants

Change-Id: I0fee31ce92ad0b9b5f87347f65312b4ebd348958
diff --git a/self-extractors/generate-packages.sh b/self-extractors/generate-packages.sh
index ea407d2..f245db9 100755
--- a/self-extractors/generate-packages.sh
+++ b/self-extractors/generate-packages.sh
@@ -24,19 +24,22 @@
 # 238432 = IML74E
 # 238649 = IML74G
 # 239410 = IML74K
-ZIP=mysid-ota-239410.zip
-BUILD=iml74k
+# 243892 = IMM06
+ZIP=mysid-ota-243892.zip
+BUILD=imm06
 ROOTDEVICE=toro
 DEVICE=toro
 MANUFACTURER=samsung
+VARIANT=vzw
 
-for COMPANY in broadcom csr imgtec invensense nxp samsung ti
+for COMPANY in broadcom csr imgtec invensense nxp samsung_$VARIANT ti
 do
   echo Processing files from $COMPANY
   rm -rf tmp
   FILEDIR=tmp/vendor/$COMPANY/$DEVICE/proprietary
   mkdir -p $FILEDIR
   mkdir -p tmp/vendor/$MANUFACTURER/$ROOTDEVICE
+  mkdir -p tmp/vendor/$MANUFACTURER/${ROOTDEVICE}_$VARIANT
   case $COMPANY in
   broadcom)
     TO_EXTRACT="\
@@ -76,7 +79,25 @@
             system/vendor/firmware/libpn544_fw.so \
             "
     ;;
-  samsung)
+  samsung_spr)
+    TO_EXTRACT="\
+            system/app/BIP.apk \
+            system/app/IMSFramework.apk \
+            system/app/RTN.apk \
+            system/app/SDM.apk \
+            system/app/SPG.apk \
+            system/app/SyncMLSvc.apk \
+            system/bin/fRom \
+            system/lib/lib_gsd4t.so \
+            system/lib/libsecril-client.so \
+            system/lib/libsyncml_core.so \
+            system/lib/libsyncml_port.so \
+            system/vendor/lib/libims_jni.so \
+            system/vendor/lib/libims.so \
+            system/vendor/lib/libsec-ril_lte.so \
+            "
+    ;;
+  samsung_vzw)
     TO_EXTRACT="\
             system/app/BIP.apk \
             system/app/IMSFramework.apk \
@@ -122,6 +143,7 @@
   cp -R $COMPANY/staging/* tmp/vendor/$COMPANY/$DEVICE || echo \ \ \ \ Error copying makefiles
   echo \ \ Setting up shared makefiles
   cp -R root/* tmp/vendor/$MANUFACTURER/$ROOTDEVICE || echo \ \ \ \ Error copying makefiles
+  cp -R root_$VARIANT/* tmp/vendor/$MANUFACTURER/${ROOTDEVICE}_$VARIANT || echo \ \ \ \ Error copying makefiles
   echo \ \ Generating self-extracting script
   SCRIPT=extract-$COMPANY-$DEVICE.sh
   cat PROLOGUE > tmp/$SCRIPT || echo \ \ \ \ Error generating script
diff --git a/self-extractors/root/device-vendor.mk b/self-extractors/root_spr/device-vendor.mk
similarity index 93%
copy from self-extractors/root/device-vendor.mk
copy to self-extractors/root_spr/device-vendor.mk
index 74d9a7b..45170c6 100644
--- a/self-extractors/root/device-vendor.mk
+++ b/self-extractors/root_spr/device-vendor.mk
@@ -19,5 +19,5 @@
 $(call inherit-product-if-exists, vendor/imgtec/$(LOCAL_STEM))
 $(call inherit-product-if-exists, vendor/invensense/$(LOCAL_STEM))
 $(call inherit-product-if-exists, vendor/nxp/$(LOCAL_STEM))
-$(call inherit-product-if-exists, vendor/samsung/$(LOCAL_STEM))
+$(call inherit-product-if-exists, vendor/samsung_spr/$(LOCAL_STEM))
 $(call inherit-product-if-exists, vendor/ti/$(LOCAL_STEM))
diff --git a/self-extractors/root/device-vendor.mk b/self-extractors/root_vzw/device-vendor.mk
similarity index 93%
rename from self-extractors/root/device-vendor.mk
rename to self-extractors/root_vzw/device-vendor.mk
index 74d9a7b..88f4f83 100644
--- a/self-extractors/root/device-vendor.mk
+++ b/self-extractors/root_vzw/device-vendor.mk
@@ -19,5 +19,5 @@
 $(call inherit-product-if-exists, vendor/imgtec/$(LOCAL_STEM))
 $(call inherit-product-if-exists, vendor/invensense/$(LOCAL_STEM))
 $(call inherit-product-if-exists, vendor/nxp/$(LOCAL_STEM))
-$(call inherit-product-if-exists, vendor/samsung/$(LOCAL_STEM))
+$(call inherit-product-if-exists, vendor/samsung_vzw/$(LOCAL_STEM))
 $(call inherit-product-if-exists, vendor/ti/$(LOCAL_STEM))
diff --git a/self-extractors/samsung/staging/reassemble-apks.sh b/self-extractors/samsung/staging/reassemble-apks.sh
deleted file mode 100755
index 7f4e9fd..0000000
--- a/self-extractors/samsung/staging/reassemble-apks.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2011 The Android Open Source 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.
-
-(cd vendor/samsung/toro/proprietary/BIP.apk.parts ; zip -r ../BIP.unsigned.apk .)
-java -jar $(find out/host -name signapk.jar) build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 vendor/samsung/toro/proprietary/BIP.unsigned.apk vendor/samsung/toro/proprietary/BIP.apk
-(cd vendor/samsung/toro/proprietary/IMSFramework.apk.parts ; zip -r ../IMSFramework.unsigned.apk .)
-java -jar $(find out/host -name signapk.jar) build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 vendor/samsung/toro/proprietary/IMSFramework.unsigned.apk vendor/samsung/toro/proprietary/IMSFramework.apk
-(cd vendor/samsung/toro/proprietary/SDM.apk.parts ; zip -r ../SDM.unsigned.apk .)
-java -jar $(find out/host -name signapk.jar) build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 vendor/samsung/toro/proprietary/SDM.unsigned.apk vendor/samsung/toro/proprietary/SDM.apk
-(cd vendor/samsung/toro/proprietary/SyncMLSvc.apk.parts ; zip -r ../SyncMLSvc.unsigned.apk .)
-java -jar $(find out/host -name signapk.jar) build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 vendor/samsung/toro/proprietary/SyncMLSvc.unsigned.apk vendor/samsung/toro/proprietary/SyncMLSvc.apk
diff --git a/self-extractors/samsung/COPYRIGHT b/self-extractors/samsung_spr/COPYRIGHT
similarity index 100%
rename from self-extractors/samsung/COPYRIGHT
rename to self-extractors/samsung_spr/COPYRIGHT
diff --git a/self-extractors/samsung/LICENSE b/self-extractors/samsung_spr/LICENSE
similarity index 100%
rename from self-extractors/samsung/LICENSE
rename to self-extractors/samsung_spr/LICENSE
diff --git a/self-extractors/samsung/staging/BoardConfigToro.mk b/self-extractors/samsung_spr/staging/BoardConfigToro.mk
similarity index 100%
rename from self-extractors/samsung/staging/BoardConfigToro.mk
rename to self-extractors/samsung_spr/staging/BoardConfigToro.mk
diff --git a/self-extractors/samsung/staging/device-toro.mk b/self-extractors/samsung_spr/staging/device-toro.mk
similarity index 96%
rename from self-extractors/samsung/staging/device-toro.mk
rename to self-extractors/samsung_spr/staging/device-toro.mk
index 7e449c7..ae24936 100644
--- a/self-extractors/samsung/staging/device-toro.mk
+++ b/self-extractors/samsung_spr/staging/device-toro.mk
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-LOCAL_PATH := vendor/samsung/toro
+LOCAL_PATH := vendor/samsung_spr/toro
 
 # Samsung blob(s) necessary for toro hardware
 PRODUCT_COPY_FILES += \
diff --git a/self-extractors/samsung/staging/proprietary/Android.mk b/self-extractors/samsung_spr/staging/proprietary/Android.mk
similarity index 100%
rename from self-extractors/samsung/staging/proprietary/Android.mk
rename to self-extractors/samsung_spr/staging/proprietary/Android.mk
diff --git a/self-extractors/samsung_spr/staging/reassemble-apks.sh b/self-extractors/samsung_spr/staging/reassemble-apks.sh
new file mode 100755
index 0000000..953043d
--- /dev/null
+++ b/self-extractors/samsung_spr/staging/reassemble-apks.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Copyright (C) 2011 The Android Open Source 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.
+
+(cd vendor/samsung_spr/toro/proprietary/BIP.apk.parts ; zip -r ../BIP.unsigned.apk .)
+java -jar $(find out/host -name signapk.jar) build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 vendor/samsung_spr/toro/proprietary/BIP.unsigned.apk vendor/samsung_spr/toro/proprietary/BIP.apk
+(cd vendor/samsung_spr/toro/proprietary/IMSFramework.apk.parts ; zip -r ../IMSFramework.unsigned.apk .)
+java -jar $(find out/host -name signapk.jar) build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 vendor/samsung_spr/toro/proprietary/IMSFramework.unsigned.apk vendor/samsung_spr/toro/proprietary/IMSFramework.apk
+(cd vendor/samsung_spr/toro/proprietary/SDM.apk.parts ; zip -r ../SDM.unsigned.apk .)
+java -jar $(find out/host -name signapk.jar) build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 vendor/samsung_spr/toro/proprietary/SDM.unsigned.apk vendor/samsung_spr/toro/proprietary/SDM.apk
+(cd vendor/samsung_spr/toro/proprietary/SyncMLSvc.apk.parts ; zip -r ../SyncMLSvc.unsigned.apk .)
+java -jar $(find out/host -name signapk.jar) build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 vendor/samsung_spr/toro/proprietary/SyncMLSvc.unsigned.apk vendor/samsung_spr/toro/proprietary/SyncMLSvc.apk
diff --git a/self-extractors/samsung/COPYRIGHT b/self-extractors/samsung_vzw/COPYRIGHT
similarity index 100%
copy from self-extractors/samsung/COPYRIGHT
copy to self-extractors/samsung_vzw/COPYRIGHT
diff --git a/self-extractors/samsung/LICENSE b/self-extractors/samsung_vzw/LICENSE
similarity index 100%
copy from self-extractors/samsung/LICENSE
copy to self-extractors/samsung_vzw/LICENSE
diff --git a/self-extractors/samsung/staging/BoardConfigToro.mk b/self-extractors/samsung_vzw/staging/BoardConfigToro.mk
similarity index 100%
copy from self-extractors/samsung/staging/BoardConfigToro.mk
copy to self-extractors/samsung_vzw/staging/BoardConfigToro.mk
diff --git a/self-extractors/samsung/staging/device-toro.mk b/self-extractors/samsung_vzw/staging/device-toro.mk
similarity index 96%
copy from self-extractors/samsung/staging/device-toro.mk
copy to self-extractors/samsung_vzw/staging/device-toro.mk
index 7e449c7..2f548c9 100644
--- a/self-extractors/samsung/staging/device-toro.mk
+++ b/self-extractors/samsung_vzw/staging/device-toro.mk
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-LOCAL_PATH := vendor/samsung/toro
+LOCAL_PATH := vendor/samsung_vzw/toro
 
 # Samsung blob(s) necessary for toro hardware
 PRODUCT_COPY_FILES += \
diff --git a/self-extractors/samsung/staging/proprietary/Android.mk b/self-extractors/samsung_vzw/staging/proprietary/Android.mk
similarity index 100%
copy from self-extractors/samsung/staging/proprietary/Android.mk
copy to self-extractors/samsung_vzw/staging/proprietary/Android.mk
diff --git a/self-extractors/samsung_vzw/staging/reassemble-apks.sh b/self-extractors/samsung_vzw/staging/reassemble-apks.sh
new file mode 100755
index 0000000..45c2dd1
--- /dev/null
+++ b/self-extractors/samsung_vzw/staging/reassemble-apks.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Copyright (C) 2011 The Android Open Source 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.
+
+(cd vendor/samsung_vzw/toro/proprietary/BIP.apk.parts ; zip -r ../BIP.unsigned.apk .)
+java -jar $(find out/host -name signapk.jar) build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 vendor/samsung_vzw/toro/proprietary/BIP.unsigned.apk vendor/samsung_vzw/toro/proprietary/BIP.apk
+(cd vendor/samsung_vzw/toro/proprietary/IMSFramework.apk.parts ; zip -r ../IMSFramework.unsigned.apk .)
+java -jar $(find out/host -name signapk.jar) build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 vendor/samsung_vzw/toro/proprietary/IMSFramework.unsigned.apk vendor/samsung_vzw/toro/proprietary/IMSFramework.apk
+(cd vendor/samsung_vzw/toro/proprietary/SDM.apk.parts ; zip -r ../SDM.unsigned.apk .)
+java -jar $(find out/host -name signapk.jar) build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 vendor/samsung_vzw/toro/proprietary/SDM.unsigned.apk vendor/samsung_vzw/toro/proprietary/SDM.apk
+(cd vendor/samsung_vzw/toro/proprietary/SyncMLSvc.apk.parts ; zip -r ../SyncMLSvc.unsigned.apk .)
+java -jar $(find out/host -name signapk.jar) build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 vendor/samsung_vzw/toro/proprietary/SyncMLSvc.unsigned.apk vendor/samsung_vzw/toro/proprietary/SyncMLSvc.apk