Magisk
Magisk copied to clipboard
Magisk doesn't install after flashing patched boot.img
Can't seem to get Magisk installed after flashing the boot.img with fastboot in the bootloader. Could seem like it doesn't flash the boot partition, but can't seem to spot anything weird with UART.
Device: A95XF1 (Amlogic S905W) Android version: 13 (LineageOS 20) Magisk version name: 26.3 Magisk version code: 26301
boot.img.zip magisk_patched-26301_wyWJB.img.zip magisk_install_log_2023-09-27T12.11.21.log dmesg.txt uart-bootloader-flashing-reboot.txt
Some "Legacy SAR" devices don't allow booting when one is added. Yours appears to fit this description, with hdr v2 and no ramdisk in the boot partition. Your only alternative would be to attempt to patch the recovery partition instead (if your device has one) and then you may boot rooted only by booting to recovery. Nothing else Magisk can do about these.
yes, this device has recovery partition
[ 4.533357@2] meson-mmc: [mmcblk0p01] bootloader offset 0x000000000000, size 0x000000400000
[ 4.533810@2] meson-mmc: [mmcblk0p02] reserved offset 0x000002400000, size 0x000004000000
[ 4.534143@2] meson-mmc: [mmcblk0p03] cache offset 0x000006c00000, size 0x000046000000
[ 4.534414@2] meson-mmc: [mmcblk0p04] env offset 0x00004d400000, size 0x000000800000
[ 4.534694@2] meson-mmc: [mmcblk0p05] logo offset 0x00004e400000, size 0x000000800000
[ 4.534967@2] meson-mmc: [mmcblk0p06] recovery offset 0x00004f400000, size 0x000001800000
[ 4.535259@2] meson-mmc: [mmcblk0p07] misc offset 0x000051400000, size 0x000000800000
[ 4.535536@2] meson-mmc: [mmcblk0p08] dtbo offset 0x000052400000, size 0x000000800000
[ 4.535813@2] meson-mmc: [mmcblk0p09] cri_data offset 0x000053400000, size 0x000000800000
[ 4.536192@2] meson-mmc: [mmcblk0p10] param offset 0x000054400000, size 0x000001000000
[ 4.536525@2] meson-mmc: [mmcblk0p11] boot offset 0x000055c00000, size 0x000001000000
[ 4.536811@2] meson-mmc: [mmcblk0p12] rsv offset 0x000057400000, size 0x000001000000
[ 4.537094@2] meson-mmc: [mmcblk0p13] metadata offset 0x000058c00000, size 0x000001000000
[ 4.537367@2] meson-mmc: [mmcblk0p14] vbmeta offset 0x00005a400000, size 0x000000200000
[ 4.537633@2] meson-mmc: [mmcblk0p15] tee offset 0x00005ae00000, size 0x000002000000
[ 4.537913@2] meson-mmc: [mmcblk0p16] vendor offset 0x00005d600000, size 0x000014000000
[ 4.538195@2] meson-mmc: [mmcblk0p17] odm offset 0x000071e00000, size 0x000008000000
[ 4.538479@2] meson-mmc: [mmcblk0p18] system offset 0x00007a600000, size 0x000062c00000
[ 4.538776@2] meson-mmc: [mmcblk0p19] product offset 0x0000dda00000, size 0x000040000000
[ 4.539062@2] meson-mmc: [mmcblk0p20] data offset 0x00011e200000, size 0x00028d200000
I checked the patched image and found that the kernel was not patched.
[ 0.000000@0] Kernel command line: init=/init console=ttyS0,115200 no_console_suspend earlycon=aml_uart,0xc81004c0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 otg_device=1 reboot_mode_android=normal androidboot.selinux=enforcing logo=osd1,loaded,0x3d800000,576cvbs maxcpus=4 vout=576cvbs,enable hdmimode=1080p60hz frac_rate_policy=1 cvbsmode=576cvbs hdmitx=,444,8bit cvbsdrv=0 irq_check_en=0 androidboot.firstboot=0 jtag=disable androidboot.veritymode=enforcing androidboot.hardware=amlogic androidboot.bootloader=U-Boot 2015.01-g2daced4fd4 androidboot.build.expect.baseband=N/A page_trace=on androidboot.rpmb_state=0 androidboot.serialno=1234567890 mac=1e:a9:33:35:cd:08 androidboot.mac=1e:a9:33:35:cd:08 androidboot.wificountrycode=US ro rootwait skip_initramfs androidboot.selinux=permissive root=/dev/mmcblk0p18 androidboot.dtbo_idx=0 hdr_policy=1 otg_device=1 buildvariant=userdebug
:/data/local/tmp # ./magiskboot unpack magisk_patched-26301_wyWJB.img
Parsing boot image: [magisk_patched-26301_wyWJB.img]
HEADER_VER [2]
KERNEL_SZ [9978926]
RAMDISK_SZ [346584]
SECOND_SZ [57276]
RECOV_DTBO_SZ [0]
DTB_SZ [57276]
OS_VERSION [13.0.0]
OS_PATCH_LEVEL [2023-08]
PAGESIZE [2048]
NAME []
CMDLINE [androidboot.selinux=permissive root=/dev/mmcblk0p18 androidboot.dtbo_idx=0 hdr_policy=1 otg_device=1 buildvariant=userdebug]
CHECKSUM [0ef295fa4c2f496ba24d9a1546f200de7137a2ca000000000000000000000000]
KERNEL_FMT [gzip]
RAMDISK_FMT [raw]
unexpected ASN.1 DER tag: expected SEQUENCE, got APPLICATION [1] (primitive)
VBMETA
:/data/local/tmp # strings kernel | grep initramfs
6Trying to unpack rootfs image as initramfs...
6rootfs image is not initramfs (%s); looks like an initrd
skip_initramfs
:/data/local/tmp #
Some "Legacy SAR" devices don't allow booting when one is added. Yours appears to fit this description, with hdr v2 and no ramdisk in the boot partition...
Strange fish if this TV box is A only L-SAR... I never heard of any other than launched with Android 9... (Google only made SAR from A7, A/B)... Appears this box first had Android 6 and they're being sold currently with Android 8.1 stock... Should be (launched as) legacy ramdisk boot type now converted to '2SI ramdisk SAR' with A10+ by rights...
Bootloader does what it does, can't change that. But ah, I see vvb found something interesting about the kernel patching. We shall see! 👍
@Cronick Attach /proc/mounts
?
Sorry. Wasn't aware the question was for me. mounts.txt
/dev/block/system / ext4 ro,seclabel,nodev,relatime,block_validity,delalloc,barrier,user_xattr,acl 0 0
[ 4.889579] EXT4-fs (mmcblk0p18): couldn't mount as ext3 due to feature incompatibilities
[ 4.895391] EXT4-fs (mmcblk0p18): couldn't mount as ext2 due to feature incompatibilities
[ 4.907615] EXT4-fs (mmcblk0p18): mounted filesystem without journal. Opts: (null)
[ 4.911004] VFS: Mounted root (ext4 filesystem) readonly on device 179:18.
[ 4.918701] devtmpfs: mounted
[ 4.925428] Freeing unused kernel memory: 5376K
[ 4.927728] vpu: switch_vpu_mem_pd: unsupport vpu mod: 12
[ 5.096687] init: init first stage started!
[ 5.097462] init: Unable to open /lib/modules, skipping module loading.
[ 5.116826] init: [libfs_mgr]ReadDefaultFstab(): failed to find device default fstab
[ 5.120228] init: Using Android DT directory /proc/device-tree/firmware/android/
[ 5.163983] init: DSU not detected, proceeding with normal boot
[ 5.164774] init: AVB is not enabled, skip verity setup for '/system'
[ 5.171393] init: [libfs_mgr]superblock s_max_mnt_count:65535,/dev/block/system
[ 5.179100] init: [libfs_mgr]__mount(source=/dev/block/system,target=/system,type=ext4)=0: Success
[ 5.188687] init: Switching root to '/system'
[ 5.192556] init: AVB is not enabled, skip verity setup for '/odm'
[ 5.202541] EXT4-fs (mmcblk0p17): mounted filesystem without journal. Opts: barrier=1,inode_readahead_blks=8
[ 5.212823] EXT4-fs (mmcblk0p19): mounted filesystem without journal. Opts: barrier=1,inode_readahead_blks=8
[ 5.222755] EXT4-fs (mmcblk0p16): mounted filesystem without journal. Opts: barrier=1,inode_readahead_blks=8
[ 5.232344] init: 9 output lines suppressed due to ratelimiting
[ 5.275999] init: Skipping mount of system_ext, system is not dynamic.
[ 4.538479] meson-mmc: [mmcblk0p18] system offset 0x00007a600000, size 0x000062c00000
The kernel sees skip_initramfs
and root=/dev/mmcblk0p18
, mounts /system
as /
, then init again mounts /system
and switch root to /system
.
/proc/mounts
looks like rootfs-based 2SI, so skip_initramfs
isn't patched out from kernel.
I've just bought a Pixel 7a (lynx) and installed LineageOS (using lineage-20.0-20231020-nightly-lynx-signed.zip). I have exactly the same problem as mentioned above: installing the patched boot img file seems to succeed but Magisk always shows "Installed: N/A".
Hi is there an alternative way to this? I have the same issue after flashing the patch boot magisk installed is still n/a currently using mi 13
magisk_install_log_2023-11-11T01.28.06.log magisk_patched_boot.zip boot.zip
I successfully used the custom recovery installation method: https://topjohnwu.github.io/Magisk/install.html#custom-recovery
same problem here with a Pixel 7a (lynx) using LineageOS like @DamienCassou reported