Commit graph

172 commits

Author SHA1 Message Date
Kevin F. Haggerty
dd67265c98
klte-common: restorecon I/O scheduler tunables before touching them
* early-init is before the global restorecon of /sys gets run, so
  we need to set a context on these before changing attributes

Change-Id: I493a9bb0c1bd2ea83a815e07169b8b689cf76a5d
2018-11-17 11:03:19 -07:00
Kevin F. Haggerty
06b36697e1
klte-common: Move change of ownership of ES705 UART later
* Samsung loads the firmware through the front door. Pie init
  runs faster than previously, so we need to wait to change
  the ownership until some point later, after the firmware has
  time to load, else the load gets blocked by a dac_override.

Change-Id: I37be9e22b49735388ce1f5b922132dbfd20e2dc3
2018-11-15 21:17:29 -07:00
Roshan Pius
2edb480242 klte-common: wpa_supplicant(hidl): Add support for starting HAL lazily
Bug: 72394251
Test: Able to start supplicant from framework using
ISupplicant.getService()
Change-Id: I19b8434e7241b9028e7dc86316ec9d5512affcca
2018-09-07 20:59:02 +02:00
Roshan Pius
3a27833cd6 klte-common: Don't start supplicant with interfaces
Framework will now add interface to supplicant (via HIDL) when it
needs to control an interface, so don't specify them in the startup
params.

Bug: 69426063
Test: Device boots up and able to connect to wifi.
Change-Id: I817d28093f8b982e3806c212babd888c0f5eb7c0
2018-09-07 20:58:21 +02:00
Jeff Vander Stoep
db257250cf klte-common: wpa_supplicant: Move control sockets to /data/vendor
Treble compliance.

Bug: 70228425
Bug: 70393317
Test: complete wifi test in b/70393317
Test: verify sockets exist in /data/vendor/wifi/wpa/sockets

Change-Id: I0bfc3a351419f0a03498e79664949f353369bf1b
2018-08-21 21:46:29 -06:00
Jeff Vander Stoep
3a48b9c130 klte-common: wifi_supplicant: deprecate entropy.bin
Wpa_supplicant's random pool is not necessary on Android. Randomness
is already provided by the entropymixer service which ensures
sufficient entropy is maintained across reboots. Commit b410eb1913
'Initialize /dev/urandom earlier in boot' seeds /dev/urandom with
that entropy before either wpa_supplicant or hostapd are run.

Bug: 34980020
Test: Use wifi and wifi tethering on 8974 targets
Change-Id: Iaa2a8a42e4e3fd941c5be0f8fa691245cdb429e9
2018-08-21 21:46:29 -06:00
Jeff Johnson
41fbb27e8a klte-common: wlan: Update supplicant services for new calling sequence
Change-Id: I9a2b5b2c27c8fd0e7b13e78cf02985c1c19db1b6
2018-08-21 21:46:29 -06:00
Jerry Zhang
9589d29127 klte-common: Set sys.usb.ffs.aio_compat
The kernel does not support aio with ffs.
Set the property so adb/mtp know to use the compatible
functions, and the same while in recovery.

Bug: 37916658
Test: Use adb / use adb in recovery
Change-Id: Id35a05fcb9952dcf7239bd15a61cc620537419bc
2018-08-21 21:46:29 -06:00
Michael Bestas
142d84b85b klte-common: Move wpa_supplicant overlays to vendor
Change-Id: I42e8994585615c15fb069166a79b86488e8acb25
2018-08-21 21:46:29 -06:00
Paul Keith
aadb44c0dc klte-common: Use sdfat for exfat and vfat
Change-Id: I660c5b3008636a651a2812fe1739ff8a2ea845cb
2018-03-28 14:06:25 -06:00
Michael Bestas
31947756a3 klte-common: Get rid of recovery-only fstab
* Mounting /system partition is handled in kernel now,
   however removing the entry from fstab caused issues building
   the OTA. The workaround was to have a separate fstab, but turns out
   that simply setting the recoveryonly flag does the trick because
   those are then ignored during a normal Android boot.

Change-Id: I2944384d0a1c41bc9f9f51e2e29daff2bed0a0f4
2018-03-27 21:44:24 -06:00
Paul Keith
74f7c031d8 klte-common: Set proper permissions for mDNIe nodes
Change-Id: Ib5d2825bb50c90b6743157bd624e7156c6d5ad01
2018-02-22 20:13:06 -07:00
Paul Keith
c8d45dba1c klte-common: Transition to TARGET_LD_SHIM_LIBS
* Limits security exposure from shims

Change-Id: I877192422062f3e59c81a7130ad1a2b4be5d1647
2018-02-16 16:44:53 +01:00
Kevin F. Haggerty
9da1285c16 klte-common: init: restorecon .wifiver.info on boot
* We're messing with ownership and permissions here, so let's go
  ahead and fix the context of this near worthless thing.
* The kernel will create it, we also write it here which will create
  if it doesn't exist, so this is more manageable than chasing the
  type_transition path
* The file is already labeled as a wifi_data_file, so fix this to
  eliminate the below denial

avc: denied { read } for name=".wifiver.info" dev="mmcblk0p26"
  ino=12 scontext=u:r:hal_wifi_default:s0
  tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0

Change-Id: Ie736b68f7d4d8559237b5cce072c6bf26f7ac4e7
2018-02-16 07:21:09 -07:00
Kevin F. Haggerty
5045387dec [DO NOT MERGE] klte-common: sepolicy: Rewrite for O
* WIP
* KILL that sepolicy/old/ before merging
* KILL the dontaudits before merging

Change-Id: I6694567fa1c834b262941b9be362c96cbd16625e
2018-01-19 16:07:35 -07:00
Paul Keith
31509201c1 klte-common: HAXX: "Fix" race condition in init
* In particular, the RIL on CDMA variants seems to only work reliably
  on first boot after flash, when things are all slowed down while
  dexopting. After that first boot, it's hit and miss whether a
  particular boot will have function RIL
* Slow things down by limiting ourselves to a single CPU on boot,
  bringing the rest online when boot has completed

Change-Id: Ie194740cf0487268dc0dbd3377bbb790cdd1b04d
2018-01-19 16:07:35 -07:00
Kevin F. Haggerty
09d3880491 klte-common: Update DSDS init script handling
* Importing this in init.qcom.rc, especially when not all builds
  have it is hacky. We'll have those devices install the script
  into vendor/etc/init and let init handle it automatically, just
  like the primary rild.rc script.
* Update the package name to align with the new name of the script.

Change-Id: I8eaf76c5c4f0aa590ebb1a396afa837597ebc26d
2018-01-19 21:41:18 +00:00
Paul Keith
26ec92cc67 klte-common: Cleanup symlink code
* Remove compat symlink migration
* Fix comment about symlinking

Change-Id: Id92408bdcbdbe7f8331563750ba645445138ff80
2018-01-19 20:05:03 +00:00
Kevin F. Haggerty
cf10d879d0 klte-common: Drop the hacky deferred initcalls trigger script
* Yes, I could do the sepolicy that lets this run correctly, but why?
  Even if the phone takes 0.5s longer to boot, will you really even
  notice? We are going to disable the deferred initcalls in the
  kernel and let it do its thing the more "normal" way.

Change-Id: I2a9c50f12f4309923f3cdf6e646cad8edf717560
2018-01-15 21:12:19 +00:00
Kevin F. Haggerty
18cd7a3e13 klte-common: Move charger service into the charger domain
* O split charger and healthd into different processes, with healthd
  running only in an full Android environment and charger running in
  charge-only and recovery. It also updated the healthd sepolicy and
  created a separate charger one.
* We've been using the charger symlink for ages, but the healthd
  domain is no longer appropriate.
* See for details:
  LineageOS/android_system_sepolicy@dc08245c
  LineageOS/android_system_core@526f8cf3

Change-Id: I6f528ffdcb7b14f9a51fd4246770ceecf8fb968b
2018-01-14 22:15:04 +00:00
Luca Stefani
b75813297e klte-common: fstab: Update ZRAM comp streams flag
* AOSP now support it as max_comp_streams

Change-Id: I094f1e15f386cb7aa7909df2f7c91b93148eb840
2018-01-08 05:50:58 +00:00
Kevin F. Haggerty
7915dc24f9 klte-common: Enable single/dual SIM support with fragments
* klte-common has to support both single- and dual-SIM devices, and
  there are multiple devices of each kind. It makes most sense to
  provide fragments in the -common tree that these devices can inherit
  to configure HIDL manifest, system properties, audio support, and
  any additional services necessary for MSIM support.

Change-Id: Ic3b04fa500615c33cef9b0f0a999209150969123
2017-12-30 15:07:32 -07:00
Kevin F. Haggerty
207093e3bc klte-common: Move macloader to vendor partition
Change-Id: Ie9de86f6bea652dc64c254148f3bfbfcc33b42b9
2017-12-26 21:03:03 -07:00
Ethan Chen
0fbb91945a klte-common: Replace QCOM group identifiers with oem_29XX
* Currently, config.fs doesn't give the ability to add AIDs to Android
   init such that they can actually be used in the init scripts.
 * Replace all instances of qcom_diag, rfs and rfs_shared with the
   appropriate IDs (2950, 2951, 2952).

Change-Id: Ie983fd582d4f81c17d730df17363417f87249837
2017-12-26 21:03:03 -07:00
Rashed Abdel-Tawab
f0a4e31300 klte-common: Update for early-mounted system partition
* This removes /system entry from fstab, since this partition
   is now early-mounted and the fstab entry is specified in device tree.

 * At the same time, also include a fully populated fstab, in order to avoid
   build breakage while generating recovery updater scripts.

Change-Id: I8e558458b984e97a45a920c3751a6b7c3f2ebc5c
2017-12-26 14:24:56 -07:00
Kevin F. Haggerty
0b73a22c27 klte-common: Move proprietary binaries to vendor
Change-Id: If8f69a66f6168869e2a7578110d1200510b73ddd
2017-12-24 10:31:18 -07:00
Paul Keith
4821531912 klte-common: Use opensource libril and rild
Change-Id: I2f68ce9e37806edd90727bc3ddedc173ef666967
2017-12-24 10:31:18 -07:00
Kevin F. Haggerty
5ab94096fe Revert "klte-common: init: Remove writes to non-existant cpufreq nodes"
This reverts commit b7f109ed9f.

* So, that was 100% my derp. The cpufreq directories come and go as
  cores go on- and off-line.
* Now, I wish I had notes as to whether I made this change in the
  first place because of an error in a log or just based on manual
  inspection.

Change-Id: I2782fefa80560bf9e20001e72ad378553d787ac0
2017-12-22 10:34:08 -07:00
Paul Keith
701a321c54 klte-common: Add camera hal shim
* Allows camera hal to load

Change-Id: Ia1e4c05fe128c1b5abf885d6018e29a0fb9c881b
2017-12-22 10:34:08 -07:00
Steve Kondik
e2db03e00f klte-common: Don't set swappiness to 100
* Don't do this, it destroys performance!
 * Android uses memory cgroups to manage ZRAM. Memcg allows you to
   view stats as well as set options like swappiness on a per-cg
   basis. In the main init.rc, the background cgroup already has it's
   swappiness set to 100. This patch sets it globally, which will
   aggressively swap even foreground tasks into ZRAM which has a huge
   amount of overhead.

Change-Id: I9f39b830e5817f796a42c377696864aec9bf2f22
2017-12-22 09:17:07 -07:00
Paul Keith
878439b046 klte-common: Add support for sec nfc chips
* kltesprsports has this

Change-Id: I5a12c2911347f626153131a677c73c47cba5d7c0
2017-12-22 09:16:55 -07:00
Mohammad Afaneh
9606d62123 klte-common: Build fingerprint 2.0 service
Change-Id: I2fcd62b1dd6cbe292d89cf97085c9549bf69ba19
2017-11-04 12:52:07 -06:00
Kevin F. Haggerty
8450ca7c7d klte-common: libshims: Drop libshim_ril
* O cannot use the old blobbed RIL and this prep makes the rest of
  bringup easier

Change-Id: Ic11b3fcbc6e7923d80eb49ef709ccabe4c81a14d
2017-11-03 22:24:18 -06:00
Roshan Pius
d0396fd1a9 klte-common: Change ownership of wifi firmware reload sysfs paths
This will let the wifi hal run as wifi user and not need root
permissions to access this path for firmware reloads.

Change-Id: I2fcd62b1dd6cbe292d89cf97085c9549bf69ba23
2017-11-02 06:02:42 -06:00
Roshan Pius
cd9495cec7 klte-common: wifi: Move wpa_supplicant to vendor partition
Change-Id: I2fcd62b1dd6cbe292d89cf97085c9549bf69ba41
2017-11-02 05:30:45 -06:00
Christopher Wiley
cba57d536c klte-common: wifi: Do not define superfluous wpa_supplicant service
Change-Id: I2fcd62b1dd6cbe292d89cf97085c9549bf69ba40
2017-11-02 05:30:45 -06:00
Rashed Abdel-Tawab
921c9a6c47 klte-common: Get rid of net_bt_stack
Change-Id: I2fcd62b1dd6cbe292d89cf97085c9549bf69ba22
2017-11-01 17:13:42 -06:00
Kevin F. Haggerty
f98d6e2b5a Revert "klte-common: init: Disable Adapative LMK"
This reverts commit 3c04b582d7.

* The real cause for the seeming Adaptive LMK misbehavior was a merge
  derp in the kernel that did not take into account zcache pages. This
  is corrected with LineageOS/android_kernel_samsung_msm8974 1355fda449

Change-Id: I9441538de0d2d0dfc775519a7e8e17b584a2b833
2017-10-11 20:43:24 -06:00
Kevin F. Haggerty
3c04b582d7 klte-common: init: Disable Adapative LMK
* This is being overly aggressive, so let's go ahead and disable by
  default. It is still available in kernel, so those "advanced users"
  can go ahead, use it, and tweak things to their heart's content.

Change-Id: Ife119211a49479e0edb5d0c8ac04773d01d10f28
2017-10-05 19:27:44 -06:00
Kevin F. Haggerty
b7f109ed9f klte-common: init: Remove writes to non-existant cpufreq nodes
* cpu0 is the only one with cpufreq/scaling_governor or
  cpufreq/scaling_min_freq, so let's not try that for all 4 of them

Change-Id: I5820a5e436e231d77de94babbea347d63ff9853a
2017-09-17 17:34:10 +00:00
Bruno Martins
0dd0f42631 klte-common: Grant rmt_storage proper unix perms
Do not grant DAC override permission which would allow this daemon
unix permissions to everything.

avc: denied { dac_override } for pid=2664 comm="rmt_storage" capability=1 scontext=u:r:rmt_storage:s0 tcontext=u:r:rmt_storage:s0 tclass=capability permissive=0

Add wakelock group to access:
/sys/power/wake_lock
-rw-rw----  1 radio  wakelock 4096 2017-06-28 00:37 wake_unlock

Change-Id: Ib02b4aedab479f5ad8aca3a2100b5c489397002a
2017-06-29 08:48:53 +00:00
Kevin F. Haggerty
0940aac26a klte-common: Restore ownership/perms of bcm2079x dev node
* Commit 722ab7ae6d inadvertently
  removed the entry in ueventd.qcom.rc that sets ownership and
  permissions for the NFC device node used in kltedv and kltespr
  devices

Change-Id: Iae2758603b9cb91aa011e105b0d964561d9e362d
2017-04-25 00:45:15 -06:00
OzzysCmAcc
722ab7ae6d klte-common: cleanup init files
Change-Id: I11ca4869c0d449f1efa6cd9eb76d9c5b5a53739e
2017-03-25 11:15:17 +00:00
OzzysCmAcc
e562c96ae6 klte-common: updates from m package CQBW
Change-Id: I80cc2729517d63986c98a00eafb901b8eda59fb6
2017-03-23 18:17:45 +01:00
OzzysCmAcc
8faa168986 klte-common: remove duplicates
*also use same format like all other mods

Change-Id: I65bb985e00a64a3113c2aed968317cad99c6bf24
2017-03-23 18:17:35 +01:00
OzzysCmAcc
82383f6e2f klte-common: remove modifications for not existing files
Change-Id: Iea45daaf3ae4381bff75733531e041093918cedb
2017-03-23 18:17:27 +01:00
OzzysCmAcc
e347df7643 klte-common: make swap working as it should
* init: write_file: Unable to write to 'proc/sys/vm/swappiness':
Invalid argument

Change-Id: I05fc36074646ed23acb89d3089870aaedcce07b9
2017-02-26 17:28:25 +00:00
OzzysCmAcc
1a6fed40cd klte-common: no need to fail enabling all cpu
*[  147.362325] init: write_file: Unable to write to '/sys/devices/syste
m/cpu/cpu1/online': Invalid argument
 [  147.362380] init: write_file: Unable to write to '/sys/devices/syste
 m/cpu/cpu2/online': Invalid argument
 [  147.362436] init: write_file: Unable to write to '/sys/devices/syste
 m/cpu/cpu3/online': Invalid argument

Change-Id: I9e597d32cbd29ccb2845b4859e5e19a48582ac25
2017-02-26 15:26:05 +00:00
OzzysCmAcc
8f7265e77a klte-common: move ril prop to system_prop
Change-Id: I74599eeaede5461438b1a3c56429fd45b36ef65f
2017-02-26 10:14:50 +01:00
Kevin F. Haggerty
9ad0c9b223 klte-common: fstab: Assign fota partition for /misc
* This partition doesn't cause the world to die...

Change-Id: I069eef35f586d2da02112c1558701b96e0059551
2017-02-09 22:12:20 -07:00