Sunday, 2019-07-14

piggzmccreary: do you have a working bootctl binary?10:19
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!10:19
T42<adampigg> mal: overriding those services and adding selinux_stubs hasnt stopped them crashing11:19
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!11:19
mal@adampigg ok, so it's something else, I think signal 9 usually was selinux related, not sure though11:23
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!11:23
T42<adampigg> btw, ive requested ircsomebot get cancelled11:58
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!11:58
malwhy did it appear here?12:01
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:01
T42<adampigg> mal, i suppose i have the code to debug failing services...imsdatadaemon exits with 255, doesnt crash12:27
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:27
mal@adampigg do you have the selinux related files in root12:30
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:30
T42<adampigg> mal, doesnt look like it.12:32
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:32
T42<adampigg> mal, also, im afraid to reboot phone...im away from home all weel, and my laptop doesnt like te fxtec (or vice versa) in fastboot mode. so, to flash boot ive been using wifes older laptop. same fastboot version, doesnt make sense!12:37
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:37
mal@adampigg it seems those are not in root folder in android 9 anymore12:37
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:37
T42<adampigg> mal, where should they be12:38
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:38
malI think those are /system or /vendor12:40
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:40
T42<adampigg> named...... nothing jumps out12:42
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:42
malno idea, just ignore it, some other reason then12:42
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:42
T42<adampigg> k12:43
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:43
maltry strace12:44
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:44
r0kk3rzwow botspam12:47
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:47
T42<adampigg> mal, this is the last thing imsdatadaemon does....sorry about the formal12:57
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:57
T42<adampigg> (Photo, 2160x1080) https://irc.thaodan.de/.imgstore/sOQYuQoP80.png12:58
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!12:58
malnothing obvious in that strace13:19
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!13:19
T42<adampigg> Ill do better latet13:40
IrcsomeBotNo chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!13:40
mal@adampigg just curious, how is the battery life on fxtec?17:57
T42<adampigg> Mal, seems ok, but not used radio yet17:58
electro5751hi all19:33
deathmisthey, I'm getting "/config/usb_gadget/g1/configs/b.1: opendir failed: No such file or directory" from usb_moded in journalctl when enabling MTP, I'm on 4.4 kernel and 15.1 base. found this https://git.io/fjXzj in the logs but it doesn't seem to be applicable anymore (I don't have the changed file)20:09
maldeathmist: so your device used configfs based usb based on that error20:10
malthe patch you linked is for the older android usb driver20:11
deathmistright, that makes sense. is there a patch for configfs or could I be missing something else? I only have a c.1 dir in that configs path and "rndis.usb0" there, kernel sources at https://git.io/fjXgt20:18
malno need for such patches in configfs, either it's using wrong path or configfs is not initialized properly20:38
malc.1 is created by init script, b.1 should come from droid-hal-init via some .rc file it reads, check those20:38
malnot the first device that would have issues with creation of b.1, check dmesg and journal log for any issues with chmod or chown20:40
mccrearypiggz: I don't have a working bootctl binary. I'm working on fixing the HIDL-related problems, but thought you might be interested in something simpler20:43
deathmistmal: alright, I'll grab those after a fresh boot20:43
mccrearypiggz: I guess I have a working bootctl binary in our unfinished LineageOS build, without the SELinux policy to enable it21:00
mccrearySince you don't care about SELinux, it might just work for you. You can get a copy here: https://drive.google.com/open?id=1iryyXTcN4UJo8Xj4T7AyqYOHBCDXTOPV21:10
mccreary'bootctl mark-boot-successful 0' seemed to work in my test21:11
piggz_   mccrearythx, will test21:12
mccrearyTBC, that binary depends on android.hardware.boot@1.0-service21:14
piggz_mccreary: i checked that service was running earlier....21:15
piggz_but21:15
piggz_sh-3.2# ./bootctl mark-boot-successful21:15
piggz_Error marking as having booted successfully: Operation not permitted21:15
piggz_sh-3.2# ./bootctl get-current-slot21:15
piggz_021:15
mccrearyFxTecPro1:/vendor # md5sum /vendor/bin/hw/android.hardware.boot@1.0-service21:18
mccreary27218f361d333f0d12520fb4bba1000f  /vendor/bin/hw/android.hardware.boot@1.0-service21:18
mccrearypiggz_: Do you have the same android.hardware.boot@1.0-service blog?21:18
piggz_mccreary: yup21:19
piggz_sh-3.2# md5sum /vendor/bin/hw/android.hardware.boot@1.0-service21:19
piggz_27218f361d333f0d12520fb4bba1000f  /vendor/bin/hw/android.hardware.boot@1.0-service21:19
piggz_sh-3.2#21:19
piggz_root      3900  0.0  0.0  14664  3172 ?        S    12:13   0:00 /vendor/bin/hw/android.hardware.boot@1.0-service21:20
mccrearyAnd you are root?21:20
piggz_yes21:20
mccrearyAnd your bootloader is unlocked?21:21
piggz_07-14 22:21:38.204  3900  3900 E gpt-utils: gpt_get_header: Failed to open ../../../../.. : Is a directory21:22
piggz_07-14 22:21:38.204  3900  3900 E gpt-utils: gpt_disk_get_disk_info: Failed to get primary header21:22
piggz_07-14 22:21:38.204  3900  3900 E bootcontrolhal: update_slot_attribute: Failed to get disk info for xbl_a21:22
piggz_07-14 22:21:38.204  3900  3900 E bootcontrolhal: mark_boot_successful: Failed to mark boot successful21:22
mccrearyWell, that is useful info21:22
mccrearyFYI, those first two error messages are both from vendor/qcom/opensource/recovery-ext/oem-recovery/gpt-utils.cpp, in gpt_get_header() and gpt_disk_get_disk_info()21:28
mccrearyAnd I think the problem is what is being passed in as the partition name 'dev'21:29
piggz_mccreary: i wonder21:33
piggz_does it resolve the name from /dev/block.....21:33
piggz_becuase, in sailfish, we use a difference scheme21:33
piggz_must be in get_dev_path_from_partition_name21:34
mccrearyThat might be it21:34
mccrearyBut I haven't found the code that produced the 'bootcontrolhal' error messages yet21:34
piggz_mccreary: for info:21:36
piggz_[root@Sailfish block]# file /dev/block/platform/soc/by-name/boot_a21:36
piggz_/dev/block/platform/soc/by-name/boot_a: symbolic link to ../../../../sde1221:36
mccrearyWhat about xbl_a21:36
piggz_[root@Sailfish block]# file /dev/block/platform/soc/by-name/xbl_a21:37
piggz_/dev/block/platform/soc/by-name/xbl_a: symbolic link to ../../../../sdb121:37
mccrearyOK21:40
mccrearyFYI, the calling function seems to be in hardware/qcom/bootctrl/boot_control.cpp, update_slot_attribute()21:41
piggz_mccreary: what do you have in /dev/ for these, i could try a symlink21:43
mccreary/dev/block/platform/soc/by-name doesn't exist21:46
mccrearyHere is what I have in /dev/block/by-name: https://pastebin.com/GgzGmb6L21:47
mccrearyYou might try making your symbolic links absolute rather than relative21:48
mccrearySo, 'hardware/qcom/bootctrl/boot_control.cpp:      const char ptn_list[][MAX_GPT_NAME_SIZE] = { AB_PTN_LIST };'21:49
mccrearyAnd AB_PTN_LIST is defined in vendor/qcom/opensource/recovery-ext/oem-recovery/gpt-utils.h:#define AB_PTN_LIST PTN_SWAP_LIST, "boot", "system", "vendor", "modem", "bluetooth"21:49
mccrearyLooking at that file suggests it is using the files in '/dev/block/bootdevice/by-name/'21:50
mccrearyAnd this is what I have in that dir: https://pastebin.com/BbFMpQrN21:51
mccrearyYep. This is the code that builds the pathname of the device node: https://pastebin.com/hxMYhALV21:55
mccrearyBOOT_DEV_DIR and AB_SLOT_A_SUFFIX are both defined in gpt-utils.h21:56
piggz_mccreary: adding links for xbl_a and boot_a like yours hasnt helped21:57
piggz_maybe i should add all21:57
mccrearyContinuing with the code trace, it calls stat() on the A and B variants to check if they exist. Those calls succeed.21:58
mccrearyThen it calls gpt_disk_get_disk_info()21:58
piggz_the error is still the same22:03
piggz_https://pastebin.com/2fbDaTPK22:04
piggz_this is my /dev/block/bootdevice22:04
mccrearyI think I found the problem. #define PATH_TRUNCATE_LOC (sizeof("/dev/block/sda") - 1)22:05
mccreary1103                         buf[PATH_TRUNCATE_LOC] = '\0';22:06
mccrearyFrom vendor/qcom/opensource/recovery-ext/oem-recovery/gpt-utils.cpp22:06
mccrearyThe idiotic code assumes all device paths are exactly 14 characters long22:07
mccrearySo no relative symbolic links allowed22:07
mccrearyAnd '/dev/block/sd?' must exist22:08
piggz_mccreary:22:10
piggz_sh-3.2# ls -lh /dev/block/sd?22:10
piggz_lrwxrwxrwx 1 root root 6 Jul 14 12:13 /dev/block/sda -> ../sda22:10
piggz_lrwxrwxrwx 1 root root 6 Jul 14 12:13 /dev/block/sdb -> ../sdb22:10
piggz_lrwxrwxrwx 1 root root 6 Jul 14 12:13 /dev/block/sdc -> ../sdc22:10
piggz_lrwxrwxrwx 1 root root 6 Jul 14 12:13 /dev/block/sdd -> ../sdd22:10
piggz_lrwxrwxrwx 1 root root 6 Jul 14 12:13 /dev/block/sde -> ../sde22:10
piggz_lrwxrwxrwx 1 root root 6 Jul 14 12:13 /dev/block/sdf -> ../sdf22:10
mccrearyYeah, that won't work22:10
mccrearyThis is what I have: https://pastebin.com/YWMZfNUX22:10
piggz_hmm, can i quickly fix the code to work?22:11
mccrearyTBC, '/dev/block/sd?' must be the actual device nodes, IIUC22:11
mccrearygpt_utils is one of the 'vendor-specific' bits of code22:12
mccrearyGoogle published a version for their handsets, but I haven't verified if it is compatible with the one used for the Pro122:12
mccrearyMotorola diddled their implementaton a bit22:12
mccrearyCan you replace the symlinks in /dev/block with actual device nodes?22:13
mccreary...using 'mknod'22:14
mccrearye.g. 'mknod -m 600 sda b 8 0'22:16
mccreary(apologies if I am being pedantic)22:18
piggz_mccreary: i did the mknot without the -m 600, and it didnt chnge anything22:19
piggz_https://pastebin.com/LAChAEJ322:19
mccrearyHrm. What does logcat say?22:22
piggz_exactly the same22:22
piggz_07-14 23:22:31.678  3900  3900 E gpt-utils: gpt_get_header: Failed to open ../../../../.. : Is a directory22:22
piggz_07-14 23:22:31.678  3900  3900 E gpt-utils: gpt_disk_get_disk_info: Failed to get primary header22:23
piggz_07-14 23:22:31.678  3900  3900 E bootcontrolhal: update_slot_attribute: Failed to get disk info for xbl_a22:23
piggz_07-14 23:22:31.678  3900  3900 E bootcontrolhal: mark_boot_successful: Failed to mark boot successful22:23
piggz_mccreary: gonna have to call it a night, thx for your help tho22:25
piggz_if u find anything, post it :)22:25
mccrearyNotice '../../../../..' is 14 characters long. The code drops a null at position 15, truncating the path22:26
mccrearyThat produces the error reported by logcat22:27
mccrearyThe problem is in get_dev_path_from_partition_name() in vendor/qcom/opensource/recovery-ext/oem-recovery/gpt-utils.cpp22:28
mccrearyat line 110322:28
mccrearyThe idiot who wrote that code was trying to work around the fact that readlink() doesn't null-terminate the path22:30
mccrearyAnd assumed all paths were the same size as '/dev/block/sda'22:30
mccrearyYou can fix this using the return value of readlink(), as follows:22:31
mccrearyhttps://pastebin.com/WT58acZ1 (or similar changes)22:33
mccrearyHowever, that will mean digging for an open-source version of gpt-utils.cpp22:33
mccrearyIf you want to make the binary blobs work, you'll need to make sure the paths returned by readlink() are all 14 characters long22:34
mccrearyAnd that means restructuring your /dev tree22:35
mccreary...aaaand this is why we all hate CAF22:35
T42<adampigg> Well, i can add further debugging  around there, and if nescessary, change the size of buf i guess22:35
mccrearyThe buffer size isn't the problem, it's the code on line 1103 that always truncates the path to 14 characters22:36
T42<adampigg> True, i wonderd if they made buf 14ish chars long22:37
T42<adampigg> Cant see the code atm22:37
mccrearyNo worries, there's time to work on it tomorrow22:38
T42<adampigg> Yep, though im on a fairly intensive course all week!22:38
mccreary...or as they say in New Mexico, 'Manana'22:38
T42<adampigg> I mean, what course starts on a sunday, and goes on until 10pm!22:39
mccrearyIn NM, 'manana' doesn't literally mean the next day ;-)22:39
T42<adampigg> :)22:40
mccrearyFYI, I think my pseudocode fix had an off-by-one error: https://pastebin.com/PRrH9pMu22:46
mccrearyAnd also, the code I was tracing ends up in android.hardware.boot@1.0-service, not in bootctl22:56
mccrearyIf you want to fix the code, it might be easier to bypass HIDL22:57

Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!