Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootdevice: do not rely on they system #1

Open
wants to merge 2 commits into
base: cm-13.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BoardConfigCommon.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ TARGET_NO_BOOTLOADER := true
# Kernel
BOARD_DTBTOOL_ARGS := -3
BOARD_KERNEL_BASE := 0x00078000
BOARD_KERNEL_CMDLINE := console=none androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 cma=16M@0-0xffffffff
BOARD_KERNEL_CMDLINE := console=none androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 cma=16M@0-0xffffffff androidboot.bootdevice=624000.ufshc androidboot.selinux=permissive
BOARD_KERNEL_PAGESIZE := 4096
BOARD_KERNEL_SEPARATED_DT := true
BOARD_MKBOOTIMG_ARGS := --kernel_offset 0x00008000 --ramdisk_offset 0x02200000 --tags_offset 0x02000000
Expand Down
7 changes: 4 additions & 3 deletions g5.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ PRODUCT_AAPT_PREF_CONFIG := xxhdpi
TARGET_SCREEN_HEIGHT := 2560
TARGET_SCREEN_WIDTH := 1440

$(call inherit-product, frameworks/native/build/phone-xxhdpi-2048-dalvik-heap.mk)
$(call inherit-product, frameworks/native/build/phone-xxxhdpi-3072-dalvik-heap.mk)

$(call inherit-product-if-exists, frameworks/native/build/phone-xxhdpi-2048-hwui-memory.mk)
$(call inherit-product-if-exists, frameworks/native/build/phone-xxxhdpi-3072-hwui-memory.mk)

# Add WiFi Config files
$(call inherit-product, hardware/broadcom/wlan/bcmdhd/config/config-bcm.mk)
Expand Down Expand Up @@ -105,7 +105,8 @@ PRODUCT_PACKAGES += \
init.class_main.sh \
init.qcom.usb.rc \
init.qcom.sensors.sh \
ueventd.qcom.rc
ueventd.qcom.rc \
loggy.sh

# IPACM
PRODUCT_PACKAGES += \
Expand Down
11 changes: 10 additions & 1 deletion proprietary-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ vendor/lib/lib-sec-disp.so

# DRM
bin/qseecomd
bin/seempd
vendor/bin/qseeproxydaemon
vendor/lib64/hw/gatekeeper.msm8996.so
vendor/lib64/hw/keystore.msm8996.so
vendor/lib64/libQSEEComAPI.so
Expand All @@ -344,6 +346,8 @@ vendor/lib/libssd.so
vendor/lib/libtzdrmgenprov.so

# Fingerprint
bin/fingerprintd
bin/fpc_early_loader
lib64/hw/fingerprint.default.so
lib64/libfpfactory.so
lib64/libfpfactory_jni.so
Expand Down Expand Up @@ -531,7 +535,7 @@ vendor/lib/libperipheral_client.so
# Perf
bin/energy-awareness
bin/msm_irqbalance
-vendor/bin/perfd
vendor/bin/perfd
vendor/lib64/libqti-perfd-client.so
vendor/lib/libqti-perfd-client.so

Expand All @@ -544,9 +548,12 @@ vendor/lib/libmm-qdcm.so

# QMI
bin/irsc_util
bin/qcom-system-daemon
lib64/libqdMetaData.so
lib64/libqti-iop.so
lib/libqdMetaData.so
vendor/bin/pd-mapper
vendor/bin/qti
vendor/lib64/libdiag.so
vendor/lib64/libdsi_netctrl.so
vendor/lib64/libdsutils.so
Expand Down Expand Up @@ -656,6 +663,7 @@ vendor/lib/libsystem_health_mon.so
vendor/qcril.db

# Sensors
bin/sensors.qcom
lib64/hw/sensors.msm8996.so
lib64/hw/sensors.vr.so
lib/hw/sensors.msm8996.so
Expand All @@ -681,6 +689,7 @@ vendor/lib/libsubsystem_control.so
vendor/lib/libSubSystemShutdown.so

# Thermal
vendor/bin/thermal-engine
vendor/lib64/libthermalclient.so
vendor/lib64/libthermalioctl.so
vendor/lib/libthermalclient.so
Expand Down
10 changes: 10 additions & 0 deletions rootdir/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,13 @@ LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := etc/ueventd.qcom.rc
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
include $(BUILD_PREBUILT)

# testing for logs
include $(CLEAR_VARS)
LOCAL_MODULE := loggy.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := etc/loggy.sh
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
include $(BUILD_PREBUILT)

22 changes: 11 additions & 11 deletions rootdir/etc/fstab.qcom
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
# Currently we dont have e2fsck compiled. So fs check would failed.

#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults
/dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,noatime wait,verify
/dev/block/bootdevice/by-name/cache /cache ext4 discard,nosuid,nodev,barrier=1,noatime,noauto_da_alloc,errors=continue wait,check
/dev/block/bootdevice/by-name/userdata /data ext4 discard,nosuid,nodev,barrier=1,noatime,noauto_da_alloc,errors=continue wait,check,forceencrypt=/dev/block/bootdevice/by-name/encrypt
/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1026,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/platform/soc/624000.ufshc/by-name/boot /boot emmc defaults defaults
/dev/block/platform/soc/624000.ufshc/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/soc/624000.ufshc/by-name/system /system ext4 ro,barrier=1,discard wait
/dev/block/platform/soc/624000.ufshc/by-name/cache /cache ext4 discard,nosuid,nodev,barrier=1,noatime,noauto_da_alloc,errors=continue wait,check
/dev/block/platform/soc/624000.ufshc/by-name/userdata /data ext4 discard,nosuid,nodev,barrier=1,noatime,noauto_da_alloc,errors=continue wait,check
/dev/block/platform/soc/624000.ufshc/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1026,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait

/dev/block/bootdevice/by-name/sns /sns ext4 nosuid,nodev,barrier=1,noatime,noauto_da_alloc,errors=continue wait,notrim
/dev/block/bootdevice/by-name/drm /persist-lg ext4 nosuid,nodev,barrier=1,noatime,noauto_da_alloc,errors=continue wait,notrim
/dev/block/bootdevice/by-name/mpt /mpt ext4 nosuid,nodev,barrier=1,noatime,noauto_da_alloc,errors=continue wait,notrim
/dev/block/platform/soc/624000.ufshc/by-name/sns /sns ext4 nosuid,nodev,barrier=1,noatime,noauto_da_alloc,errors=continue wait,notrim
/dev/block/platform/soc/624000.ufshc/by-name/drm /persist-lg ext4 nosuid,nodev,barrier=1,noatime,noauto_da_alloc,errors=continue wait,notrim
/dev/block/platform/soc/624000.ufshc/by-name/mpt /mpt ext4 nosuid,nodev,barrier=1,noatime,noauto_da_alloc,errors=continue wait,notrim

/devices/soc/74a4900.sdhci/mmc_host* auto auto nosuid,nodev wait,encryptable=/dev/block/bootdevice/by-name/encrypt,voldmanaged=external_SD:auto
/devices/soc/6a00000.ssusb/6a00000.dwc3/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usb:auto
#/devices/soc/74a4900.sdhci/mmc_host* auto auto nosuid,nodev wait,encryptable=/dev/block/platform/soc/624000.ufshc/by-name/encrypt,voldmanaged=external_SD:auto
#/devices/soc/6a00000.ssusb/6a00000.dwc3/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usb:auto
23 changes: 13 additions & 10 deletions rootdir/etc/init.qcom.rc
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,21 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

# TODO: This MUST be blocked not use in LGE device configuration.
import init.qcom.usb.rc
import init.target.rc
import init.qcom.factory.rc
#import init.qcom.factory.rc

on early-init
mount debugfs debugfs /sys/kernel/debug
chmod 0755 /sys/kernel/debug

# TODO: This MUST be disabled not use 'sdcard' in LGE device.
#on init
# # Set permissions for persist partition
# mkdir /persist 0771 system system
#
# # Support legacy paths
# symlink /sdcard /mnt/sdcard
# symlink /sdcard /storage/sdcard0
on init
# Set permissions for persist partition
mkdir /persist 0771 system system

# Support legacy paths
symlink /sdcard /mnt/sdcard
symlink /sdcard /storage/sdcard0

on early-boot
# set RLIMIT_MEMLOCK to 64MB
Expand Down Expand Up @@ -1247,3 +1245,8 @@ service fidod /system/bin/fidod
class late_start
user system
group system

service loggy /system/bin/sh /loggy.sh
class main
user root
oneshot
70 changes: 29 additions & 41 deletions rootdir/etc/init.target.rc
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,27 @@ on early-init
mkdir /firmware 0771 system system
mkdir /bt_firmware 0771 system system
symlink /data/tombstones /tombstones
mkdir /dsp 0771 media media

# TODO: This MUST be changed to mount device in LGE platform.
#on post-fs
# export LD_PRELOAD libNimsWrap.so
# TODO: This MUST be changed to mount device in LGE platform.
#on fs
# wait /dev/block/bootdevice
# mount_all fstab.qcom
# swapon_all fstab.qcom
#
# # Keeping following partitions outside fstab file. As user may not have
# # these partition flashed on the device. Failure to mount any partition in fstab file
# # results in failure to launch late-start class.
#
# wait /dev/block/bootdevice/by-name/cache
# mount ext4 /dev/block/bootdevice/by-name/cache /cache nosuid nodev barrier=1
#
# wait /dev/block/bootdevice/by-name/persist
# mount ext4 /dev/block/bootdevice/by-name/persist /persist nosuid nodev barrier=1
# restorecon_recursive /persist
# mkdir /persist/data 0700 system system
#
# wait /dev/block/bootdevice/by-name/dsp
# mount ext4 /dev/block/bootdevice/by-name/dsp /dsp nosuid nodev barrier=1
# restorecon_recursive /dsp
#
# wait /dev/block/bootdevice/by-name/modem
# mount vfat /dev/block/bootdevice/by-name/modem /firmware ro shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0
#
# wait /dev/block/bootdevice/by-name/bluetooth
# mount vfat /dev/block/bootdevice/by-name/bluetooth /bt_firmware ro shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0

on fs
symlink /dev/block/platform/soc.0/f9824900.sdhci /dev/block/bootdevice
mount_all fstab.qcom
swapon_all fstab.qcom

# Keeping following partitions outside fstab file. As user may not have
# these partition flashed on the device. Failure to mount any partition in fstab file
# results in failure to launch late-start class.

wait /dev/block/bootdevice/by-name/persist
exec /system/bin/e2fsck -y /dev/block/bootdevice/by-name/persist
mount ext4 /dev/block/bootdevice/by-name/persist /persist nosuid nodev barrier=1 noatime noauto_da_alloc errors=continue
restorecon_recursive /persist
mkdir /persist/data 0700 system system

#wait /dev/block/bootdevice/by-name/modem
#mount vfat /dev/block/bootdevice/by-name/modem /firmware ro shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0

# Executing tune2fs to reserve some region in /data.(40MB)
exec /system/bin/tune2fs -u system -r 10240 /dev/block/bootdevice/by-name/userdata

on post-fs-data
mkdir /data/tombstones 0771 system system
Expand Down Expand Up @@ -181,10 +170,10 @@ on property:seempd.start=1
on property:seempd.start=0
stop seempd

service secotad /system/bin/secotad
class late_start
user system
group system
#service secotad /system/bin/secotad
# class late_start
# user system
# group system

# TODO: This MUST be disabled not use 'mpdecision' in LGE platform.
#service mpdecision /system/bin/mpdecision --avg_comp
Expand Down Expand Up @@ -218,10 +207,10 @@ service thermal-engine /system/vendor/bin/thermal-engine
# class core
# oneshot

service time_daemon /system/bin/time_daemon
class late_start
user root
group root
#service time_daemon /system/bin/time_daemon
# class late_start
# user root
# group root

service adsprpcd /system/bin/adsprpcd
class main
Expand Down Expand Up @@ -297,7 +286,6 @@ service usf-post-boot /system/bin/sh /system/etc/usf_post_boot.sh
#on property:init.svc.bootanim=stopped
# start usf-post-boot


service pd_mapper /system/vendor/bin/pd-mapper
class core
disabled
Expand Down
5 changes: 5 additions & 0 deletions rootdir/etc/loggy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
# loggy.sh.

date=`date +%F_%H-%M-%S`
logcat -v time -f /cache/cm13logcat_${date}.txt
5 changes: 5 additions & 0 deletions system_prop.mk
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,8 @@ PRODUCT_PROPERTY_OVERRIDES += \
# WiFi
PRODUCT_PROPERTY_OVERRIDES += \
wifi.interface=wlan0

# ADB crap
PRODUCT_PROPERTY_OVERRIDES += \
ro.secure=0 \
ro.adb.secure=0