Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Create user targets #112

Open
dylangerdaly opened this issue Jul 4, 2018 · 43 comments
Open

Create user targets #112

dylangerdaly opened this issue Jul 4, 2018 · 43 comments

Comments

@dylangerdaly
Copy link

dylangerdaly commented Jul 4, 2018

Hello,

I'm wanting to compile a user build (Non userdebug, no adb root etc) however upon loading the system image the device reboots into recovery.

I haven't seen anyone compile a user build yet and wondered if it's possible?

I'm looking to have GApps + No SU as a user build (Specifically treble_arm64_agN-user), anyone know if it's possible?

If I had to guess I'd say it's SELinux, I had to comment out the permissive rule for su otherwise it'll complain.

Perhaps best route is to compile userdebug, grep avc errors and fix?

@dylangerdaly dylangerdaly changed the title treble_arm64_agN-user on Mi Mix 2S dosen't boot [Mi Mix 2S] User Builds don't Boot Jul 4, 2018
@phhusson
Copy link
Owner

phhusson commented Jul 4, 2018 via email

@dylangerdaly dylangerdaly changed the title [Mi Mix 2S] User Builds don't Boot [Mi Mix 2S] UserTarget Doesn't Boot Jul 4, 2018
@dylangerdaly dylangerdaly changed the title [Mi Mix 2S] UserTarget Doesn't Boot [Mi Mix 2S] User Target Doesn't Boot Jul 4, 2018
@dylangerdaly
Copy link
Author

Xaomi's Recovery is super restrictive, dosen't allow USB interfaces, I've tried with TWRP but I'm getting the logcat of TWRP loading, there are partitions that have like logfs, logdump, minidump etc, I wonder if it's possible to view those?

@dylangerdaly
Copy link
Author

dylangerdaly commented Jul 4, 2018

Cool sidenote, running strings on logfs gives you what you'd see on UART

~ # strings /dev/block/sda10
Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.XF.2.0-00345-SDM845LZB-1
S - IMAGE_VARIANT_STRING=SDM845LA
S - OEM_IMAGE_VERSION_STRING=c3-bsp-builder-job001.bj
S - Boot Interface: UFS
S - Secure Boot: On
S - Boot Config @ 0x00786070 = 0x000000c1
S - JTAG ID @ 0x00786130 = 0x2008b0e1
S - OEM ID @ 0x00786138 = 0x00720000
S - Serial Number @ 0x00784138 = 0xffffffff
S - Feature Config Row 0 @ 0x007841a0 = 0x0050200080000400
S - Feature Config Row 1 @ 0x007841a8 = 0xe000000000000080
S - Core 0 Frequency, 1516 MHz
S - PBL Patch Ver: 1
S - PBL freq: 600 MHZ
B -        94 - PBL, Start
...
UEFI Start     [ 1068] SEC
ASLR        : On
DEP         : Off
Timer Delta : +0 mS
RAM Entry 0 : Base 0x0000000080000000  Size 0x00000000C0000000
RAM Entry 1 : Base 0x0000000140000000  Size 0x00000000BD6C0000
UEFI Ver    : 5.0.180502.BOOT.XF.2.0-00345-SDM845LZB-1
Build Info  : 64b May  2 2018 22:39:55
Boot Device : UFS
PROD Mode   : TRUE
Retail      : TRUE
enter ffu,vendor:TOSHIBA ,product:THGAF4G9N4LBAIRB,fw_rev:0100
PM0: 20, PM1: 21, PM2: 24, 
Setvariable Logo Image returned Success
get_Panel_Id: lcd id = 0
DisplayDxe: Resolution 1080x2160 (1 intf)
get_Panel_Id: lcd id = 0
Render Splash  [ 1553]
-----------------------------
Platform Init  [ 1654] BDS
Platform   : D5X
Chip Name  : SDM845
Chip Ver   : 2.1
Core 0 Freq: 1612 MHz
-----------------------------
UEFI Total : 947 ms
POST Time      [ 2015] OS Loader
Loader Build Info: May  3 2018 02:15:31
LoadSecureApps: Load app from partition(keymaster): Status = 0x0, AppId = 1
VB: RWDeviceState: Succeed using rpmb!
 PON Reason is 129 cold_boot:1
Launching fastboot
Fastboot Build Info: May  3 2018 02:15:24
PLL1 locked: 5
usb_lane: 0
Fastboot: Initializing...

@dylangerdaly
Copy link
Author

Getting back on topic, resetting logfs shows us the following

UEFI Start     [ 1074] SEC
ASLR        : On
DEP         : Off
Timer Delta : +0 mS
RAM Entry 0 : Base 0x0000000080000000  Size 0x00000000C0000000
RAM Entry 1 : Base 0x0000000140000000  Size 0x00000000BD6C0000
UEFI Ver    : 5.0.180502.BOOT.XF.2.0-00345-SDM845LZB-1
Build Info  : 64b May  2 2018 22:39:55
Boot Device : UFS
PROD Mode   : TRUE
Retail      : TRUE
enter ffu,vendor:TOSHIBA ,product:THGAF4G9N4LBAIRB,fw_rev:0100
PM0: 20, PM1: 21, PM2: 24, 
Setvariable Logo Image returned Success
get_Panel_Id: lcd id = 0
DisplayDxe: Resolution 1080x2160 (1 intf)
get_Panel_Id: lcd id = 0
Render Splash  [ 1559]
-----------------------------
Platform Init  [ 1660] BDS
Platform   : D5X
Chip Name  : SDM845
Chip Ver   : 2.1
Core 0 Freq: 1612 MHz
-----------------------------
UEFI Total : 609 ms
POST Time      [ 1684] OS Loader
Loader Build Info: May  3 2018 02:15:31
LoadSecureApps: Load app from partition(keymaster): Status = 0x0, AppId = 1
VB: RWDeviceState: Succeed using rpmb!
 PON Reason is 33 cold_boot:1
Booting Into Mission Mode
Loading Image Start : 1839 ms
Loading Image Done : 1839 ms
Total Image Read size : 4096 Bytes
Loading Image Start : 1839 ms
Loading Image Done : 1900 ms
Total Image Read size : 32886784 Bytes
VB: DeviceInit: Device is unlocked! Skipping verification!
VB: VerifyImage: Image verification done! boot state is: ORANGE
DisplayFastbootLogo: Fastboot Logo Successfully Loaded
display picture 3  [ 1940]
No Ffbm cookie found, ignore: Not Found
Memory Base Address: 0x80000000
Decompressing kernel image start: 1942 ms
Decompressing kernel image done: 2212 ms
VB: readDebugPolicy: ScmSipSysCall Status: (0x7)
Error Get DebugPolicy: Device Error
Cmdline: console=ttyMSM0,115200n8 earlycon=msm_geni_serial,0xA84000 androidboot.hardware=qcom androidboot.console=ttyMSM0 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 sw
BootLinux: GetImage failed!model does not exist in device tree
Memory Base Address: 0x80000000
Best match DTB tags 321/0000002C/0x00000000/20001/20014/20115/20018/0/(offset)0x987C5B5E/(size)0x0006F513
Using pmic info 0x20014/0x20115/0x20018/0x0 for device 0x20014/0x20115/0x20018/0x0
Memory Base Address: 0x80000000
RAM Partitions
Add Base: 0x0000000080000000 Available Length: 0x00000000C0000000 
Add Base: 0x0000000140000000 Available Length: 0x00000000BD6C0000 
ERROR: Could not get splash memory region node
kaslr-Seed is added to chosen node
pureason = 40021
Shutting Down UEFI Boot Services: 2301 ms
Save LogFile=UefiLog0.txt to LogFs

Error seems to be

BootLinux: GetImage failed!model does not exist in device tree

@phhusson
Copy link
Owner

phhusson commented Jul 4, 2018

I was thinking adb from the GSI itself. Do you see some bootanimation or not at all?
With a user build you won't have adb by default, add persist.sys.usb.config=mtp,adb to your system.prop

@dylangerdaly
Copy link
Author

No Animation, userdebug it works.

Does the GSI have a DTB Compiled into it or something?

@phhusson
Copy link
Owner

phhusson commented Jul 4, 2018

no

@dylangerdaly
Copy link
Author

Also when compiling user target I the su SELinux policy is being included

device/phh/treble/sepolicy/su.te

This this be excluded on user builds?

@phhusson
Copy link
Owner

phhusson commented Jul 4, 2018

No, this selinux context is used by some custom services
But its presence shouldn't prevent boot

@dylangerdaly
Copy link
Author

I'm getting no Boot Anim, I've enabled adb however I can't confirm the dialog

→ sudo ./adb devices                                                                                                          
List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully
6e229a6b	unauthorized

@phhusson
Copy link
Owner

phhusson commented Jul 5, 2018

Edit system/core/adb/adbd_auth.cpp and change auth_required to false

@dylangerdaly
Copy link
Author

Awesome, cheers for that

This is the logcat:

03-20 00:49:34.912  2382  2382 F DEBUG   : Build fingerprint: 'Android/treble_arm64_agN/phhgsi_arm64_a:8.1.0/OPM2.171026.006/build07042030:user/test-keys'
03-20 00:49:34.912  2382  2382 F DEBUG   : Revision: '0'
03-20 00:49:34.912  2382  2382 F DEBUG   : ABI: 'arm64'
03-20 00:49:34.912  2382  2382 F DEBUG   : pid: 2372, tid: 2372, name: vendor.qti.gnss  >>> /vendor/bin/hw/[email protected] <<<
03-20 00:49:34.912  2382  2382 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
03-20 00:49:34.912  2382  2382 F DEBUG   : Abort message: 'CANNOT LINK EXECUTABLE "/vendor/bin/hw/[email protected]": library "[email protected]" not found'
03-20 00:49:34.912  2382  2382 F DEBUG   :     x0   0000000000000000  x1   0000000000000944  x2   0000000000000006  x3   0000000000000008
03-20 00:49:34.912  2382  2382 F DEBUG   :     x4   0080000000808080  x5   0080000000808080  x6   0080000000808080  x7   0000000000000010
03-20 00:49:34.912  2382  2382 F DEBUG   :     x8   0000000000000083  x9   41068d5fc00e82e9  x10  0000000000000000  x11  0000000000000001
03-20 00:49:34.912  2382  2382 F DEBUG   :     x12  ffffffffffffffff  x13  000000000066701e  x14  0033db2572b2ba00  x15  0000abab8ce99167
03-20 00:49:34.912  2382  2382 F DEBUG   :     x16  0000000000000000  x17  06ec616b53b36179  x18  00000073a7234ab0  x19  0000000000000944
03-20 00:49:34.912  2382  2382 F DEBUG   :     x20  0000000000000944  x21  0000005f98a1d839  x22  0000007fcdb205f8  x23  0000005f98a1fef0
03-20 00:49:34.912  2382  2382 F DEBUG   :     x24  00000073a72335c8  x25  00000073a733d3d0  x26  00000073a733d7b0  x27  00000073a733d000
03-20 00:49:34.912  2382  2382 F DEBUG   :     x28  0000007fcdb205f0  x29  0000007fcdb1f2d0  x30  00000073a72e0fc0
03-20 00:49:34.912  2382  2382 F DEBUG   :     sp   0000007fcdb1f290  pc   00000073a72e0fdc  pstate 0000000060000000
03-20 00:49:34.912  2382  2382 F DEBUG   : 
03-20 00:49:34.912  2382  2382 F DEBUG   : backtrace:
03-20 00:49:34.912  2382  2382 F DEBUG   :     #00 pc 000000000009dfdc  /system/bin/linker64 (__dl_abort+104)
03-20 00:49:34.912  2382  2382 F DEBUG   :     #01 pc 000000000001cb10  /system/bin/linker64 (__dl___linker_init+3624)
03-20 00:49:34.912  2382  2382 F DEBUG   :     #02 pc 0000000000022fc0  /system/bin/linker64 (_start+4)
03-20 00:49:34.914  2382  2382 E crash_dump64: unable to connect to activity manager: No such file or directory
03-20 00:49:34.915  2368  2368 I Netd    : Creating child chains: 22.5ms
03-20 00:49:34.915  2368  2368 I Netd    : Setting up OEM hooks: 0.1ms
03-20 00:49:34.916  2383  2383 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
03-20 00:49:34.916  2383  2383 E libc    : failed to connect to tombstoned: No such file or directory
03-20 00:49:34.916  2383  2383 I crash_dump32: performing dump of process 2369 (target tid = 2369)
03-20 00:49:34.916  2383  2383 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-20 00:49:34.916  2383  2383 F DEBUG   : Build fingerprint: 'Android/treble_arm64_agN/phhgsi_arm64_a:8.1.0/OPM2.171026.006/build07042030:user/test-keys'
03-20 00:49:34.916  2383  2383 F DEBUG   : Revision: '0'
03-20 00:49:34.916  2383  2383 F DEBUG   : ABI: 'arm'
03-20 00:49:34.916  2383  2383 F DEBUG   : pid: 2369, tid: 2369, name: android.hardwar  >>> /vendor/bin/hw/[email protected] <<<
03-20 00:49:34.916  2383  2383 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
03-20 00:49:34.917  2383  2383 F DEBUG   : Abort message: 'CANNOT LINK EXECUTABLE "/vendor/bin/hw/[email protected]": library "libmediacodecservice.so" not found'
03-20 00:49:34.917  2383  2383 F DEBUG   :     r0 00000000  r1 00000941  r2 00000006  r3 00000008
03-20 00:49:34.917  2383  2383 F DEBUG   :     r4 00000941  r5 00000941  r6 fffd3a2c  r7 0000010c
03-20 00:49:34.917  2383  2383 F DEBUG   :     r8 00000000  r9 fffd4ccc  sl fffd4cc4  fp 00000000
03-20 00:49:34.917  2383  2383 F DEBUG   :     ip fffd3a50  sp fffd3a18  lr ee296627  pc ee294af8  cpsr 200f0030
03-20 00:49:34.917  2383  2383 F DEBUG   : 
03-20 00:49:34.917  2383  2383 F DEBUG   : backtrace:
03-20 00:49:34.917  2383  2383 F DEBUG   :     #00 pc 0005faf8  /system/bin/linker (__dl_abort+63)
03-20 00:49:34.917  2383  2383 F DEBUG   :     #01 pc 0001028f  /system/bin/linker (__dl___linker_init+2806)
03-20 00:49:34.917  2383  2383 F DEBUG   :     #02 pc 00014ff0  /system/bin/linker (_start+4)
03-20 00:49:34.918  2368  2368 I Netd    : Setting up FirewallController hooks: 2.6ms
03-20 00:49:34.919  2383  2383 E crash_dump32: unable to connect to activity manager: No such file or directory
03-20 00:49:34.919  2368  2368 I Netd    : Setting up NatController hooks: 1.7ms
03-20 00:49:34.920  2368  2368 I Netd    : Setting up BandwidthController hooks: 1.2ms
03-20 00:49:34.920  2368  2368 I Netd    : Setting up IdletimerController hooks: 0.0ms
03-20 00:49:34.923  2368  2368 I Netd    : Disabling bandwidth control: 2.2ms
03-20 00:49:34.923  2368  2368 E Netd    : Error adding route 0.0.0.0/0 -> (null) dummy0 to table 1003: File exists
03-20 00:49:34.923  2368  2368 E /system/bin/netd: android::WriteStringToFile open failed: No such file or directory
03-20 00:49:34.923  2368  2368 E Netd    : failed to write to /data/misc/net/rt_tables (No such file or directory)
03-20 00:49:34.923  2368  2368 I Netd    : Initializing RouteController: 0.5ms
03-20 00:49:34.923  2368  2368 E Netd    : Unable to create netlink socket: Protocol not supported
03-20 00:49:34.923  2368  2368 W Netd    : Unable to open qlog quota socket, check if xt_quota2 can send via UeventHandler
03-20 00:49:34.924  2368  2368 D MDnsDS  : MDnsSdListener::Hander starting up
03-20 00:49:34.924  2368  2368 I Netd    : Registering NetdNativeService: 0.5ms
03-20 00:49:34.924  2368  2368 I Netd    : Starting CommandListener: 0.0ms
03-20 00:49:34.924  2368  2368 E Netd    : Unable to create pid file (No such file or directory)
03-20 00:49:34.925  2368  2389 D MDnsDS  : MDnsSdListener starting to monitor
03-20 00:49:34.925  2368  2389 D MDnsDS  : Going to poll with pollCount 1
03-20 00:49:34.926  2368  2368 I Netd    : Registering NetdHwService: 1.4ms
03-20 00:49:34.926  2368  2368 I Netd    : Netd started in 34ms
03-20 00:49:34.937  2397  2397 F libc    : CANNOT LINK EXECUTABLE "/vendor/bin/ATFWD-daemon": library "[email protected]" not found
03-20 00:49:34.937  2397  2397 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 2397 (ATFWD-daemon), pid 2397 (ATFWD-daemon)
03-20 00:49:34.938  2396  2396 F libc    : CANNOT LINK EXECUTABLE "/vendor/bin/qvop-daemon": library "[email protected]" not found
03-20 00:49:34.938  2396  2396 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 2396 (qvop-daemon), pid 2396 (qvop-daemon)
03-20 00:49:34.942  2399  2399 I /system/bin/tombstoned: tombstoned successfully initialized
03-20 00:49:34.946  2403  2403 E cutils-trace: Error opening trace file: Permission denied (13)
03-20 00:49:34.946  2398  2398 I gatekeeperd: Starting gatekeeperd...
03-20 00:49:34.946  2398  2398 E gatekeeperd: chdir: /data/misc/gatekeeper: No such file or directory
03-20 00:49:34.947  2401  2401 E cutils-trace: Error opening trace file: Permission denied (13)
03-20 00:49:34.948  2404  2404 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
03-20 00:49:34.948  2399  2399 I /system/bin/tombstoned: received crash request for pid 2396
03-20 00:49:34.949  2399  2399 F /system/bin/tombstoned: tombstoned.cpp:125] failed to create tombstone at /data/tombstones/tombstone_00: No such file or directory
03-20 00:49:34.949  2399  2399 E /system/bin/tombstoned: received fatal signal 6
03-20 00:49:34.949  2404  2404 E libc    : received DumpRequest response packet of incorrect length (expected 12, got 0)
03-20 00:49:34.949  2404  2404 I crash_dump64: performing dump of process 2396 (target tid = 2396)
03-20 00:49:34.949  2404  2404 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-20 00:49:34.949  2404  2404 F DEBUG   : Build fingerprint: 'Android/treble_arm64_agN/phhgsi_arm64_a:8.1.0/OPM2.171026.006/build07042030:user/test-keys'
03-20 00:49:34.949  2404  2404 F DEBUG   : Revision: '0'
03-20 00:49:34.949  2404  2404 F DEBUG   : ABI: 'arm64'
03-20 00:49:34.949  2404  2404 F DEBUG   : pid: 2396, tid: 2396, name: qvop-daemon  >>> /vendor/bin/qvop-daemon <<<
03-20 00:49:34.949  2404  2404 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
03-20 00:49:34.949  2404  2404 F DEBUG   : Abort message: 'CANNOT LINK EXECUTABLE "/vendor/bin/qvop-daemon": library "[email protected]" not found'
03-20 00:49:34.949  2404  2404 F DEBUG   :     x0   0000000000000000  x1   000000000000095c  x2   0000000000000006  x3   0000000000000008
03-20 00:49:34.949  2404  2404 F DEBUG   :     x4   0000000000000000  x5   0000000000000000  x6   0000000000000000  x7   0000000000000038
03-20 00:49:34.949  2404  2404 F DEBUG   :     x8   0000000000000083  x9   ed04a9a5fd3cbaa3  x10  0000000000000000  x11  0000000000000001
03-20 00:49:34.949  2404  2404 F DEBUG   :     x12  ffffffffffffffff  x13  000000000066701e  x14  00376eac72acde00  x15  00007c34abe9df2b
03-20 00:49:34.949  2404  2404 F DEBUG   :     x16  0000000000000000  x17  0290ddb116aa7aa6  x18  0000007dc362c230  x19  000000000000095c
03-20 00:49:34.949  2404  2404 F DEBUG   :     x20  000000000000095c  x21  0000005c8ec03cc9  x22  0000007fcd281748  x23  0000005c8ec06e90
03-20 00:49:34.949  2404  2404 F DEBUG   :     x24  0000007dc362b5c8  x25  0000007dc37353d0  x26  0000007dc37357b0  x27  0000007dc3735000
03-20 00:49:34.949  2404  2404 F DEBUG   :     x28  0000007fcd281740  x29  0000007fcd280420  x30  0000007dc36d8fc0
03-20 00:49:34.949  2404  2404 F DEBUG   :     sp   0000007fcd2803e0  pc   0000007dc36d8fdc  pstate 0000000060000000
03-20 00:49:34.950  2404  2404 F DEBUG   : 
03-20 00:49:34.950  2404  2404 F DEBUG   : backtrace:
03-20 00:49:34.950  2404  2404 F DEBUG   :     #00 pc 000000000009dfdc  /system/bin/linker64 (__dl_abort+104)
03-20 00:49:34.950  2404  2404 F DEBUG   :     #01 pc 000000000001cb10  /system/bin/linker64 (__dl___linker_init+3624)
03-20 00:49:34.950  2404  2404 F DEBUG   :     #02 pc 0000000000022fc0  /system/bin/linker64 (_start+4)
03-20 00:49:34.954  2404  2404 E crash_dump64: unable to connect to activity manager: No such file or directory
03-20 00:49:34.955  2405  2405 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
03-20 00:49:34.955  2405  2405 E libc    : failed to connect to tombstoned: No such file or directory
03-20 00:49:34.955  2405  2405 I crash_dump64: performing dump of process 2397 (target tid = 2397)
03-20 00:49:34.956  2405  2405 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-20 00:49:34.956  2405  2405 F DEBUG   : Build fingerprint: 'Android/treble_arm64_agN/phhgsi_arm64_a:8.1.0/OPM2.171026.006/build07042030:user/test-keys'
03-20 00:49:34.956  2405  2405 F DEBUG   : Revision: '0'
03-20 00:49:34.956  2405  2405 F DEBUG   : ABI: 'arm64'
03-20 00:49:34.956  2405  2405 F DEBUG   : pid: 2397, tid: 2397, name: ATFWD-daemon  >>> /vendor/bin/ATFWD-daemon <<<
03-20 00:49:34.956  2405  2405 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
03-20 00:49:34.956  2405  2405 F DEBUG   : Abort message: 'CANNOT LINK EXECUTABLE "/vendor/bin/ATFWD-daemon": library "[email protected]" not found'
03-20 00:49:34.956  2405  2405 F DEBUG   :     x0   0000000000000000  x1   000000000000095d  x2   0000000000000006  x3   0000000000000008
03-20 00:49:34.956  2405  2405 F DEBUG   :     x4   0000000000000000  x5   0000000000000000  x6   0000000000000000  x7   0000000000000040
03-20 00:49:34.956  2405  2405 F DEBUG   :     x8   0000000000000083  x9   ebbcdc6c13d2cecd  x10  0000000000000000  x11  0000000000000001
03-20 00:49:34.956  2405  2405 F DEBUG   :     x12  ffffffffffffffff  x13  000000000066701e  x14  00376eac72acde00  x15  00007153d73f4653
03-20 00:49:34.956  2405  2405 F DEBUG   :     x16  0000000000000000  x17  02c5cd261dbc2b43  x18  000000739f128450  x19  000000000000095d
03-20 00:49:34.956  2405  2405 F DEBUG   :     x20  000000000000095d  x21  00000055fb186fdc  x22  0000007fc2a13738  x23  00000055fb18cd90
03-20 00:49:34.956  2405  2405 F DEBUG   :     x24  000000739f1275c8  x25  000000739f2313d0  x26  000000739f2317b0  x27  000000739f231000
03-20 00:49:34.956  2405  2405 F DEBUG   :     x28  0000007fc2a13730  x29  0000007fc2a12410  x30  000000739f1d4fc0
03-20 00:49:34.956  2405  2405 F DEBUG   :     sp   0000007fc2a123d0  pc   000000739f1d4fdc  pstate 0000000060000000
03-20 00:49:34.957  2405  2405 F DEBUG   : 
03-20 00:49:34.957  2405  2405 F DEBUG   : backtrace:
03-20 00:49:34.957  2405  2405 F DEBUG   :     #00 pc 000000000009dfdc  /system/bin/linker64 (__dl_abort+104)
03-20 00:49:34.957  2405  2405 F DEBUG   :     #01 pc 000000000001cb10  /system/bin/linker64 (__dl___linker_init+3624)
03-20 00:49:34.957  2405  2405 F DEBUG   :     #02 pc 0000000000022fc0  /system/bin/linker64 (_start+4)
03-20 00:49:34.959  2405  2405 E crash_dump64: unable to connect to activity manager: No such file or directory
03-20 00:49:34.978  2351  2351 I cameraserver: ServiceManager: 0xef1999c0
03-20 00:49:34.978  2351  2351 I CameraService: CameraService started (pid=2351)
03-20 00:49:34.978  2351  2351 I CameraService: CameraService process starting
03-20 00:49:34.978  2351  2351 W BatteryNotifier: batterystats service unavailable!
03-20 00:49:34.978  2351  2351 W BatteryNotifier: batterystats service unavailable!
03-20 00:49:34.978  2351  2351 E cutils-trace: Error opening trace file: Permission denied (13)
03-20 00:49:35.016  2363  2363 F appproc : Error creating cache dir /data/dalvik-cache/arm64 : No such file or directory
03-20 00:49:35.016  2363  2363 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 2363 (app_process64), pid 2363 (app_process64)
03-20 00:49:35.024  2410  2410 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
03-20 00:49:35.024  2410  2410 E libc    : failed to connect to tombstoned: No such file or directory
03-20 00:49:35.024  2410  2410 I crash_dump64: performing dump of process 2363 (target tid = 2363)
03-20 00:49:35.024  2410  2410 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-20 00:49:35.024  2410  2410 F DEBUG   : Build fingerprint: 'Android/treble_arm64_agN/phhgsi_arm64_a:8.1.0/OPM2.171026.006/build07042030:user/test-keys'
03-20 00:49:35.024  2410  2410 F DEBUG   : Revision: '0'
03-20 00:49:35.024  2410  2410 F DEBUG   : ABI: 'arm64'
03-20 00:49:35.024  2410  2410 F DEBUG   : pid: 2363, tid: 2363, name: app_process64  >>> /system/bin/app_process64 <<<
03-20 00:49:35.024  2410  2410 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
03-20 00:49:35.025  2410  2410 F DEBUG   : Abort message: 'Error creating cache dir /data/dalvik-cache/arm64 : No such file or directory'
03-20 00:49:35.025  2410  2410 F DEBUG   :     x0   0000000000000000  x1   000000000000093b  x2   0000000000000006  x3   0000000000000008
03-20 00:49:35.025  2410  2410 F DEBUG   :     x4   0000000000000000  x5   0000000000000000  x6   0000000000000000  x7   7f7f7f7f7f7f7f7f
03-20 00:49:35.025  2410  2410 F DEBUG   :     x8   0000000000000083  x9   f9066b1ce1b93516  x10  0000000000000000  x11  0000000000000000
03-20 00:49:35.025  2410  2410 F DEBUG   :     x12  0000000000000000  x13  0000000000000000  x14  ff00000000000000  x15  ffffffffffffffff
03-20 00:49:35.025  2410  2410 F DEBUG   :     x16  000000653e384fa8  x17  0000007d39a78ed8  x18  0000007d39fa6a1a  x19  000000000000093b
03-20 00:49:35.025  2410  2410 F DEBUG   :     x20  000000000000093b  x21  0000007fcbcdfeb8  x22  0000000000000001  x23  0000000000000000
03-20 00:49:35.025  2410  2410 F DEBUG   :     x24  000000653e384ad0  x25  0000000000000001  x26  0000007d3afb7a40  x27  0000007fcbcdeda0
03-20 00:49:35.025  2410  2410 F DEBUG   :     x28  0000000000000005  x29  0000007fcbcde7c0  x30  0000007d39a2e9ec
03-20 00:49:35.025  2410  2410 F DEBUG   :     sp   0000007fcbcde780  pc   0000007d39a2ea08  pstate 0000000060000000
03-20 00:49:35.026  2410  2410 F DEBUG   : 
03-20 00:49:35.026  2410  2410 F DEBUG   : backtrace:
03-20 00:49:35.026  2410  2410 F DEBUG   :     #00 pc 000000000001da08  /system/lib64/libc.so (abort+104)
03-20 00:49:35.026  2410  2410 F DEBUG   :     #01 pc 0000000000007f20  /system/lib64/liblog.so (__android_log_assert+304)
03-20 00:49:35.026  2410  2410 F DEBUG   :     #02 pc 000000000000264c  /system/bin/app_process64 (main+1852)
03-20 00:49:35.026  2410  2410 F DEBUG   :     #03 pc 00000000000a143c  /system/lib64/libc.so (__libc_init+88)
03-20 00:49:35.026  2410  2410 F DEBUG   :     #04 pc 0000000000001e70  /system/bin/app_process64 (_start_main+80)
03-20 00:49:35.033  2410  2410 E crash_dump64: unable to connect to activity manager: No such file or directory
03-20 00:49:35.036   566   566 E hw-IPCThreadState: attemptIncStrongHandle(23): Not supported
03-20 00:49:35.036   566   566 I chatty  : uid=1000(system) hwservicemanage identical 2 lines
03-20 00:49:35.036   566   566 E hw-IPCThreadState: attemptIncStrongHandle(23): Not supported
03-20 00:49:35.041   566   566 E hw-IPCThreadState: attemptIncStrongHandle(26): Not supported
03-20 00:49:35.041   566   566 I chatty  : uid=1000(system) hwservicemanage identical 1 line
03-20 00:49:35.041   566   566 E hw-IPCThreadState: attemptIncStrongHandle(26): Not supported
03-20 00:49:35.046   565   565 I ServiceManager: service 'media.player' died
03-20 00:49:35.046   565   565 I ServiceManager: service 'media.resource_manager' died
03-20 00:49:35.052   565   565 I ServiceManager: service 'netd' died
03-20 00:49:35.052   566   566 E hw-IPCThreadState: attemptIncStrongHandle(24): Not supported
03-20 00:49:35.056   565   565 I ServiceManager: service 'wificond' died
03-20 00:49:35.065  2411  2411 F libc    : CANNOT LINK EXECUTABLE "/vendor/bin/hw/[email protected]": library "[email protected]" not found
03-20 00:49:35.065  2411  2411 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 2411 (android.hardwar), pid 2411 (android.hardwar)
03-20 00:49:35.070  2413  2413 E cutils-trace: Error opening trace file: Permission denied (13)
03-20 00:49:35.071  2415  2415 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
03-20 00:49:35.071  2415  2415 E libc    : failed to connect to tombstoned: No such file or directory
03-20 00:49:35.071  2415  2415 I crash_dump32: performing dump of process 2411 (target tid = 2411)
03-20 00:49:35.072  2415  2415 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-20 00:49:35.072  2415  2415 F DEBUG   : Build fingerprint: 'Android/treble_arm64_agN/phhgsi_arm64_a:8.1.0/OPM2.171026.006/build07042030:user/test-keys'
03-20 00:49:35.072  2415  2415 F DEBUG   : Revision: '0'
03-20 00:49:35.072  2415  2415 F DEBUG   : ABI: 'arm'
03-20 00:49:35.072  2415  2415 F DEBUG   : pid: 2411, tid: 2411, name: android.hardwar  >>> /vendor/bin/hw/[email protected] <<<
03-20 00:49:35.072  2415  2415 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
03-20 00:49:35.072  2415  2415 F DEBUG   : Abort message: 'CANNOT LINK EXECUTABLE "/vendor/bin/hw/[email protected]": library "[email protected]" not found'
03-20 00:49:35.072  2415  2415 F DEBUG   :     r0 00000000  r1 0000096b  r2 00000006  r3 00000008
03-20 00:49:35.072  2415  2415 F DEBUG   :     r4 0000096b  r5 0000096b  r6 ff8696ec  r7 0000010c
03-20 00:49:35.072  2415  2415 F DEBUG   :     r8 00000000  r9 ff86a98c  sl ff86a984  fp 00000000
03-20 00:49:35.072  2415  2415 F DEBUG   :     ip ff869710  sp ff8696d8  lr f599a627  pc f5998af8  cpsr 200f0030
03-20 00:49:35.072  2415  2415 F DEBUG   : 
03-20 00:49:35.072  2415  2415 F DEBUG   : backtrace:
03-20 00:49:35.072  2415  2415 F DEBUG   :     #00 pc 0005faf8  /system/bin/linker (__dl_abort+63)
03-20 00:49:35.072  2415  2415 F DEBUG   :     #01 pc 0001028f  /system/bin/linker (__dl___linker_init+2806)
03-20 00:49:35.072  2415  2415 F DEBUG   :     #02 pc 00014ff0  /system/bin/linker (_start+4)
03-20 00:49:35.074  2415  2415 E crash_dump32: unable to connect to activity manager: No such file or directory
03-20 00:49:35.158  2418  2418 E cutils-trace: Error opening trace file: Permission denied (13)
03-20 00:49:35.159  2418  2418 D vndksupport: Loading /vendor/lib64/hw/[email protected] from current namespace instead of sphal namespace.
03-20 00:49:35.160  2418  2418 D vndksupport: Loading /vendor/lib64/hw/hwcomposer.sdm845.so from current namespace instead of sphal namespace.
03-20 00:49:35.161  2419  2419 I Dpps    : GetInstance: DppsServer ref count increased to 1
03-20 00:49:35.161  2419  2419 I Dpps    : GetAdClientInterface():463 AD not supported
03-20 00:49:35.161  2419  2419 I Dpps    : GetAbaClientInterface():513 Aba not supported
03-20 00:49:35.161  2418  2418 E HAL     : load: module=/vendor/lib64/hw/hwcomposer.sdm845.so
03-20 00:49:35.161  2418  2418 E HAL     : dlopen failed: library "[email protected]" not found
03-20 00:49:35.161  2418  2418 E HwcPassthrough: failed to get hwcomposer module
03-20 00:49:35.161  2418  2418 E [email protected]: Could not get passthrough implementation for [email protected]::IComposer/default.
03-20 00:49:35.162  2417  2417 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x58 in tid 2417 (netmgrd), pid 2417 (netmgrd)
03-20 00:49:35.167   566   566 E hw-IPCThreadState: attemptIncStrongHandle(22): Not supported
03-20 00:49:35.167   566   566 E hw-IPCThreadState: attemptIncStrongHandle(22): Not supported
03-20 00:49:35.167  2424  2424 E cutils-trace: Error opening trace file: Permission denied (13)
03-20 00:49:35.168  2425  2425 W crash_dump64: failed to attach to thread 2422: Operation not permitted
03-20 00:49:35.169  2425  2425 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
03-20 00:49:35.169  2425  2425 E libc    : failed to connect to tombstoned: No such file or directory
03-20 00:49:35.169  2425  2425 I crash_dump64: performing dump of process 2417 (target tid = 2417)
03-20 00:49:35.169  2425  2425 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-20 00:49:35.169  2425  2425 F DEBUG   : Build fingerprint: 'Android/treble_arm64_agN/phhgsi_arm64_a:8.1.0/OPM2.171026.006/build07042030:user/test-keys'
03-20 00:49:35.169  2425  2425 F DEBUG   : Revision: '0'
03-20 00:49:35.169  2425  2425 F DEBUG   : ABI: 'arm64'
03-20 00:49:35.169  2425  2425 F DEBUG   : pid: 2417, tid: 2417, name: netmgrd  >>> /system/vendor/bin/netmgrd <<<
03-20 00:49:35.169  2425  2425 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x58
03-20 00:49:35.169  2425  2425 F DEBUG   : Cause: null pointer dereference
03-20 00:49:35.169  2425  2425 F DEBUG   :     x0   0000000000000000  x1   0000007fe8c0c788  x2   0000000000000004  x3   0000000000000000
03-20 00:49:35.169  2425  2425 F DEBUG   :     x4   0000000000000008  x5   0000000000000020  x6   fefefefefefefeff  x7   7f7f7f7f7f7f7f7f
03-20 00:49:35.169  2425  2425 F DEBUG   :     x8   000000722dfa9190  x9   c3b30a87a4318da6  x10  0000000000000000  x11  0000007fe8c0c778
03-20 00:49:35.169  2425  2425 F DEBUG   :     x12  0000007fe8c0c7c0  x13  0000007fe8c0c6c0  x14  0000007fe8c0c748  x15  000000722d5ac504
03-20 00:49:35.169  2425  2425 F DEBUG   :     x16  00000058e5bfeda0  x17  000000722d557530  x18  c3b30a87a4318da6  x19  0000000000000000
03-20 00:49:35.169  2425  2425 F DEBUG   :     x20  0000000000000001  x21  00000058e5bc7769  x22  0000007fe8c0ceb8  x23  0000000000000000
03-20 00:49:35.169  2425  2425 F DEBUG   :     x24  0000000000000000  x25  0000000000000000  x26  0000000000000000  x27  0000000000000000
03-20 00:49:35.169  2425  2425 F DEBUG   :     x28  0000000000000000  x29  0000007fe8c0c800  x30  00000058e5b17bb4
03-20 00:49:35.169  2425  2425 F DEBUG   :     sp   0000007fe8c0c7f0  pc   000000722d557540  pstate 0000000060000000
03-20 00:49:35.171  2425  2425 F DEBUG   : 
03-20 00:49:35.171  2425  2425 F DEBUG   : backtrace:
03-20 00:49:35.171  2425  2425 F DEBUG   :     #00 pc 0000000000076540  /system/lib64/libc.so (fileno+16)
03-20 00:49:35.171  2425  2425 F DEBUG   :     #01 pc 000000000007cbb0  /vendor/bin/netmgrd (netmgr_main+876)
03-20 00:49:35.172  2425  2425 E crash_dump64: unable to connect to activity manager: No such file or directory
03-20 00:49:35.185  2426  2426 E cutils-trace: Error opening trace file: Permission denied (13)
03-20 00:49:35.186  2426  2426 D vndksupport: Loading /vendor/lib64/hw/[email protected] from current namespace instead of sphal namespace.
03-20 00:49:35.187  2426  2426 D vndksupport: Loading /vendor/lib64/hw/hwcomposer.sdm845.so from current namespace instead of sphal namespace.
03-20 00:49:35.188  2426  2426 E HAL     : load: module=/vendor/lib64/hw/hwcomposer.sdm845.so
03-20 00:49:35.188  2426  2426 E HAL     : dlopen failed: library "[email protected]" not found
03-20 00:49:35.188  2426  2426 E HwcPassthrough: failed to get hwcomposer module
03-20 00:49:35.188  2426  2426 E [email protected]: Could not get passthrough implementation for [email protected]::IComposer/default.
03-20 00:49:35.189  2427  2427 I Dpps    : GetInstance: DppsServer ref count increased to 1
03-20 00:49:35.189  2427  2427 I Dpps    : GetAdClientInterface():463 AD not supported
03-20 00:49:35.189  2427  2427 I Dpps    : GetAbaClientInterface():513 Aba not supported
03-20 00:49:35.593   625   630 W vold    : Waited one second for [email protected]::IKeymasterDevice/default. Waiting another...

@phhusson
Copy link
Owner

phhusson commented Jul 5, 2018

Can you give me, in adb shell:
echo $LD_CONFIG_FILE
getprop persist.sys.vndk
And give me kernel logs with phh-su 0 dmesg

@dylangerdaly
Copy link
Author

dylangerdaly commented Jul 5, 2018

Sure

130|phhgsi_arm64_a:/ $ echo $LD_CONFIG_FILE
/system/etc/ld.config.26.txt
phhgsi_arm64_a:/ $ getprop persist.sys.vndk
26

phh-su isn't being compiled I don't think

phhgsi_arm64_a:/ $ phh-su 0 dmesg
/system/bin/sh: phh-su: not found

@phhusson
Copy link
Owner

phhusson commented Jul 5, 2018

Ah right
Edit bionic/linker/Android.bp

Change product_variables: {
debuggable: {
cppflags: ["-DUSE_LD_CONFIG_FILE"],
},
},

cppflags: ["-Wold-style-cast"],

to
cppflags: ["-Wold-style-cast", "-DUSE_LD_CONFIG_FILE"],

then touch bionic/linker/linker.cpp to force rebuild, and remake

@dylangerdaly
Copy link
Author

Awesome! Progress is being made, I'm now seeing the Boot Animation

Hitting this error now:

03-20 01:55:44.633  1909  1909 E crash_dump64: unable to connect to activity manager: No such file or directory
03-20 01:55:44.699  1910  1910 E /vendor/bin/hw/[email protected]: Failed to dlopen [email protected]: dlopen failed: library "[email protected]" not found
03-20 01:55:44.700  1910  1910 E [email protected]: Could not get passthrough implementation for [email protected]::IIop/default.
03-20 01:55:49.611  1911  1911 E cutils-trace: Error opening trace file: Permission denied (13)
03-20 01:55:49.612  1911  1911 D QSEECOMAPI: QSEECom_get_handle sb_length = 0xa000
03-20 01:55:49.612  1911  1911 D QSEECOMAPI: App is already loaded QSEE and app id = 1
03-20 01:55:49.615  1911  1911 E KeymasterUtils: TA API Major Verion: 3
03-20 01:55:49.615  1911  1911 E KeymasterUtils: TA API Minor Verion: 0
03-20 01:55:49.615  1911  1911 E KeymasterUtils: TA Major Verion: 3
03-20 01:55:49.615  1911  1911 E KeymasterUtils: TA Minor Verion: 121
03-20 01:55:49.620  1911  1911 E KeyMasterHalDevice: configure
03-20 01:55:49.620  1911  1911 E KeyMasterHalDevice: ret: 0
03-20 01:55:49.620  1911  1911 E KeyMasterHalDevice: resp->status: -38
03-20 01:55:49.620  1911  1911 F [email protected]: Configure failed
03-20 01:55:49.621  1911  1911 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 1911 (android.hardwar), pid 1911 (android.hardwar)
03-20 01:55:49.625  1913  1913 E cutils-trace: Error opening trace file: Permission denied (13)
03-20 01:55:49.626  1914  1914 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
03-20 01:55:49.627  1914  1914 E libc    : failed to connect to tombstoned: No such file or directory
03-20 01:55:49.627  1914  1914 I crash_dump64: performing dump of process 1911 (target tid = 1911)
03-20 01:55:49.627  1914  1914 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-20 01:55:49.627  1914  1914 F DEBUG   : Build fingerprint: 'Android/treble_arm64_agN/phhgsi_arm64_a:8.1.0/OPM2.171026.006/build07042030:user/test-keys'
03-20 01:55:49.627  1914  1914 F DEBUG   : Revision: '0'
03-20 01:55:49.627  1914  1914 F DEBUG   : ABI: 'arm64'
03-20 01:55:49.627  1914  1914 F DEBUG   : pid: 1911, tid: 1911, name: android.hardwar  >>> /vendor/bin/hw/[email protected] <<<
03-20 01:55:49.627  1914  1914 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
03-20 01:55:49.627  1914  1914 F DEBUG   : Abort message: 'Configure failed'
03-20 01:55:49.627  1914  1914 F DEBUG   :     x0   0000000000000000  x1   0000000000000777  x2   0000000000000006  x3   0000000000000008
03-20 01:55:49.627  1914  1914 F DEBUG   :     x4   0000000000000000  x5   0000000000000000  x6   0000000000000000  x7   ffffffffffffffff
03-20 01:55:49.627  1914  1914 F DEBUG   :     x8   0000000000000083  x9   0059ec0b0fc30483  x10  0000000000000000  x11  0000000000000001
03-20 01:55:49.627  1914  1914 F DEBUG   :     x12  ffffffffffffffff  x13  ffffffffffffffff  x14  ff00000000000000  x15  ffffffffffffffff
03-20 01:55:49.627  1914  1914 F DEBUG   :     x16  0000007e970232e8  x17  0000007e96f81200  x18  0000007e97276080  x19  0000000000000777
03-20 01:55:49.627  1914  1914 F DEBUG   :     x20  0000000000000777  x21  0000007e96350d04  x22  00000000300002c1  x23  0000007fc5bc7ed0
03-20 01:55:49.627  1914  1914 F DEBUG   :     x24  0000007e9634af34  x25  9fa0e5c3e5dfe5b3  x26  0000007e9662f6e0  x27  0000007e9662f6e0
03-20 01:55:49.627  1914  1914 F DEBUG   :     x28  0000007e9662f6f8  x29  0000007fc5bc75a0  x30  0000007e96f769ec
03-20 01:55:49.627  1914  1914 F DEBUG   :     sp   0000007fc5bc7560  pc   0000007e96f76a08  pstate 0000000060000000
03-20 01:55:49.631  1914  1914 F DEBUG   : 
03-20 01:55:49.631  1914  1914 F DEBUG   : backtrace:
03-20 01:55:49.631  1914  1914 F DEBUG   :     #00 pc 000000000001da08  /system/lib64/libc.so (abort+104)
03-20 01:55:49.631  1914  1914 F DEBUG   :     #01 pc 0000000000007f20  /system/lib64/liblog.so (__android_log_assert+304)
03-20 01:55:49.631  1914  1914 F DEBUG   :     #02 pc 000000000000682c  /vendor/lib64/hw/[email protected] (android::hardware::keymaster::V3_0::implementation::KeymasterDevice::KeymasterDevice()+348)
03-20 01:55:49.631  1914  1914 F DEBUG   :     #03 pc 0000000000008f4c  /vendor/lib64/hw/[email protected] (HIDL_FETCH_IKeymasterDevice+24)
03-20 01:55:49.631  1914  1914 F DEBUG   :     #04 pc 00000000000247a4  /system/lib64/vndk-sp-26/libhidltransport.so (android::hardware::PassthroughServiceManager::get(android::hardware::hidl_string const&, android::hardware::hidl_string const&)+1864)
03-20 01:55:49.631  1914  1914 F DEBUG   :     #05 pc 00000000000296bc  /system/lib64/vndk-26/[email protected] (android::hardware::keymaster::V3_0::IKeymasterDevice::getService(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, bool)+1520)
03-20 01:55:49.631  1914  1914 F DEBUG   :     #06 pc 0000000000000b9c  /vendor/bin/hw/[email protected]
03-20 01:55:49.631  1914  1914 F DEBUG   :     #07 pc 0000000000000b28  /vendor/bin/hw/[email protected] (main+88)
03-20 01:55:49.631  1914  1914 F DEBUG   :     #08 pc 00000000000a143c  /system/lib64/libc.so (__libc_init+88)
03-20 01:55:49.631  1914  1914 F DEBUG   :     #09 pc 0000000000000a30  /vendor/bin/hw/[email protected] (do_arm64_start+80)
03-20 01:55:49.634  1914  1914 E crash_dump64: unable to connect to activity manager: No such file or directory
03-20 01:55:49.700  1915  1915 E /vendor/bin/hw/[email protected]: Failed to dlopen [email protected]: dlopen failed: library "[email protected]" not found
03-20 01:55:49.700  1915  1915 E [email protected]: Could not get passthrough implementation for [email protected]::IIop/default.

@dylangerdaly
Copy link
Author

Seems to be related to userdata, formatting userdata with stock recovery or TWRP results in it rebooting to recovery, however running fastboot erase userdata gives me the Anim + ADB

@phhusson
Copy link
Owner

phhusson commented Jul 5, 2018

Can you give me kernel logs and the result of "mount"?

@eligao
Copy link

eligao commented Jul 5, 2018

I had a similar issue when flasing this GSI, which is built from PHH source.
https://forum.xda-developers.com/xiaomi-mi-mix-2s/development/rom-lineageos-15-1-treble-rom-t3808335
I tried different combinations of flashing stock zip, wiping data, formatting storage, flashing GSI, resizing system, flashing opengapps, and in most cases it would just boot to fastboot or recovery.
In the end somehow I got it working, sadly I couldn't remember the exact steps to reproduce.

@dylangerdaly
Copy link
Author

dylangerdaly commented Jul 6, 2018

I can confirm the Stock Boot image actually gives me Boot Anim, the Android P Preview's Boot dosen't give me anything, hangs at SPLASH.

I can confirm however it's failing at Keymaster when it tries to mount userdata, it's a userdata issue I think.

03-21 05:16:14.530  1081  1081 E cutils-trace: Error opening trace file: Permission denied (13)
03-21 05:16:14.531  1081  1081 D QSEECOMAPI: QSEECom_get_handle sb_length = 0xa000
03-21 05:16:14.531  1081  1081 D QSEECOMAPI: App is already loaded QSEE and app id = 1
03-21 05:16:14.534  1081  1081 E KeymasterUtils: TA API Major Verion: 3
03-21 05:16:14.534  1081  1081 E KeymasterUtils: TA API Minor Verion: 0
03-21 05:16:14.534  1081  1081 E KeymasterUtils: TA Major Verion: 3
03-21 05:16:14.534  1081  1081 E KeymasterUtils: TA Minor Verion: 121
03-21 05:16:14.539  1081  1081 E KeyMasterHalDevice: configure
03-21 05:16:14.539  1081  1081 E KeyMasterHalDevice: ret: 0
03-21 05:16:14.539  1081  1081 E KeyMasterHalDevice: resp->status: -38
03-21 05:16:14.539  1081  1081 F [email protected]: Configure failed
03-21 05:16:14.539  1081  1081 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 1081 (android.hardwar), pid 1081 (android.hardwar)
03-21 05:16:14.544  1083  1083 E cutils-trace: Error opening trace file: Permission denied (13)
03-21 05:16:14.545  1084  1084 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
03-21 05:16:14.545  1084  1084 E libc    : failed to connect to tombstoned: No such file or directory
03-21 05:16:14.546  1084  1084 I crash_dump64: performing dump of process 1081 (target tid = 1081)
03-21 05:16:14.546  1084  1084 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-21 05:16:14.546  1084  1084 F DEBUG   : Build fingerprint: 'Android/treble_arm64_agN/phhgsi_arm64_a:8.1.0/OPM2.171026.006/build07042030:user/test-keys'
03-21 05:16:14.546  1084  1084 F DEBUG   : Revision: '0'
03-21 05:16:14.546  1084  1084 F DEBUG   : ABI: 'arm64'
03-21 05:16:14.546  1084  1084 F DEBUG   : pid: 1081, tid: 1081, name: android.hardwar  >>> /vendor/bin/hw/[email protected] <<<
03-21 05:16:14.546  1084  1084 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
03-21 05:16:14.546  1084  1084 F DEBUG   : Abort message: 'Configure failed'
03-21 05:16:14.546  1084  1084 F DEBUG   :     x0   0000000000000000  x1   0000000000000439  x2   0000000000000006  x3   0000000000000008
03-21 05:16:14.546  1084  1084 F DEBUG   :     x4   0000000000000000  x5   0000000000000000  x6   0000000000000000  x7   ffff7fff7fff7f7f
03-21 05:16:14.546  1084  1084 F DEBUG   :     x8   0000000000000083  x9   8b442e4403009540  x10  0000000000000000  x11  0000000000000001
03-21 05:16:14.546  1084  1084 F DEBUG   :     x12  ffffffffffffffff  x13  ffffffffffffffff  x14  ff00000000000000  x15  ffffffffffffffff
03-21 05:16:14.546  1084  1084 F DEBUG   :     x16  00000077b9fe42e8  x17  00000077b9f42200  x18  00000077ba585080  x19  0000000000000439
03-21 05:16:14.546  1084  1084 F DEBUG   :     x20  0000000000000439  x21  00000077b979dd04  x22  00000000300002c1  x23  0000007fc04560b0
03-21 05:16:14.546  1084  1084 F DEBUG   :     x24  00000077b9797f34  x25  eed05db95eab7f6b  x26  00000077b982f6e0  x27  00000077b982f6e0
03-21 05:16:14.546  1084  1084 F DEBUG   :     x28  00000077b982f6f8  x29  0000007fc0455780  x30  00000077b9f379ec
03-21 05:16:14.546  1084  1084 F DEBUG   :     sp   0000007fc0455740  pc   00000077b9f37a08  pstate 0000000060000000
03-21 05:16:14.550  1084  1084 F DEBUG   : 
03-21 05:16:14.550  1084  1084 F DEBUG   : backtrace:
03-21 05:16:14.550  1084  1084 F DEBUG   :     #00 pc 000000000001da08  /system/lib64/libc.so (abort+104)
03-21 05:16:14.550  1084  1084 F DEBUG   :     #01 pc 0000000000007f20  /system/lib64/liblog.so (__android_log_assert+304)
03-21 05:16:14.550  1084  1084 F DEBUG   :     #02 pc 000000000000682c  /vendor/lib64/hw/[email protected] (android::hardware::keymaster::V3_0::implementation::KeymasterDevice::KeymasterDevice()+348)
03-21 05:16:14.550  1084  1084 F DEBUG   :     #03 pc 0000000000008f4c  /vendor/lib64/hw/[email protected] (HIDL_FETCH_IKeymasterDevice+24)
03-21 05:16:14.550  1084  1084 F DEBUG   :     #04 pc 00000000000247a4  /system/lib64/vndk-sp-26/libhidltransport.so (android::hardware::PassthroughServiceManager::get(android::hardware::hidl_string const&, android::hardware::hidl_string const&)+1864)
03-21 05:16:14.550  1084  1084 F DEBUG   :     #05 pc 00000000000296bc  /system/lib64/vndk-26/[email protected] (android::hardware::keymaster::V3_0::IKeymasterDevice::getService(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, bool)+1520)
03-21 05:16:14.550  1084  1084 F DEBUG   :     #06 pc 0000000000000b9c  /vendor/bin/hw/[email protected]
03-21 05:16:14.550  1084  1084 F DEBUG   :     #07 pc 0000000000000b28  /vendor/bin/hw/[email protected] (main+88)
03-21 05:16:14.550  1084  1084 F DEBUG   :     #08 pc 00000000000a143c  /system/lib64/libc.so (__libc_init+88)
03-21 05:16:14.550  1084  1084 F DEBUG   :     #09 pc 0000000000000a30  /vendor/bin/hw/[email protected] (do_arm64_start+80)
03-21 05:16:14.552  1084  1084 E crash_dump64: unable to connect to activity manager: No such file or directory
03-21 05:16:14.641  1085  1085 E /vendor/bin/hw/[email protected]: Failed to dlopen [email protected]: dlopen failed: library "[email protected]" not found
03-21 05:16:14.641  1085  1085 E [email protected]: Could not get passthrough implementation for [email protected]::IIop/default.
03-21 05:16:14.782   759   759 E audioshell_service: main: retry time 3
03-21 05:16:14.782   759   759 E audioshell_service: clientDisconnect: g_sockfd_client is already closed -1
03-21 05:16:14.782   759   759 I audioshell_service: main: exit
03-21 05:16:17.472   667   742 E CHRE    : Couldn't connect client socket to 'chre': No such file or directory
03-21 05:16:17.472   667   742 W CHRE    : Failed to (re)connect, next try in 4000 ms
-- LOOP --

On another note, it looks like the Android P's boot image is suuuper unstable, not sure if this is intentional, I have a feeling it is.

@phhusson
Copy link
Owner

phhusson commented Jul 6, 2018 via email

@dylangerdaly
Copy link
Author

I can't run dmesg because of user build, I'll try see if I can enable this.

When you say mount do you mean like fstab?

@dylangerdaly
Copy link
Author

Output of Mount:

phhgsi_arm64_a:/ $ mount
rootfs on / type rootfs (ro,seclabel)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=2875736k,nr_inodes=718934,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600,ptmxmode=000)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
/dev/block/sde48 on /system type ext4 (ro,seclabel,relatime,discard,data=ordered)
/dev/block/dm-0 on /vendor type ext4 (ro,seclabel,relatime,discard,data=ordered)
debugfs on /sys/kernel/debug type debugfs (rw,seclabel,relatime)
none on /acct type cgroup (rw,relatime,cpuacct)
none on /dev/stune type cgroup (rw,relatime,schedtune)
tmpfs on /mnt type tmpfs (rw,seclabel,relatime,size=2875736k,nr_inodes=718934,mode=755,gid=1000)
none on /config type configfs (rw,relatime)
none on /dev/memcg type cgroup (rw,relatime,memory)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
none on /dev/cpuset type cgroup (rw,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent)
pstore on /sys/fs/pstore type pstore (rw,seclabel,relatime)
none on /sys/fs/cgroup type tmpfs (rw,seclabel,relatime,size=2875736k,nr_inodes=718934,mode=750,gid=1000)
none on /sys/fs/cgroup/memory type cgroup (rw,relatime,memory)
none on /sys/fs/cgroup/freezer type cgroup (rw,relatime,freezer)
/dev/block/sda18 on /cust type ext4 (rw,seclabel,nosuid,nodev,noatime,data=ordered)
/dev/block/sde46 on /firmware type vfat (ro,context=u:object_r:firmware_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)
/dev/block/sde44 on /dsp type ext4 (ro,seclabel,nosuid,nodev,relatime,data=ordered)
/dev/block/sda14 on /persist type ext4 (rw,seclabel,nosuid,nodev,noatime,data=ordered)
/dev/block/sde24 on /bt_firmware type vfat (ro,context=u:object_r:bt_firmware_file:s0,relatime,uid=1002,gid=3002,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)
/dev/block/sda20 on /cache type ext4 (rw,seclabel,nosuid,nodev,noatime,data=ordered)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,size=2875736k,nr_inodes=718934,mode=755,gid=1000)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,seclabel,relatime)
/dev/block/sde48 on /sbin/adbd type ext4 (ro,seclabel,relatime,discard,data=ordered)
/dev/block/sde48 on /vendor/etc/usb_audio_policy_configuration.xml type ext4 (ro,seclabel,relatime,discard,data=ordered)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)

@phhusson
Copy link
Owner

phhusson commented Jul 6, 2018 via email

@dylangerdaly
Copy link
Author

I don't think it's compiling

→ find -name '*phh-su*'

Returns nothing

1|phhgsi_arm64_a:/system $ phh-su 0 dmesg                                                                                     
/system/bin/sh: phh-su: not found

@phhusson
Copy link
Owner

phhusson commented Jul 7, 2018

ah right, you'd need S variant not N to get su.
Well I recommend you switch to the S variant for debugging :P

@GuaiYiHu
Copy link

GuaiYiHu commented Jul 8, 2018

Flash miui's stock boot.img, then everything will be fine.
I met the same issue on my mi pad 4 when I repack my boot.img with "Android Kitchen".
01-14 20:14:05.564 1233 1233 F [email protected]: Configure failed
01-14 20:14:05.564 1233 1233 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 1233 (android.hardwar), pid 1233 (android.hardwar)
01-14 20:14:05.578 1236 1236 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
01-14 20:14:05.578 1236 1236 E libc : failed to connect to tombstoned: No such file or directory
01-14 20:14:05.579 1236 1236 I crash_dump64: performing dump of process 1233 (target tid = 1233)
01-14 20:14:05.579 1236 1236 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-14 20:14:05.579 1236 1236 F DEBUG : Build fingerprint: 'Android/treble_arm64_avN/phhgsi_arm64_a:8.1.0/OPM2.171026/180702:userdebug/test-keys'
01-14 20:14:05.579 1236 1236 F DEBUG : Revision: '0'
01-14 20:14:05.579 1236 1236 F DEBUG : ABI: 'arm64'
01-14 20:14:05.579 1236 1236 F DEBUG : pid: 1233, tid: 1233, name: android.hardwar >>> /vendor/bin/hw/[email protected] <<<
01-14 20:14:05.579 1236 1236 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
01-14 20:14:05.580 1236 1236 F DEBUG : Abort message: 'Configure failed'
01-14 20:14:05.580 1236 1236 F DEBUG : x0 0000000000000000 x1 00000000000004d1 x2 0000000000000006 x3 0000000000000008
01-14 20:14:05.580 1236 1236 F DEBUG : x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 7f7f7f7f7f7fff7f
01-14 20:14:05.580 1236 1236 F DEBUG : x8 0000000000000083 x9 dc6a4917a343993a x10 0000000000000000 x11 0000000000000001
01-14 20:14:05.580 1236 1236 F DEBUG : x12 ffffffffffffffff x13 ffffffffffffffff x14 ff00000000000000 x15 ffffffffffffffff
01-14 20:14:05.580 1236 1236 F DEBUG : x16 0000007d64e542e8 x17 0000007d64db2200 x18 dc6a4917a343993a x19 00000000000004d1
01-14 20:14:05.580 1236 1236 F DEBUG : x20 00000000000004d1 x21 0000007d64418004 x22 00000000300002c1 x23 0000007d6462f600
01-14 20:14:05.580 1236 1236 F DEBUG : x24 0000007d6550ca40 x25 0000007d6462f600 x26 0000007d6462f600 x27 0000007d6550ca40
01-14 20:14:05.580 1236 1236 F DEBUG : x28 0000000000000004 x29 0000007ff48690a0 x30 0000007d64da79ec
01-14 20:14:05.580 1236 1236 F DEBUG : sp 0000007ff4869060 pc 0000007d64da7a08 pstate 0000000060000000
01-14 20:14:05.588 1236 1236 F DEBUG :
01-14 20:14:05.588 1236 1236 F DEBUG : backtrace:
01-14 20:14:05.588 1236 1236 F DEBUG : #00 pc 000000000001da08 /system/lib64/libc.so (abort+104)
01-14 20:14:05.588 1236 1236 F DEBUG : #1 pc 0000000000007f20 /system/lib64/liblog.so (__android_log_assert+304)
01-14 20:14:05.588 1236 1236 F DEBUG : #2 pc 0000000000006620 /vendor/lib64/hw/[email protected] (android::hardware::keymaster::V3_0::implementation::KeymasterDevice::KeymasterDevice()+348)
01-14 20:14:05.588 1236 1236 F DEBUG : #3 pc 0000000000009fe8 /vendor/lib64/hw/[email protected] (HIDL_FETCH_IKeymasterDevice+24)
01-14 20:14:05.588 1236 1236 F DEBUG : #4 pc 000000000002e3cc /system/lib64/vndk-sp/libhidltransport.so (ZZN7android8hardware25PassthroughServiceManager3getERKNS0_11hidl_stringES4_ENKUlPvRKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEESE_E_clES5_SE_SE+96)
01-14 20:14:05.588 1236 1236 F DEBUG : #5 pc 000000000002b468 /system/lib64/vndk-sp/libhidltransport.so (android::hardware::PassthroughServiceManager::openLibs(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, std::__1::function<bool (void*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&)>)+1780)
01-14 20:14:05.588 1236 1236 F DEBUG : #6 pc 000000000002cd70 /system/lib64/vndk-sp/libhidltransport.so (android::hardware::PassthroughServiceManager::get(android::hardware::hidl_string const&, android::hardware::hidl_string const&)+104)
01-14 20:14:05.588 1236 1236 F DEBUG : #7 pc 0000000000029634 /system/lib64/vndk/[email protected] (android::hardware::keymaster::V3_0::IKeymasterDevice::getService(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, bool)+1612)
01-14 20:14:05.588 1236 1236 F DEBUG : #8 pc 0000000000000d7c /vendor/bin/hw/[email protected]
01-14 20:14:05.588 1236 1236 F DEBUG : #9 pc 0000000000000d00 /vendor/bin/hw/[email protected]
01-14 20:14:05.588 1236 1236 F DEBUG : #10 pc 0000000000000bfc /vendor/bin/hw/[email protected] (main+84)
01-14 20:14:05.588 1236 1236 F DEBUG : #11 pc 00000000000a143c /system/lib64/libc.so (__libc_init+88)
01-14 20:14:05.588 1236 1236 F DEBUG : #12 pc 0000000000000b08 /vendor/bin/hw/[email protected] (_start_main+80)
01-14 20:14:05.595 1236 1236 E crash_dump64: unable to connect to activity manager: No such file or directory
01-14 20:14:10.556 1244 1244 D vndksupport: Loading /vendor/lib64/hw/[email protected] from current namespace instead of sphal namespace.

@dylangerdaly
Copy link
Author

Oh my bad, I've recompiled with the S variant however phh-su appears to do nothing

phhgsi_arm64_a:/ $ phh-su 0 dmesg                                                                                             
255|phhgsi_arm64_a:/ $ phh-su 0 id                                                                                            
255|phhgsi_arm64_a:/ $ phh-su id                                                                                              
255|phhgsi_arm64_a:/ $ phh-su dmesg                                                                                           
255|phhgsi_arm64_a:/ $ phh-su --help    

I have a feeling this maybe due to SELinux

Maybe if I edit your mount script to add verbose logging to /persist or something?

Can I ask what the mount script does? User Data mount be taken care of by vold etc yeah?

@GuaiYiHu I tried repacking stock but I get the same issue, pretty sure its related to mounting and/or formatting of userdata.

@dylangerdaly
Copy link
Author

dylangerdaly commented Jul 10, 2018

Okay, after grepping thru logcat, I think I know why it's failing

rw-system.sh: type=1400 audit(0.0:9): avc: denied { read execute } for path="/system/bin/sh" dev="sde48" ino=1220 scontext=u:r:phhsu_daemon:s0 tcontext=u:object_r:shell_exec:s0 tclass=file permissive=0

Issue appears to be related to SELinux not allowing your script to run.

I think this is failing because whatever is executing rw-system.sh is coming from the context of phhsu_daemon

@dylangerdaly
Copy link
Author

Hmm still same result with phhsu_daemon set to permissive

03-24 20:57:34.960  1191  1191 E KeymasterUtils: TA API Minor Verion: 0
03-24 20:57:34.960  1191  1191 E KeymasterUtils: TA Major Verion: 3
03-24 20:57:34.960  1191  1191 E KeymasterUtils: TA Minor Verion: 121
03-24 20:57:34.964  1191  1191 E [email protected]: Invalid patch month 0
03-24 20:57:34.965  1191  1191 E KeyMasterHalDevice: configure
03-24 20:57:34.965  1191  1191 E KeyMasterHalDevice: ret: 0
03-24 20:57:34.965  1191  1191 E KeyMasterHalDevice: resp->status: -38
03-24 20:57:34.965  1191  1191 F [email protected]: Configure failed

@dylangerdaly
Copy link
Author

@phhusson I managed to get dmesg, forcing SELinux to permissive via CMDLINE

pfs" ino=24765 ioctlcmd=0x23 scontext=u:r:sensors:s0 tcontext=u:object_r:diag_device:s0 tclass=chr_file permissive=1
[   16.389655] init: Untracked pid 1166 exited with status 0
[   16.390260] init: Service 'keymaster-3-0' (pid 1163) killed by signal 6
[   16.390270] init: Sending signal 9 to service 'keymaster-3-0' (pid 1163) process group...
[   16.390354] init: kill(1163, 9) failed: No such process
[   16.480077] QNOVO_CHG_READY: current vote is now 1 voted by USB_READY_VOTER,0,previous voted 0
[   16.480087] QNOVO_NOT_OK: current vote is now 0 voted by CHG_READY_VOTER,0,previous voted 1
[   16.480095] QNOVO_DISABLE: current vote is now 1 voted by ok_to_qnovo_voter,0,previous voted 1
[   16.480258] QNOVO_AWAKE: current vote is now 0 voted by USB_READY_VOTER,1,previous voted 1
[   16.485903] init: computing context for service 'iop-hal-2-0'
[   16.486075] init: starting service 'iop-hal-2-0'...
[   16.486475] init: property_set("ro.boottime.iop-hal-2-0", "16486313795") failed: property already set
[   16.495759] init: Service 'iop-hal-2-0' (pid 1167) exited with status 1
[   16.495771] init: Sending signal 9 to service 'iop-hal-2-0' (pid 1167) process group...
[   16.495842] init: kill(1167, 9) failed: No such process
[   20.426684] configfs-gadget gadget: high-speed config #0: unconfigured
[   20.789426] configfs-gadget gadget: high-speed config #1: b
[   20.789640] android_work: sent uevent USB_STATE=CONFIGURED
[   20.789856] configfs-gadget gadget: high-speed config #1: b
[   20.790009] android_work: sent uevent USB_STATE=CONFIGURED
[   21.390744] init: Service 'keymaster-3-0' (pid 1180) killed by signal 6
[   21.390761] init: Sending signal 9 to service 'keymaster-3-0' (pid 1180) process group...
[   21.390841] init: kill(1180, 9) failed: No such process
[   21.486387] init: computing context for service 'iop-hal-2-0'
[   21.486562] init: starting service 'iop-hal-2-0'...
[   21.486975] init: property_set("ro.boottime.iop-hal-2-0", "21486803429") failed: property already set
[   21.495869] init: Service 'iop-hal-2-0' (pid 1184) exited with status 1
[   21.495883] init: Sending signal 9 to service 'iop-hal-2-0' (pid 1184) process group...
[   21.495951] init: kill(1184, 9) failed: No such process
[   21.601055] FG: soc_work_fn: adjust_soc: s 100 r 85205 i 73242 v 4361072 t 360 cc 0 m 0xff
[   21.601066] FG: soc_work_fn: adjust_soc: 000: 6b, fa, 00, 06
[   21.601071] FG: soc_work_fn: adjust_soc: 019: bf, ff, 00, 00
[   21.601076] FG: soc_work_fn: adjust_soc: 079: 00, 00, 00, 09
[   21.601223] init: Service 'audioshell_service' (pid 838) exited with status 0
[   25.620532] type=1400 audit(7133526.229:224): avc: denied { ioctl } for pid=846 comm="sensors.qcom" path="/dev/diag" dev="tmpfs" ino=24765 ioctlcmd=0x23 scontext=u:r:sensors:s0 tcontext=u:object_r:diag_device:s0 tclass=chr_file permissive=1
[   25.620545] type=1400 audit(7133539.239:225): avc: denied { getattr } for pid=1185 comm="sh" path="/vendor/bin/toybox_vendor" dev="dm-0" ino=339 scontext=u:r:shell:s0 tcontext=u:object_r:vendor_toolbox_exec:s0 tclass=file permissive=1
[   25.620742] type=1400 audit(7133539.239:225): avc: denied { getattr } for pid=1185 comm="sh" path="/vendor/bin/toybox_vendor" dev="dm-0" ino=339 scontext=u:r:shell:s0 tcontext=u:object_r:vendor_toolbox_exec:s0 tclass=file permissive=1
[   25.620747] type=1400 audit(7133539.239:226): avc: denied { execute } for pid=1185 comm="sh" name="toybox_vendor" dev="dm-0" ino=339 scontext=u:r:shell:s0 tcontext=u:object_r:vendor_toolbox_exec:s0 tclass=file permissive=1
[   26.486848] init: computing context for service 'iop-hal-2-0'
[   26.487016] init: starting service 'iop-hal-2-0'...
[   26.487423] init: property_set("ro.boottime.iop-hal-2-0", "26487254364") failed: property already set
[   26.496355] init: Service 'iop-hal-2-0' (pid 1193) exited with status 1
[   26.496370] init: Sending signal 9 to service 'iop-hal-2-0' (pid 1193) process group...
[   26.496445] init: kill(1193, 9) failed: No such process
[   31.359229] init: computing context for service 'keymaster-3-0'
[   31.359398] init: starting service 'keymaster-3-0'...
[   31.359823] init: property_set("ro.boottime.keymaster-3-0", "31359643998") failed: property already set
[   31.391067] init: Untracked pid 1197 exited with status 0
[   31.496778] init: Service 'iop-hal-2-0' (pid 1198) exited with status 1
[   31.496794] init: Sending signal 9 to service 'iop-hal-2-0' (pid 1198) process group...
[   31.496864] init: kill(1198, 9) failed: No such process
[   31.840076] PMI: smblib_pl_enable_work: timer expired, enabling parallel
[   31.840093] PL_DISABLE: current vote is now 1 voted by PL_DELAY_VOTER,4,previous voted 1
[   31.840101] AWAKE: current vote is now 1 voted by PL_DELAY_VOTER,1,previous voted 1
[   33.183300] type=1400 audit(7133539.239:226): avc: denied { execute } for pid=1185 comm="sh" name="toybox_vendor" dev="dm-0" ino=339 scontext=u:r:shell:s0 tcontext=u:object_r:vendor_toolbox_exec:s0 tclass=file permissive=1
[   33.183313] type=1400 audit(7133546.799:227): avc: denied { syslog_read } for pid=1199 comm="dmesg" scontext=u:r:shell:s0 tcontext=u:r:kernel:s0 tclass=system permissive=1
[   36.359715] init: computing context for service 'keymaster-3-0'
[   36.359883] init: starting service 'keymaster-3-0'...
[   36.360391] init: property_set("ro.boottime.keymaster-3-0", "36360208423") failed: property already set
[   36.391693] init: Untracked pid 1203 exited with status 0
[   36.392354] init: Service 'keymaster-3-0' (pid 1200) killed by signal 6
[   36.392364] init: Sending signal 9 to service 'keymaster-3-0' (pid 1200) process group...
[   36.392445] init: kill(1200, 9) failed: No such process
[   41.360279] init: computing context for service 'keymaster-3-0'
[   41.360450] init: starting service 'keymaster-3-0'...
[   41.360887] init: property_set("ro.boottime.keymaster-3-0", "41360704254") failed: property already set
[   41.391732] init: Untracked pid 1208 exited with status 0
[   41.392397] init: Service 'keymaster-3-0' (pid 1205) killed by signal 6
[   41.392407] init: Sending signal 9 to service 'keymaster-3-0' (pid 1205) process group...
[   41.392491] init: kill(1205, 9) failed: No such process
[   41.488199] init: computing context for service 'iop-hal-2-0'
[   41.488367] init: starting service 'iop-hal-2-0'...
[   41.488769] init: property_set("ro.boottime.iop-hal-2-0", "41488605296") failed: property already set
[   42.081152] FG: soc_work_fn: adjust_soc: s 100 r 78369 i -150878 v 4381092 t 360 cc 0 m 0xff
[   42.081165] FG: soc_work_fn: adjust_soc: 000: 6b, fa, 00, 06
[   42.081170] FG: soc_work_fn: adjust_soc: 019: bf, ff, 00, 00
[   42.081174] FG: soc_work_fn: adjust_soc: 079: 00, 00, 00, 09
[   46.392285] init: Untracked pid 1213 exited with status 0
[   46.392971] init: Service 'keymaster-3-0' (pid 1210) killed by signal 6
[   46.392981] init: Sending signal 9 to service 'keymaster-3-0' (pid 1210) process group...
[   46.393063] init: kill(1210, 9) failed: No such process
[   46.488647] init: computing context for service 'iop-hal-2-0'
[   46.488824] init: starting service 'iop-hal-2-0'...
[   46.489223] init: property_set("ro.boottime.iop-hal-2-0", "46489055555") failed: property already set
[   46.498096] init: Service 'iop-hal-2-0' (pid 1214) exited with status 1
[   46.498107] init: Sending signal 9 to service 'iop-hal-2-0' (pid 1214) process group...
[   46.498176] init: kill(1214, 9) failed: No such process
[   48.480179] FG_WS: fg_ttf_priming,4 same vote off of val=0
[   51.489101] init: computing context for service 'iop-hal-2-0'
[   51.489287] init: starting service 'iop-hal-2-0'...
[   51.489693] init: property_set("ro.boottime.iop-hal-2-0", "51489520553") failed: property already set
[   51.498508] init: Service 'iop-hal-2-0' (pid 1223) exited with status 1
[   51.498521] init: Sending signal 9 to service 'iop-hal-2-0' (pid 1223) process group...
[   51.498591] init: kill(1223, 9) failed: No such process

@GuaiYiHu
Copy link

Invalid patch month 0
This is the reason.

@phhusson
Copy link
Owner

phhusson commented Jul 10, 2018

Hmm still same result with phhsu_daemon set to permissive

I don't understand, phhsu_daemon is already permissive!?!

03-24 20:57:34.964 1191 1191 E [email protected]: Invalid patch month 0
Hey that's quite positive, it means something did happen! :P

Can you run getprop in this context? specifically getprop |grep security and getprop |grep keymaster

@dylangerdaly
Copy link
Author

Sure

phhgsi_arm64_a:/ $ getprop |grep security
[ro.build.version.security_patch]: [2018-06-05]
[ro.keymaster.xxx.security_patch]: [2000-00-01]
[security.perf_harden]: [1]
phhgsi_arm64_a:/ $ 
phhgsi_arm64_a:/ $ 
phhgsi_arm64_a:/ $ getprop |grep keymaster
[init.svc.keymaster-3-0]: [restarting]
[ro.boot.keymaster]: [1]
[ro.boottime.keymaster-3-0]: [6272361976]
[ro.keymaster.mod]: [AOSP on ARM64]
[ro.keymaster.xxx.release]: [0.0.0]
[ro.keymaster.xxx.security_patch]: [2000-00-01]

@dylangerdaly
Copy link
Author

It looks like its either ro.keymaster.xxx.* or maybe ro.boottime.keymaster-3-0

@dylangerdaly
Copy link
Author

Okay, so I've rebuilt userdebug (Known working) if you fastboot erase userdata it loops at the exact same place.

So the actual issue is when formatting userdata with ext4, userdebug boots just fine, user reboots you into recovery.

@dylangerdaly
Copy link
Author

So I'm not sure what exactly changed, but I installed a miui update, I think 10, downgraded the boot & vendor images to 8, and now it's booting?

@dylangerdaly
Copy link
Author

It didn't have anything to do with the update, I have no idea what changed, I did a force resync on the repo and it booted!

It may have been the SECURITY_PATCH month, I'm not sure, but it's now working flawlessly!

Thank you @phhusson and others for input! 😃

@dylangerdaly
Copy link
Author

Okay I found out what it was, it was two things:

Edit bionic/linker/Android.bp

cppflags: ["-Wold-style-cast"],
to
cppflags: ["-Wold-style-cast", "-DUSE_LD_CONFIG_FILE"],

Allow phhsu_daemon to be permissive (Not best solution)

Edit system/sepolicy/Android.mk and remove the permissive check

$(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := $(all_cil_files)
$(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $(all_cil_files)
        @mkdir -p $(dir $@)
        $(hide) $< -M true -G -c $(POLICYVERS) $(PRIVATE_CIL_FILES) -o [email protected] -f /dev/null
        $(hide) $(HOST_OUT_EXECUTABLES)/sepolicy-analyze [email protected] permissive > [email protected]
#       $(hide) if [ "$(TARGET_BUILD_VARIANT)" = "user" -a -s [email protected] ]; then \
#               echo "==========" 1>&2; \
#               echo "ERROR: permissive domains not allowed in user builds" 1>&2; \
#               echo "List of invalid domains:" 1>&2; \
#               cat [email protected] 1>&2; \
#         	exit 1; \
#               fi
        $(hide) mv [email protected] $@

Doing these 2 things results in the device booting correctly, however I think we should give system-rw it's own SELinux domain.

@phhusson phhusson changed the title [Mi Mix 2S] User Target Doesn't Boot Create user targets Jul 13, 2018
@phhusson phhusson reopened this Jul 13, 2018
@phhusson
Copy link
Owner

Oh ok I didn't understand why you removed permissive phhsu_daemon
I'm impressed those are the only two changes that are required, that's very nice, I might try to switch to user builds then.

For rw-system.sh selinux context, rw-system.sh is rewriting /vendor blobs, IIRC there are neverallows against that.
But I'll (re-)try writing a SELinux context for it anyway, so at least I can document what's wrong.

@penn5
Copy link

penn5 commented Feb 21, 2019

[ro.keymaster.xxx.security_patch]: [2000-00-01]
Uh how did you all miss this?

@Eddie07
Copy link

Eddie07 commented Apr 2, 2019

hi
Whats wrong here. Full Lineage 15.1 build for Sharp Aquos s2 :)
Using your latest PIE GSI
06-28 06:51:20.586 W/ServiceManagement( 2332): Waited one second for [email protected]::IPower/default. Waiting another...
06-28 06:51:20.596 F/linker ( 2373): CANNOT LINK EXECUTABLE "/vendor/bin/hw/[email protected]": cannot locate symbol "_ZN7android8hardware7details14gServiceSidMapE" referenced by "/vendor/lib64/[email protected]_vendor.so"...
06-28 06:51:20.598 F/linker ( 2375): CANNOT LINK EXECUTABLE "/vendor/bin/hw/[email protected]": cannot locate symbol "_ZN7android8hardware7details14gServiceSidMapE" referenced by "/vendor/lib64/[email protected]_vendor.so"...
06-28 06:51:20.600 F/linker ( 2374): CANNOT LINK EXECUTABLE "/vendor/bin/hw/[email protected]": cannot locate symbol "_ZN7android8hardware7details14gServiceSidMapE" referenced by "/vendor/lib64/[email protected]_vendor.so"...
06-28 06:51:20.600 F/linker ( 2371): CANNOT LINK EXECUTABLE "/vendor/bin/hw/[email protected]": cannot locate symbol "_ZN7android8hardware7details14gServiceSidMapE" referenced by "/vendor/lib/[email protected]_vendor.so"...
06-28 06:51:20.624 I/ServiceManagement( 2370): Removing namespace from process name [email protected] to [email protected].
06-28 06:51:20.625 E/vndksupport( 2372): Could not load /vendor/lib64/hw/hwcomposer.sdm660.so from default namespace: dlopen failed: cannot locate symbol "_ZN7android8hardware7details14gServiceSidMapE" referenced by "/vendor/lib64/[email protected]_vendor.so"....
06-28 06:51:20.625 E/HAL ( 2372): load: module=/vendor/lib64/hw/hwcomposer.sdm660.so
06-28 06:51:20.625 E/HAL ( 2372): unknown
06-28 06:51:20.625 E/HwcPassthrough( 2372): failed to get hwcomposer module
06-28 06:51:20.625 E/[email protected]( 2372): Could not get passthrough implementation for [email protected]::IComposer/default.
06-28 06:51:20.627 I/audiohalservice( 2370): Registration complete for [email protected]::IDevicesFactory/default.
06-28 06:51:20.630 F/linker ( 2376): CANNOT LINK EXECUTABLE "/vendor/bin/hw/[email protected]": cannot locate symbol "_ZN7android8hardware7details14gServiceSidMapE" referenced by "/vendor/lib64/[email protected]_vendor.so"...
Thanx

@linjan
Copy link

linjan commented Jul 8, 2019

Got that (reboot in 16s after boot) on MIUI with installed Magisk, thank you, @phhusson. Flashed original boot.img, now everything is ok.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants