FriendlyNeighborhoodShane / MinMicroG-abuse-CI

Automatic MinMicroG builder for updatelys. DO NOT STAR. You will find constant unneccessary notifications in your mail whenever I play around with it.
83 stars 8 forks source link

Issue with chcon in release 2023.01.01 #5

Closed storm1ng closed 1 year ago

storm1ng commented 1 year ago

Hi

There seems to be an issue with the latest release (2023.01.01). I get the following message when I try to install it: no chcon available.

Version 2022.12.02 works fine though.

EDIT Some more information:

I'm not able to provide any logs since the recovery hangs itself up completely. These is an excerpt of that was on the screen:

!!! FATAL ERROR: No chcon available

Stopping installation and Uninstalling...

Installation failed!

I tested the Version 2022.12.31 which is also working properly. It seems to be related to the dynamic partition support.

FriendlyNeighborhoodShane commented 1 year ago

Hi, yes, this would seem to be related to recent changes related to dynamic partition support.

What is your device and the recovery you are using for installation?

I'm not able to provide any logs since the recovery hangs itself up completely. These is an excerpt of that was on the screen:

That is really weird, it should really not be doing that.

storm1ng commented 1 year ago

What is your device and the recovery you are using for installation?

I'm using a Oneplus 8 Pro with LineageOS recovery.

FriendlyNeighborhoodShane commented 1 year ago

Try this build:

https://github.com/FriendlyNeighborhoodShane/MinMicroG-abuse-CI/releases/tag/2023.01.09

If installation stil fails then I will need the installation logs to determine anything further.

One way to obtain them if the recovery still hangs up would be:

Now, even if the recovery hangs, you will have a recovery.log file on your PC, which will have at least a partial log of the install. You might have to disconnect/reboot your device or forcefully terminate adb with CTRL+C.

storm1ng commented 1 year ago

Didn't work:

[   14.574990] Now send the package you want to apply
[   14.574991] to the device with "adb sideload <filename>"...
[   14.628506] minadbd I 12-23 08:01:14   636   637 usb_ffs.cpp:275] opening control endpoint /dev/usb-ffs/adb/ep0
[   14.629289] minadbd I 12-23 08:01:14   636   637 usb.cpp:152] UsbFfsConnection constructed
[   14.629574] minadbd I 12-23 08:01:14   636   638 usb.cpp:259] UsbFfs-monitor thread spawned
[   14.631501] minadbd I 12-23 08:01:14   636   638 usb.cpp:298] USB event: FUNCTIONFS_BIND
[   15.151289] minadbd I 12-23 08:01:14   636   638 usb.cpp:298] USB event: FUNCTIONFS_ENABLE
[   15.151312] minadbd I 12-23 08:01:14   636   640 usb.cpp:405] UsbFfs-worker thread spawned
[   16.175638] minadbd I 12-23 08:01:15   636   636 adb.cpp:171] UsbFfs: already offline
[   16.175824] minadbd I 12-23 08:01:15   636   636 adb.cpp:388] authentication not required
[   17.794554] minadbd I 12-23 08:01:17   636   641 minadbd_services.cpp:111] sideload-host file size 46124544, block size 65536
[   18.794823] unknown fuse request opcode 2016
[   18.807413] W:Failed to read /sys/class/thermal/thermal_zone63/temp: Invalid argument
[   18.807483] W:Failed to read /sys/class/thermal/thermal_zone62/temp: Invalid argument
[   18.807551] W:Failed to read /sys/class/thermal/thermal_zone61/temp: Invalid argument
[   18.807620] W:Failed to read /sys/class/thermal/thermal_zone60/temp: Invalid argument
[   18.807736] W:Failed to read /sys/class/thermal/thermal_zone59/temp: Invalid argument
[   18.807812] W:Failed to read /sys/class/thermal/thermal_zone58/temp: Invalid argument
[   18.807894] W:Failed to read /sys/class/thermal/thermal_zone57/temp: Invalid argument
[   18.807963] W:Failed to read /sys/class/thermal/thermal_zone56/temp: Invalid argument
[   18.808035] W:Failed to read /sys/class/thermal/thermal_zone55/temp: Invalid argument
[   18.808105] W:Failed to read /sys/class/thermal/thermal_zone54/temp: Invalid argument
[   18.808181] W:Failed to read /sys/class/thermal/thermal_zone53/temp: Invalid argument
[   18.808249] W:Failed to read /sys/class/thermal/thermal_zone52/temp: Invalid argument
[   18.808318] W:Failed to read /sys/class/thermal/thermal_zone51/temp: Invalid argument
[   18.808395] W:Failed to read /sys/class/thermal/thermal_zone50/temp: Invalid argument
[   18.808493] W:Failed to read /sys/class/thermal/thermal_zone49/temp: Invalid argument
[   18.808556] W:Failed to read /sys/class/thermal/thermal_zone48/temp: Invalid argument
[   18.810065] I:current maximum temperature: 32300
[   18.810088] Supported API: 3
[   18.847289] Finding update package...
[   18.897217] I:Update package id: /sideload/package.zip
[   19.047343] I:2 key(s) loaded from /system/etc/security/otacerts.zip
[   19.047365] Verifying update package...
[   19.133553] ERROR:   recovery: footer is wrong
[   19.229967] Update package verification took 0.1 s (result 1).
[   19.329771] ERROR:   recovery: Signature verification failed
[   19.479496] ERROR:   recovery: error: 21
[   22.607319] Installing update...
[   22.714173] W:Failed to find META-INF/com/android/metadata.pb treating this as non-spl-downgrade, permit OTA install. If device bricks after installing, check kernel log to see if /data failed to decrypt
[   23.052779] losetup: /dev/block/loop0=/dev/urandom: Invalid argument
[   23.053450] mount: losetup failed 1
[   23.056448]  
[   23.056459] Zip File is /sideload/package.zip
[   23.056464] Bootmode is false
[   23.056469] /tmp/update-binary[140]: syntax error: unexpected 'done'
[   23.689033] ERROR:   recovery: Error in /sideload/package.zip (status 1)
[   23.822042]
[   23.981450] I:/sideload/package.zip
[   23.981453] 0
[   23.981455] time_total: 5
[   23.981457] retry: 0
[   23.981459] error: 21

There seems to be a syntax issue: /tmp/update-binary[140]: syntax error: unexpected 'done'.

Although I couldn't see why this particular done should be problematic. It's part of the for-loop.

FriendlyNeighborhoodShane commented 1 year ago

Ah fuck.

There seems to be a syntax issue: /tmp/update-binary[140]: syntax error: unexpected 'done'.

Although I couldn't see why this particular done should be problematic. It's part of the for-loop.

Me neither for the last 5 minutes, but then I just decided to stick it into shellcheck.

It's because I stupidly used else if instead of elif, because shell scripting just has to be weird :)

Gimme a min.

FriendlyNeighborhoodShane commented 1 year ago

Updated release: https://github.com/FriendlyNeighborhoodShane/MinMicroG-abuse-CI/releases/tag/2023.01.09

FriendlyNeighborhoodShane commented 1 year ago

Also if you're using adb sideload to flash this then you will not be able to simultaneously use the shell for getting the log. Would it be possible for you to copy (adb push) the zip on-device (somewhere e.g. the SD card or /tmp), and then use the in-recovery flashing menu?

storm1ng commented 1 year ago

Yeah, that I just realized. However, the in recovery zip flashing isn't available on LOS recovery.

I used ale5000-git's (micro5k) zip-install.sh and this is what I got:

OnePlus8Pro:/ # sh '/sdcard/zip-install.sh' '/sdcard/MinMicroG-NoGoolag-UPDATELY-20230109191013.zip'                                                                                                                                         
losetup: /dev/block/loop0=/dev/urandom: Invalid argument
mount: losetup failed 1
ui_print  
ui_print
ui_print --         Minimal MicroG Installer         --
ui_print
ui_print --     The Essentials only MicroG pack      --
ui_print

Zip File is /sdcard/MinMicroG-NoGoolag-UPDATELY-20230109191013.zip
Bootmode is false

Mounting early
Found system block at /dev/block/mapper/system_b
Mountpoint /mnt/system already mounted
mount: '/system' not in fstab
Mountpoint /system mounted (manual)
/tmp/update-binary.sh[143]: mount: inaccessible or not found
ui_print  
ui_print
ui_print !!! FATAL ERROR: No chcon available
ui_print
ui_print  
ui_print
ui_print Stopping installation and Uninstalling...
ui_print
/tmp/update-binary.sh[167]: uninstall_pack: inaccessible or not found
/tmp/update-binary.sh[167]: rm: inaccessible or not found
/tmp/update-binary.sh[167]: umount: inaccessible or not found
/tmp/update-binary.sh[167]: umount: inaccessible or not found
/tmp/update-binary.sh[167]: sync: inaccessible or not found
ui_print  
ui_print
ui_print Installation failed!
ui_print
ui_print  
ui_print
/sdcard/zip-install.sh[79]: rm: inaccessible or not found
/sdcard/zip-install.sh[85]: printf: inaccessible or not found

I know, it's not the same but as good as it gets...

FriendlyNeighborhoodShane commented 1 year ago

It seems the new mounting code is breaking something in this recovery. Can you send me the outputs of a few commands run from adb shell from a "fresh" boot of the recovery:

which -a chcon

which -a mount

echo $PATH

mount
storm1ng commented 1 year ago
OnePlus8Pro:/ # which -a chcon
/system/bin/chcon
OnePlus8Pro:/ # which -a mount
/system/bin/mount
OnePlus8Pro:/ # echo $PATH
/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin
OnePlus8Pro:/ # mount
rootfs on / type rootfs (rw,seclabel,size=5678640k,nr_inodes=1419660)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=5874096k,nr_inodes=1468524,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600,ptmxmode=000)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /mnt type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=5874096k,nr_inodes=1468524,mode=755,gid=1000)
tmpfs on /apex type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=5874096k,nr_inodes=1468524,mode=755)
tmpfs on /linkerconfig type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=5874096k,nr_inodes=1468524,mode=755)
tmpfs on /mnt/installer type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=5874096k,nr_inodes=1468524,mode=755,gid=1000)
tmpfs on /mnt/androidwritable type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=5874096k,nr_inodes=1468524,mode=755,gid=1000)
none on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,seclabel,relatime,size=5874096k,nr_inodes=1468524)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,size=5874096k,nr_inodes=1468524,mode=050,gid=1028)
binder on /dev/binderfs type binder (rw,relatime,max=1048576,stats=global)
pstore on /sys/fs/pstore type pstore (rw,seclabel,relatime)
none on /config type configfs (rw,relatime)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
fastboot on /dev/usb-ffs/fastboot type functionfs (rw,relatime)
/dev/block/dm-7 on /mnt/system type ext4 (ro,seclabel,relatime,discard)
OnePlus8Pro:/ # 
FriendlyNeighborhoodShane commented 1 year ago

Okay, I think I see the problem.

FriendlyNeighborhoodShane commented 1 year ago

Updated: https://github.com/FriendlyNeighborhoodShane/MinMicroG-abuse-CI/releases/tag/2023.01.09

Oh boy, I hope this is the one.

storm1ng commented 1 year ago

It's working now. :smiley:

Now it is even working without previously mounting the /system partition. :rocket:

FriendlyNeighborhoodShane commented 1 year ago

Awesome.

flortsch commented 1 year ago

I am still getting the same error about missing chcon when sideloading recently released zip files (2023.08.13). Running LineageOS recovery on Samsung Galaxy S10e.

beyond0lte:/ # which -a chcon
/system/bin/chcon
beyond0lte:/ # which -a mount
/system/bin/mount
beyond0lte:/ # echo $PATH
/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin
beyond0lte:/ # mount
rootfs on / type rootfs (rw,seclabel)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=2647520k,nr_inodes=661880,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600,ptmxmode=000)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /mnt type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=2647520k,nr_inodes=661880,mode=755,gid=1000)
tmpfs on /apex type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=2647520k,nr_inodes=661880,mode=755)
tmpfs on /linkerconfig type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=2647520k,nr_inodes=661880,mode=755)
tmpfs on /mnt/installer type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=2647520k,nr_inodes=661880,mode=755,gid=1000)
tmpfs on /mnt/androidwritable type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=2647520k,nr_inodes=661880,mode=755,gid=1000)
none on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,seclabel,relatime)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,mode=050,gid=1028)
binder on /dev/binderfs type binder (rw,relatime,max=1048576,stats=global)
pstore on /sys/fs/pstore type pstore (rw,seclabel,relatime)
none on /config type configfs (rw,relatime)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
fastboot on /dev/usb-ffs/fastboot type functionfs (rw,relatime)

Mount with /system mounted:

beyond0lte:/ # mount                                                                                                                                                                                                                                                                                                          
rootfs on / type rootfs (rw,seclabel)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=2647520k,nr_inodes=661880,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600,ptmxmode=000)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /mnt type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=2647520k,nr_inodes=661880,mode=755,gid=1000)
tmpfs on /apex type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=2647520k,nr_inodes=661880,mode=755)
tmpfs on /linkerconfig type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=2647520k,nr_inodes=661880,mode=755)
tmpfs on /mnt/installer type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=2647520k,nr_inodes=661880,mode=755,gid=1000)
tmpfs on /mnt/androidwritable type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=2647520k,nr_inodes=661880,mode=755,gid=1000)
none on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,seclabel,relatime)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,mode=050,gid=1028)
binder on /dev/binderfs type binder (rw,relatime,max=1048576,stats=global)
pstore on /sys/fs/pstore type pstore (rw,seclabel,relatime)
none on /config type configfs (rw,relatime)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
fastboot on /dev/usb-ffs/fastboot type functionfs (rw,relatime)
/dev/block/sda25 on /mnt/system type ext4 (ro,seclabel,relatime)
FriendlyNeighborhoodShane commented 1 year ago

Does your recovery crash after this as well? If not, it'd be helpful information if you get the recovery logs after the flash:

adb pull /tmp/recovery.log
flortsch commented 1 year ago

Yeah, recovery crashes on my device as well. Will try the same approach as @mjenny did with zip-install.sh and try to get a log.

FriendlyNeighborhoodShane commented 1 year ago

You can also try this: https://github.com/FriendlyNeighborhoodShane/MinMicroG-abuse-CI/issues/5#issuecomment-1376111159

flortsch commented 1 year ago

I can't run an adb shell and adb sideload command in parallel. As soon as I sideload, the shell for getting the log file immediately closes. And sideloading is the only way in LineageOS recovery to install zip files.

But here is the output when using the zip-install.sh file:

beyond0lte:/tmp # ./zip-install.sh MinAddon-Playstore-Playstore-UPDATELY-20230813063041.zip                                                                                                                                                                                                                                   
losetup: /dev/block/loop0=/dev/urandom: Invalid argument
mount: losetup failed 1
ui_print  
ui_print
ui_print --         Minimal MicroG Installer         --
ui_print
ui_print --     The Essentials only MicroG pack      --
ui_print

Zip File is /tmp/MinAddon-Playstore-Playstore-UPDATELY-20230813063041.zip
Bootmode is false

Mounting early
Mountpoint /system mounted (auto)
/tmp/update-binary[142]: getprop: inaccessible or not found
/tmp/update-binary[142]: getprop: inaccessible or not found
/tmp/update-binary[142]: grep: inaccessible or not found
/tmp/update-binary[142]: grep: inaccessible or not found
/tmp/update-binary[142]: tail: inaccessible or not found
/tmp/update-binary[142]: tr: inaccessible or not found
/tmp/update-binary[142]: cut: inaccessible or not found
/tmp/update-binary[142]: grep: inaccessible or not found
/tmp/update-binary[142]: grep: inaccessible or not found
/tmp/update-binary[142]: tail: inaccessible or not found
/tmp/update-binary[142]: cut: inaccessible or not found
/tmp/update-binary[142]: tr: inaccessible or not found
/tmp/update-binary[142]: mkdir: inaccessible or not found
/tmp/update-binary[142]: mount: inaccessible or not found
Mountpoint /mnt/system mounted (manual /dev/block/by-name//system)
/tmp/update-binary[142]: mount: inaccessible or not found
ui_print  
ui_print
ui_print !!! FATAL ERROR: No chcon available
ui_print
ui_print  
ui_print
ui_print Stopping installation and Uninstalling...
ui_print
/tmp/update-binary[166]: uninstall_pack: inaccessible or not found
/tmp/update-binary[166]: rm: inaccessible or not found
/tmp/update-binary[166]: umount: inaccessible or not found
/tmp/update-binary[166]: umount: inaccessible or not found
/tmp/update-binary[166]: umount: inaccessible or not found
/tmp/update-binary[166]: sync: inaccessible or not found
ui_print  
ui_print
ui_print Installation failed!
ui_print
ui_print  
ui_print
./zip-install.sh[143]: rm: inaccessible or not found
./zip-install.sh[143]: rm: inaccessible or not found
./zip-install.sh[149]: printf: inaccessible or not found
1|beyond0lte:/tmp #
flortsch commented 1 year ago

Found out that the developer of the LineageOS port for my phone forked your repo in the past and included a fix for these kind of issues. Maybe you can have a look into this and see if this could be integrated into your repo as well.

Edit: Ah, never mind. Just saw in the git history that this was already included in your code base as well.

FriendlyNeighborhoodShane commented 1 year ago

I think I see the problem, but I'm not sure how to solve this without breaking other devices.