diff --git a/BoardConfig.mk b/BoardConfig.mk index 3388183..ed03466 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -26,6 +26,9 @@ TARGET_NO_BOOTLOADER := true TARGET_SPECIFIC_HEADER_PATH += device/lge/w7/include +# Releasetools +TARGET_RELEASETOOLS_EXTENSIONS := device/lge/w7 + # Vendor Init TARGET_UNIFIED_DEVICE := true TARGET_INIT_VENDOR_LIB := libinit_msm diff --git a/device_w7.mk b/device_w7.mk index bfa4ee6..0319668 100644 --- a/device_w7.mk +++ b/device_w7.mk @@ -72,7 +72,6 @@ PRODUCT_COPY_FILES += \ device/lge/w7/prebuilt/usr/keylayout/Generic-D4x5.kl:system/usr/keylayout/Generic-D4x5.kl \ device/lge/w7/prebuilt/usr/keylayout/Generic-D410.kl:system/usr/keylayout/Generic-D410.kl \ device/lge/w7/prebuilt/etc/init.zetaw.bt.sh:system/etc/init.zetaw.bt.sh \ - device/lge/w7/prebuilt/fixup.sh:system/bin/fixup.sh \ device/lge/w7/prebuilt/etc/msap.conf:system/etc/msap.conf \ device/lge/w7/prebuilt/etc/clatd.conf:system/etc/clatd.conf \ device/lge/w7/prebuilt/etc/sec_config:system/etc/sec_config \ @@ -92,6 +91,10 @@ PRODUCT_COPY_FILES += \ device/lge/w7/rootdir/init.w7.usb.rc:root/init.w7.usb.rc \ device/lge/w7/rootdir/ueventd.w7.rc:root/ueventd.w7.rc +# OTA +PRODUCT_COPY_FILES += \ + device/lge/w7/prebuilt/fixup.sh:fixup.sh + # TWRP PRODUCT_COPY_FILES += \ device/lge/w7/rootdir/twrp.fstab:recovery/root/etc/twrp.fstab diff --git a/prebuilt/fixup.sh b/prebuilt/fixup.sh index 4f00027..d910496 100755 --- a/prebuilt/fixup.sh +++ b/prebuilt/fixup.sh @@ -1,28 +1,23 @@ -#!/system/bin/sh +#!/sbin/sh model=`getprop ro.product.model` -su -c "setenforce 0" -mount -o remount,rw /system rm /system/usr/keylayout/Generic.kl if [ "$model" = "LG-D410" ] || [ "$model" = "LG-D410hn" ]; then - ln -s /system/usr/keylayout/Generic-D410.kl /system/usr/keylayout/Generic.kl + cp /system/usr/keylayout/Generic-D410.kl /system/usr/keylayout/Generic.kl else - ln -s /system/usr/keylayout/Generic-D4x5.kl /system/usr/keylayout/Generic.kl + cp /system/usr/keylayout/Generic-D4x5.kl /system/usr/keylayout/Generic.kl fi if [ "$model" = "LG-D410" ] || [ "$model" = "LG-D405" ] || [ "$model" = "LG-D415" ]; then - chmod 000 /system/etc/permissions/android.hardware.nfc.xml - chmod 000 /system/etc/permissions/android.hardware.nfc.hce.xml - chmod 000 /system/lib/hw/nfc_nci.w7.so - find /system/app/NfcNci -type f -exec chmod 000 {} \; + rm /system/etc/permissions/android.hardware.nfc.xml + rm /system/etc/permissions/android.hardware.nfc.hce.xml + rm /system/lib/hw/nfc_nci.pn54x.default.so + rm -rf /system/app/NfcNci fi if [ "$model" = "LG-D415" ]; then - chmod 000 /system/bin/fm_qsoc_patches - chmod 000 /system/etc/permissions/qcom.fmradio.xml - find /system/app/FM2 -type f -exec chmod 000 {} \; + rm /system/bin/fm_qsoc_patches + rm /system/etc/permissions/qcom.fmradio.xml + rm -rf /system/app/FM2 fi - -mount -o remount,ro /system -su -c "setenforce 1" diff --git a/releasetools.py b/releasetools.py new file mode 100644 index 0000000..28fcb0f --- /dev/null +++ b/releasetools.py @@ -0,0 +1,26 @@ +# Copyright (C) 2012 The Android Open Source Project +# Copyright (C) 2014 The CyanogenMod 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. + +import os + +TARGET_DIR = os.getenv('OUT') + +def FullOTA_InstallEnd(self): + self.output_zip.write(os.path.join(TARGET_DIR, "fixup.sh"), "fixup.sh") + self.script.AppendExtra('package_extract_file("fixup.sh", "/tmp/fixup.sh");') + self.script.AppendExtra('set_metadata("/tmp/fixup.sh", "uid", 0, "gid", 0, "mode", 0755);') + self.script.Mount("/system") + self.script.AppendExtra('run_program("/tmp/fixup.sh");') + self.script.Unmount("/system"); diff --git a/rootdir/init.w7.rc b/rootdir/init.w7.rc index a8a8230..900d41f 100755 --- a/rootdir/init.w7.rc +++ b/rootdir/init.w7.rc @@ -188,8 +188,6 @@ on fs mkdir /firmware 0771 system system mount vfat /dev/block/platform/msm_sdcc.1/by-name/modem /firmware ro shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 - start fixup - on charger class_start charger @@ -304,12 +302,6 @@ service rmt_storage /system/bin/rmt_storage class core user root -service fixup /system/bin/fixup.sh - class core - user root - disabled - oneshot - service bt-dun /system/bin/dun-server /dev/smd7 /dev/rfcomm0 class late_start user bluetooth diff --git a/system.prop b/system.prop index 5bb37c2..af170ef 100644 --- a/system.prop +++ b/system.prop @@ -1,10 +1,6 @@ # # system.prop for w7 # -############################################################ CLEANUP ME PLEASE QUARX ########################################################### -# We need it for unified build -persist.sys.root_access=3 - # Use reference RIL for initial bringup ro.vendor.extension_library=/vendor/lib/libqti-perfd-client.so rild.libpath=/vendor/lib/libril-qc-qmi-1.so