FORUMS
Remove All Ads from XDA

[DEV][TEMPLATE] AnyKernel3 - Easily Mod ROM Ramdisk + Pack Image.gz [Flashable Zip]

13,844 posts
Thanks Meter: 30,680
 
By osm0sis, Recognized Developer / Recognized Contributor on 5th March 2014, 03:32 AM
Post Reply Email Thread
6th January 2020, 08:49 PM |#881  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,680
 
Donate to Me
More
Quote:
Originally Posted by kevp75

@osm0sis
Having a minor issue on a xiaomi mi9t (davinci), wondering if you can point me in the right direction...

debug log shows:


Code:
I:operation_start: 'Flashing'
Installing zip file '/sdcard/Download/Test-debugging.zip'
Checking for Digest file...
I:Update binary zip
Verifying package compatibility...
Package doesn't contain compatibility.zip entry
I:Extracting updater binary 'META-INF/com/google/android/update-binary'
I:Zip does not contain SELinux file_contexts file in its root.
I:Legacy property environment not used in updater.
 
Archive:  /sdcard/Download/Test-debugging.zip
  inflating: tools/ak3-core.sh
  inflating: tools/magiskboot
  inflating: META-INF/com/google/android/updater-script
  inflating: META-INF/com/google/android/update-binary
  inflating: anykernel.sh
  inflating: tools/busybox
  inflating: sbin/busybox
  inflating: tools/magiskpolicy
KevP75-Davinci
 
AnyKernel3 by osm0sis @ xda-developers
 
 
mount: can't find /system in /etc/fstab
Checking device...
davinci
 
Installing...
chmod: /tmp/anykernel/ramdisk/*: No such file or directory
chown: /tmp/anykernel/ramdisk/*: No such file or directory
Starting Patch
128+0 records in
128+0 records out
134217728 bytes (128.0MB) copied, 0.408021 seconds, 313.7MB/s
Parsing boot image: [/tmp/anykernel/boot.img]
HEADER_VER      [1]
KERNEL_SZ       [16166989]
RAMDISK_SZ      [350172]
SECOND_SZ       [0]
EXTRA_SZ        [0]
RECOV_DTBO_SZ   [0]
DTB             [0]
OS_VERSION      [10.0.0]
OS_PATCH_LEVEL  [2019-12]
PAGESIZE        [4096]
NAME            []
CMDLINE         [console=ttyMSM0,115200n8 androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 service_locator.enable=1 swiotlb=1 androidboot.usbcontroller=a600000.dwc3 earlycon=msm_geni_serial,0x880000 loop.max_part=7 buildvariant=user]
CHECKSUM        [8ea6a4643b58c751dc11a1eb02f181767536a5ba]
KERNEL_DTB      [2474670]
KERNEL_FMT      [gzip]
RAMDISK_FMT     [raw]
Ramdisk is uncompressed or not a supported compressed type!
cp: can't create '/tmp/anykernel/ramdisk/sbin/': No such file or directory
chmod: /tmp/anykernel/ramdisk/sbin/busybox: No such file or directory
cp: '/tmp/anykernel/split_img/kernel' and 'kernel' are the same file
cp: '/tmp/anykernel/split_img/ramdisk.cpio' and 'ramdisk.cpio' are the same file
Parsing boot image: [/tmp/anykernel/boot.img]
HEADER_VER      [1]
KERNEL_SZ       [16166989]
RAMDISK_SZ      [350172]
SECOND_SZ       [0]
EXTRA_SZ        [0]
RECOV_DTBO_SZ   [0]
DTB             [0]
OS_VERSION      [10.0.0]
OS_PATCH_LEVEL  [2019-12]
PAGESIZE        [4096]
NAME            []
CMDLINE         [console=ttyMSM0,115200n8 androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 service_locator.enable=1 swiotlb=1 androidboot.usbcontroller=a600000.dwc3 earlycon=msm_geni_serial,0x880000 loop.max_part=7 buildvariant=user]
CHECKSUM        [8ea6a4643b58c751dc11a1eb02f181767536a5ba]
KERNEL_DTB      [2474670]
KERNEL_FMT      [gzip]
RAMDISK_FMT     [raw]
Repack to boot image: [/tmp/anykernel/boot-new.img]
HEADER_VER      [1]
KERNEL_SZ       [16166989]
RAMDISK_SZ      [350172]
SECOND_SZ       [0]
EXTRA_SZ        [0]
RECOV_DTBO_SZ   [0]
DTB             [0]
OS_VERSION      [10.0.0]
OS_PATCH_LEVEL  [2019-12]
PAGESIZE        [4096]
NAME            []
CMDLINE         [console=ttyMSM0,115200n8 androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 service_locator.enable=1 swiotlb=1 androidboot.usbcontroller=a600000.dwc3 earlycon=msm_geni_serial,0x880000 loop.max_part=7 buildvariant=user]
CHECKSUM        [8ea6a4643b58c751dc11a1eb02f181767536a5ba]
Ending Patch


At this point, all I am trying to do is see if it works, and I can make some potential ramdisk modifications. Am I seeing this right? As the device does not have a ramdisk?

Looks like it's got a cpio ramdisk, likely from being rooted by Magisk. So that'd mean there was none to begin with since it's a system-as-root device and modifications are only possible when rooted.

See the links in the OP for lots of info on how to go about that.
The Following User Says Thank You to osm0sis For This Useful Post: [ View ]
7th January 2020, 01:44 AM |#882  
Jonas Cardoso's Avatar
Senior Member
Flag São José dos Campos
Thanks Meter: 2,646
 
Donate to Me
More
hey @osm0sis, have any way to keep magisk after flash? I recently started using your package and I have this little problem. I dont changed anything basically from the original
Android 10 ARM64 device
https://github.com/JonasCardoso/AnyK...commits/master
7th January 2020, 02:57 AM |#883  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,680
 
Donate to Me
More
Quote:
Originally Posted by Jonas Cardoso

hey @osm0sis, have any way to keep magisk after flash? I recently started using your package and I have this little problem. I dont changed anything basically from the original
Android 10 ARM64 device
https://github.com/JonasCardoso/AnyK...commits/master

Those same links in the OP explain the current root retention solutions.
7th January 2020, 03:27 AM |#884  
Jonas Cardoso's Avatar
Senior Member
Flag São José dos Campos
Thanks Meter: 2,646
 
Donate to Me
More
Quote:
Originally Posted by osm0sis

Those same links in the OP explain the current root retention solutions.

I didn't understand how I should use the feature to retain magisk installation
7th January 2020, 03:42 AM |#885  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,680
 
Donate to Me
More
Quote:
Originally Posted by Jonas Cardoso

I didn't understand how I should use the feature to retain magisk installation

Here's a step by step:
1) Read the OP.
2) Follow the link that mentions root retention.
3) Read the post about root retention.
4) Follow the instructions in the root retention post.





Hint: It's under the Edit 3 heading.
7th January 2020, 02:10 PM |#886  
kevp75's Avatar
Recognized Contributor
Flag MA
Thanks Meter: 7,179
 
Donate to Me
More
Quote:
Originally Posted by osm0sis

Looks like it's got a cpio ramdisk, likely from being rooted by Magisk. So that'd mean there was none to begin with since it's a system-as-root device and modifications are only possible when rooted.
See the links in the OP for lots of info on how to go about that.

Awesome. Appreciate it mate.
14th January 2020, 11:10 PM |#887  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,680
 
Donate to Me
More
It's a new year and it's time for some new features for AK3! First up, with massive thanks and full credit to @Zackptg5, we can now run /system/bin commands in recovery during flash on Android 10 that require the APEX com.android.runtime libc to be mounted. Next I have also fixed AVBv1 signing on Android 10 since upstream AOSP removed one of the command-line options we were using for the dalvikvm invocation; this should still work on older devices without issue from my testing. Lastly (for now ), thanks to @topjohnwu adding my long-time request for Image.*-dtb splitting to magiskboot, AK3 now can finally automatically repatch the new kernel during flash to keep root if Magisk is detected!

My development work on my many projects comes out of my free time, so if you enjoy this project or anything else I've done on xda, please consider sponsoring my ongoing work using my GitHub Sponsors profile. For a one-time donation you can hit the donate link from my profile. Thank you for your support!

tools: update magisk utils to v20.2(20200) stable:
https://github.com/osm0sis/AnyKernel...c522256a11952c

Add apex mount/umount (#48):
https://github.com/osm0sis/AnyKernel...c3a3dfc694995a

Should only run in recovery:
https://github.com/osm0sis/AnyKernel...e09ef330ba6d4f

tools: update magisk utils to v20.3(20300) stable:
https://github.com/osm0sis/AnyKernel...df24e76181c5e4

Backend: APEX mounts support improvements:
https://github.com/osm0sis/AnyKernel...d209318bea307d

AK3: auto split Image.*-dtb to kernel/kernel_dtb + re-patch for Magisk:
https://github.com/osm0sis/AnyKernel...b4a87ff934bc31

AK3: fix AVBv1 signing on Android 10:
https://github.com/osm0sis/AnyKernel...201c9ce55fac20

AK3: only attempt fallback kernel decompression if format was identified:
https://github.com/osm0sis/AnyKernel...4ab05db41fa728

AK3: auto kernel patch improvements:
https://github.com/osm0sis/AnyKernel...093faf9da1a4ef

AK3: only attempt to dump .magisk config if patch found:
https://github.com/osm0sis/AnyKernel...3b5b6c90420e90

AK3: fix false positive Magisk detection after reset_ak:
https://github.com/osm0sis/AnyKernel...3b6f6319ffceb5

Backend: don't attempt to unmount /system_root when booted:
https://github.com/osm0sis/AnyKernel...3bba28223bf6cc

Backend: fix dalvikvm execution in recovery on Android 10:
https://github.com/osm0sis/AnyKernel...d344c8ed5be771

AK3: clean up and simplify Magisk patch logic:
https://github.com/osm0sis/AnyKernel...3e0c635112bb91

AK3: add stderr hints for signing debugging:
https://github.com/osm0sis/AnyKernel...31c1d5d4fa6671

Old workarounds, like having a kernel folder with Image.* and dtb folder with *.dtb, are no longer necessary, including the formerly best-practice scripts that go with them, and people may finally move on from competing hacks like adding the skip_override patch/cmdline. All you need now is back to the basic, original setup of placing the final kernel build output of Image.*-dtb in the root of the AK3 zip.

For any devs transitioning from skip_override I recommend adding the following after unpack to their anykernel.sh for awhile:
Code:
# remove old root patch avoidance hack
patch_cmdline "skip_override" "";
The best-practice documentation linked in the OP has been updated with this as well. Happy hacking!
The Following 9 Users Say Thank You to osm0sis For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
anykernel, flashable zip, kernel, scripting, template

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes