Skip to content

Commit

Permalink
Remove onboot hack for unified builds
Browse files Browse the repository at this point in the history
Change-Id: I525ed6e5d14c161df951d778133c4cc3b398c324
  • Loading branch information
Quarx2k committed Mar 29, 2015
1 parent 8df19ce commit ff7073d
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 28 deletions.
3 changes: 3 additions & 0 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion device_w7.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down
25 changes: 10 additions & 15 deletions prebuilt/fixup.sh
Original file line number Diff line number Diff line change
@@ -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"
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");
8 changes: 0 additions & 8 deletions rootdir/init.w7.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions system.prop
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit ff7073d

Please sign in to comment.