-
Notifications
You must be signed in to change notification settings - Fork 663
Create user targets #112
Comments
Let's rename this issue to just user target doesn't boot :P
If you reboot to recovery, it means your system boots a bit, so did you try
to get adb logcat?
Le mer. 4 juil. 2018 à 12:30, Dylanger Daly <[email protected]> a
écrit :
… 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, anyone know if it's
possible?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#112>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAOOnoWRDJOcBDXmzmhmdVjAFFHy9nWks5uDJlPgaJpZM4VCWQf>
.
|
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? |
Cool sidenote, running strings on logfs gives you what you'd see on UART
|
Getting back on topic, resetting logfs shows us the following
Error seems to be
|
I was thinking adb from the GSI itself. Do you see some bootanimation or not at all? |
No Animation, userdebug it works. Does the GSI have a DTB Compiled into it or something? |
no |
Also when compiling user target I the su SELinux policy is being included
This this be excluded on user builds? |
No, this selinux context is used by some custom services |
I'm getting no Boot Anim, I've enabled adb however I can't confirm the dialog
|
Edit system/core/adb/adbd_auth.cpp and change auth_required to false |
Awesome, cheers for that This is the logcat:
|
Can you give me, in adb shell: |
Sure
phh-su isn't being compiled I don't think
|
Ah right Change product_variables: {
to then touch bionic/linker/linker.cpp to force rebuild, and remake |
Awesome! Progress is being made, I'm now seeing the Boot Animation Hitting this error now:
|
Seems to be related to userdata, formatting userdata with stock recovery or TWRP results in it rebooting to recovery, however running |
Can you give me kernel logs and the result of "mount"? |
I had a similar issue when flasing this GSI, which is built from PHH source. |
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.
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. |
Configure failed is only because of a mismatch of security patch level
between boot.img and system.img
But this is handled by my rw-system.sh script
The question is why does it fail, that's why I asked you for result of
mount and kernel logs
Le ven. 6 juil. 2018 à 18:13, Dylanger Daly <[email protected]> a
écrit :
… I can confirm the Stock Boot image actually gives me Boot Anim, the
Android P Preview 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 ***@***.***: 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 >>> ***@***.*** <<<
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 : #1 pc 0000000000007f20 /system/lib64/liblog.so (__android_log_assert+304)
03-21 05:16:14.550 1084 1084 F DEBUG : #2 pc 000000000000682c ***@***.*** (android::hardware::keymaster::V3_0::implementation::KeymasterDevice::KeymasterDevice()+348)
03-21 05:16:14.550 1084 1084 F DEBUG : #3 pc 0000000000008f4c ***@***.*** (HIDL_FETCH_IKeymasterDevice+24)
03-21 05:16:14.550 1084 1084 F DEBUG : #4 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 : #5 pc 00000000000296bc ***@***.*** (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 : #6 pc 0000000000000b9c ***@***.***
03-21 05:16:14.550 1084 1084 F DEBUG : #7 pc 0000000000000b28 ***@***.*** (main+88)
03-21 05:16:14.550 1084 1084 F DEBUG : #8 pc 00000000000a143c /system/lib64/libc.so (__libc_init+88)
03-21 05:16:14.550 1084 1084 F DEBUG : #9 pc 0000000000000a30 ***@***.*** (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 ***@***.***: Failed to dlopen ***@***.***: dlopen failed: library ***@***.***" not found
03-21 05:16:14.641 1085 1085 E ***@***.***: Could not get passthrough implementation for ***@***.***::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.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#112 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAOOsWekkxOKcMdyE80LIm3RJY8L4bAks5uD4yMgaJpZM4VCWQf>
.
|
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? |
Output of Mount:
|
You should have working phh-su, so phh-su 0 dmesg should give you kernel
logs
Le ven. 6 juil. 2018 à 18:44, Dylanger Daly <[email protected]> a
écrit :
… 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)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#112 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAOOnrH3aGyk3UFKFnPjTsTBwhMq50hks5uD5QKgaJpZM4VCWQf>
.
|
I don't think it's compiling
Returns nothing
|
ah right, you'd need S variant not N to get su. |
Flash miui's stock boot.img, then everything will be fine. |
Oh my bad, I've recompiled with the S variant however phh-su appears to do nothing
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. |
Okay, after grepping thru logcat, I think I know why it's failing
Issue appears to be related to SELinux not allowing your script to run. I think this is failing because whatever is executing |
Hmm still same result with phhsu_daemon set to permissive
|
@phhusson I managed to get dmesg, forcing SELinux to permissive via CMDLINE
|
Invalid patch month 0 |
I don't understand, phhsu_daemon is already permissive!?!
Can you run getprop in this context? specifically getprop |grep security and getprop |grep keymaster |
Sure
|
It looks like its either |
Okay, so I've rebuilt userdebug (Known working) if you So the actual issue is when formatting userdata with ext4, userdebug boots just fine, user reboots you into recovery. |
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? |
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! 😃 |
Okay I found out what it was, it was two things: Edit bionic/linker/Android.bp
Allow phhsu_daemon to be permissive (Not best solution)Edit system/sepolicy/Android.mk and remove the permissive check
Doing these 2 things results in the device booting correctly, however I think we should give system-rw it's own SELinux domain. |
Oh ok I didn't understand why you removed permissive phhsu_daemon For rw-system.sh selinux context, rw-system.sh is rewriting /vendor blobs, IIRC there are neverallows against that. |
|
hi |
Got that (reboot in 16s after boot) on MIUI with installed Magisk, thank you, @phhusson. Flashed original boot.img, now everything is ok. |
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?
The text was updated successfully, but these errors were encountered: