Skip to content

Commit

Permalink
move fixup for unified build from bootup to install
Browse files Browse the repository at this point in the history
  • Loading branch information
vm03 committed Mar 29, 2015
1 parent 8f2fa10 commit 1c96fcb
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 30 deletions.
3 changes: 3 additions & 0 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ BOARD_NFC_CHIPSET := pn547
#TWRP
TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness

# Releasetools
TARGET_RELEASETOOLS_EXTENSIONS := device/lge/w5

-include vendor/lge/w5/BoardConfigVendor.mk
6 changes: 4 additions & 2 deletions device_w5.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ PRODUCT_COPY_FILES += \
device/lge/w5/prebuilt/etc/nfc-nci.conf:system/etc/nfc-nci.conf \
device/lge/w5/prebuilt/etc/libnfc-nxp.conf:system/etc/libnfc-nxp.conf \
device/lge/w5/prebuilt/etc/nfcee_access.xml:system/etc/nfcee_access.xml \
device/lge/w5/prebuilt/etc/init.d/10nfc_checker:system/etc/init.d/10nfc_checker \
device/lge/w5/prebuilt/etc/init.d/11keys_checker:system/etc/init.d/11keys_checker \
device/lge/w5/prebuilt/usr/keylayout/Generic-D320.kl:system/usr/keylayout/Generic-D320.kl \
device/lge/w5/prebuilt/usr/keylayout/Generic-D325.kl:system/usr/keylayout/Generic-D325.kl \
device/lge/w5/prebuilt/usr/keylayout/Generic-MS323.kl:system/usr/keylayout/Generic-MS323.kl \
Expand All @@ -56,6 +54,10 @@ PRODUCT_LOCALES += hdpi
PRODUCT_AAPT_CONFIG := normal hdpi
PRODUCT_AAPT_PREF_CONFIG := hdpi

# OTA
PRODUCT_COPY_FILES += \
device/lge/w5/prebuilt/fixup.sh:fixup.sh

$(call inherit-product, vendor/lge/w5/w5-vendor.mk)

# Inherit from msm8610-common
Expand Down
12 changes: 0 additions & 12 deletions prebuilt/etc/init.d/10nfc_checker

This file was deleted.

16 changes: 0 additions & 16 deletions prebuilt/etc/init.d/11keys_checker

This file was deleted.

44 changes: 44 additions & 0 deletions prebuilt/fixup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/sbin/sh

model=`cat /proc/cmdline | awk '{print $16}'| awk -F= '{print $2}'`


case $model in
"LG-D320")
rm /system/etc/permissions/android.hardware.nfc.xml
rm /system/etc/permissions/android.hardware.nfc.hce.xml
rm /system/lib/hw/nfc_nci.w5.so
rm -rf /system/app/NfcNci
cat /system/usr/keylayout/Generic-D320.kl > /system/usr/keylayout/Generic.kl
;;
"LG-D320n")
cat /system/usr/keylayout/Generic-D320.kl > /system/usr/keylayout/Generic.kl
;;
"LG-D325")
rm /system/etc/permissions/android.hardware.nfc.xml
rm /system/etc/permissions/android.hardware.nfc.hce.xml
rm /system/lib/hw/nfc_nci.w5.so
rm -rf /system/app/NfcNci
cat /system/usr/keylayout/Generic-D325.kl > /system/usr/keylayout/Generic.kl
;;
"LG-D325F8")
rm /system/etc/permissions/android.hardware.nfc.xml
rm /system/etc/permissions/android.hardware.nfc.hce.xml
rm /system/lib/hw/nfc_nci.w5.so
rm -rf /system/app/NfcNci
cat /system/usr/keylayout/Generic-D325.kl > /system/usr/keylayout/Generic.kl
;;
"LG-MS323")
rm /system/etc/permissions/android.hardware.nfc.xml
rm /system/etc/permissions/android.hardware.nfc.hce.xml
rm /system/lib/hw/nfc_nci.w5.so
rm -rf /system/app/NfcNci
cat /system/usr/keylayout/Generic-MS323.kl > /system/usr/keylayout/Generic.kl
;;
*)
rm /system/etc/permissions/android.hardware.nfc.xml
rm /system/etc/permissions/android.hardware.nfc.hce.xml
rm /system/lib/hw/nfc_nci.w5.so
rm -rf /system/app/NfcNci
;;
esac
26 changes: 26 additions & 0 deletions releasetools.py
Original file line number Diff line number Diff line change
@@ -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");

0 comments on commit 1c96fcb

Please sign in to comment.