topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
45.73k stars 11.48k forks source link

Unable to detect boot image amlogic s905x #22

Closed jfath closed 7 years ago

jfath commented 7 years ago

I was getting an error when attempting to flash Magisk v9 to my cheap amlogic s905x android TV box.

Looking at the install script, there is no by-name directory for the partitions, so that search will fail, but the section that looks at fstab.recovery seems like it should have worked. When booted into recovery, /etc/fstab.recovery has an entry that reads: /boot emmc /dev/block/boot. From the shell, I ran grep -E '\b/boot\b' /etc/fstab.recovery | grep -oE '/dev/[a-zA-Z0-9_./-]*' and it returned /dev/block/boot.

Here is the relevant code from update-binary:

Code: find_boot_image() { if [ -z "$BOOTIMAGE" ]; then for PARTITION in kern-a KERN-A android_boot ANDROIDBOOT kernel KERNEL boot BOOT lnx LNX; do BOOTIMAGE=readlink /dev/block/by-name/$PARTITION || readlink /dev/block/platform/*/by-name/$PARTITION || readlink /dev/block/platform/*/*/by-name/$PARTITION if [ ! -z "$BOOTIMAGE" ]; then break; fi done fi if [ -z "$BOOTIMAGE" ]; then FSTAB="/etc/recovery.fstab" [ ! -f "$FSTAB" ] && FSTAB="/etc/recovery.fstab.bak" [ -f "$FSTAB" ] BOOTIMAGE=`grep -E '\b/boot\b' "$FSTAB" | grep -oE '/dev/[a-zA-Z0-9./-]*'` fi }

I didn't debug further, but my only guess is that somehow $FSTAB isn't getting set correctly? I know the grep returns the correct string when I hard code fstab.recovery and run it in a recovery shell.

In the end, I inserted BOOTIMAGE="/dev/block/boot" into the update-binary file and the modified .zip installed without a problem. I have a working Magisk installation.

jfath commented 7 years ago

A little more information... Apparently v8 installs OK on these AMlogic s905x boxes. There is a recovery.fstab file, but no recovery.fstab.bak. I mis-typed fstab.recovery in the original report when I meant recovery.fstab.

topjohnwu commented 7 years ago

It's a typo in the scripts, the latest commits have it fixed, thanks for the report!