FORUMS
Remove All Ads from XDA

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

13,849 posts
Thanks Meter: 30,696
 
By osm0sis, Recognized Developer / Recognized Contributor on 5th March 2014, 03:32 AM
Post Reply Email Thread
25th October 2017, 06:02 AM |#521  
Member
Thanks Meter: 55
 
Donate to Me
More
I was thinking of using anykernel2 to patch multiple roms but just not with one zImage, multiple in fact. One for an S8 Port then a N8 Port and NFE and also stock roms. Compile some different kernel zImages for different rom bases and make anykernel2 identify what rom the user is using and install thd appropiate zimage.

Sorry if it didnt make much sense but if you could give some info on what lines to start with in anykernel.sh?
25th October 2017, 12:26 PM |#522  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,696
 
Donate to Me
More
Quote:
Originally Posted by Yuvch122

I was thinking of using anykernel2 to patch multiple roms but just not with one zImage, multiple in fact. One for an S8 Port then a N8 Port and NFE and also stock roms. Compile some different kernel zImages for different rom bases and make anykernel2 identify what rom the user is using and install thd appropiate zimage.

Sorry if it didnt make much sense but if you could give some info on what lines to start with in anykernel.sh?

I had a multi-zImage mod way back, but it was based on filename. You could probably mod it to getprop the product name and use that to decide instead, then have it set the different boot= there as well if necessary. You'd still put it just before dump_boot as shown here:

https://github.com/bsmitty83/DirtyV_...l.sh#L153-L173

Since then, AK2 has been updated to use the actual exit code so you don't have to worry about that part, just make it "exit 1;" if there's no match - of course if you're limited to 5 devices you could just let AK2 do the checks/fails with the device check logic, then just worry about the zImage swapping.
The Following 2 Users Say Thank You to osm0sis For This Useful Post: [ View ]
25th October 2017, 05:03 PM |#523  
Member
Thanks Meter: 55
 
Donate to Me
More
Alright thanks. Ill come back with results
3rd November 2017, 12:31 AM |#524  
FSadino's Avatar
Retired Forum Moderator
Flag Skynet
Thanks Meter: 4,689
 
Donate to Me
More
Hello all,

I need help in use anykernel2 to modify ramdisk from my kernel. I need to add some files to ramdisk ( @frap129 spectrum support) and i found @idprophecy commit to add anykernel for bacon and i cherry-picked

https://github.com/FSadino/AnyKernel...10ec8a89433ac4
https://github.com/FSadino/AnyKernel...63ca202894afd0

Add import /init.spectrum.rc to Makefile
https://github.com/FSadino/omni_andr...623ec04398f0b9

The problem is that it was expected lot of errors during compilation due to diferent names (bacon vs find7op) but it built sucessfuly without any error... but.. i still dont have access to spectrum app. Its like im missing something and my kernel/ramdisk didn´t change anything. Itś like my changes doesnt afect anything at all.

Thanks in advance
3rd November 2017, 01:59 AM |#525  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,696
 
Donate to Me
More
First, don't edit the backend (update-binary) or ak2-core.sh, you'll find it much harder to stay up to date with AK2 changes if you alter them, not to mention it's a bit offensive you removed my credit from the installer. Everything you need to worry about is in anykernel.sh.

Next, AK2 doesn't compile, so I don't know what you're talking about. If you mean flash then yeah, fix the device names in anykernel.sh. In short RTFM.
3rd November 2017, 02:14 AM |#526  
FSadino's Avatar
Retired Forum Moderator
Flag Skynet
Thanks Meter: 4,689
 
Donate to Me
More
Quote:
Originally Posted by osm0sis

First, don't edit the backend (update-binary) or ak2-core.sh, you'll find it much harder to stay up to date with AK2 changes if you alter them, not to mention it's a bit offensive you removed my credit from the installer. Everything you need to worry about is in anykernel.sh.

I didn't read all changed files on that commit so I changed binary by mistake. I'm not the original owner of that commit but I will revert and apologize for that misunderstood.

Quote:

Next, AK2 doesn't compile, so I don't know what you're talking about. If you mean flash then yeah, fix the device names in anykernel.sh. In short RTFM.

It seams I don't understand the concept of anykernel. Thanks for your time!
3rd November 2017, 06:38 AM |#527  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,696
 
Donate to Me
More
Quote:
Originally Posted by FSadino

I didn't read all changed files on that commit so I changed binary by mistake. I'm not the original owner of that commit but I will revert and apologize for that misunderstood.

It seams I don't understand the concept of anykernel. Thanks for your time!

Thanks for reverting that commit.

Start by reading the OP, it explains how to set everything up. You compile a zImage/Image.gz for your kernel then put it in the zip. Your spectrum files go in the zip's ramdisk directory and you have to patch a device .rc to import the spectrum one, so look at something like Franco Kernel which does the same for its init.fk.rc as an example.
The Following User Says Thank You to osm0sis For This Useful Post: [ View ]
5th November 2017, 11:20 PM |#528  
Member
Thanks Meter: 55
 
Donate to Me
More
That's roughly what i'll do, ill add the exit code and all later.
Quote:

if egrep -q "herolte|G930" "/system/build.prop"; then
ui_print "|-> Flat model detected";
ui_print "|-> Swapping with correct zImage";
mv /tmp/notok/kernel/flat /tmp/anykernel/zImage;
mv /tmp/notok/kernel/flatdtb /tmp/anykernel/dtb;
fi;

if egrep -q "hero2lte|G935" "/system/build.prop"; then
ui_print "|-> Flat model detected";
ui_print "|-> Swapping with correct zImage";
mv /tmp/notok/kernel/edge /tmp/anykernel/zImage;
mv /tmp/notok/kernel/edgedtb /tmp/anykernel/dtb;
fi;

I decided ill use the swapping zimages for aosp mainly.

Other than that, i just make my zip install a boot.img as normal but then use anykernel2 to add the mods like init.d and all and then patch the ramdisk for ports.

Thanks my dude!
12th November 2017, 09:34 PM |#529  
linckandrea's Avatar
Senior Member
Flag Roma
Thanks Meter: 1,036
 
Donate to Me
More
Hello everyone

I need help with anykernel2,when i flash it i have error

this is recovery log:

Code:
AnyKernel2 by osm0sis @ xda-developers

Checking device...
victara

Installing kernel...
20400+0 records in
20400+0 records out
10444800 bytes (10.0MB) copied, 0.158219 seconds, 63.0MB/s
BOARD_KERNEL_CMDLINE console=none androidboot.hardware=qcom msm_rtb.filter=0x37 ehci-hcd.park=3 vmalloc=400M buildvariant=userdebug
BOARD_KERNEL_BASE 80200000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 02000000
BOARD_SECOND_OFFSET 00f00000
BOARD_TAGS_OFFSET 01e00000
BOARD_OS_VERSION 7.1.2
BOARD_OS_PATCH_LEVEL 2017-08
BOARD_DT_SIZE 540837
gunzip: invalid magic

Unpacking ramdisk failed. Aborting...
Updater process ended with ERROR: 1
I:Legacy property environment disabled.
I:Install took 2 second(s).
Error installing zip file '/sdcard/ADM/Pop_kernelV1.8r2.zip'


in the attachments I leave the kernel zip,
thank you in advance
Attached Files
File Type: zip Test.zip - [Click for QR Code] (6.28 MB, 20 views)
13th November 2017, 01:21 AM |#530  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,696
 
Donate to Me
More
Quote:
Originally Posted by linckandrea

Hello everyone

I need help with anykernel2,when i flash it i have error

this is recovery log:


Code:
AnyKernel2 by osm0sis @ xda-developers

Checking device...
victara

Installing kernel...
20400+0 records in
20400+0 records out
10444800 bytes (10.0MB) copied, 0.158219 seconds, 63.0MB/s
BOARD_KERNEL_CMDLINE console=none androidboot.hardware=qcom msm_rtb.filter=0x37 ehci-hcd.park=3 vmalloc=400M buildvariant=userdebug
BOARD_KERNEL_BASE 80200000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 02000000
BOARD_SECOND_OFFSET 00f00000
BOARD_TAGS_OFFSET 01e00000
BOARD_OS_VERSION 7.1.2
BOARD_OS_PATCH_LEVEL 2017-08
BOARD_DT_SIZE 540837
gunzip: invalid magic

Unpacking ramdisk failed. Aborting...
Updater process ended with ERROR: 1
I:Legacy property environment disabled.
I:Install took 2 second(s).
Error installing zip file '/sdcard/ADM/Pop_kernelV1.8r2.zip'


in the attachments I leave the kernel zip,
thank you in advance

Rename it Test-debugging.zip, flash it again and then upload the debug .tgz it creates.

It appears the kernel in question may not be using gzip compression however. Only gzip is supported at this time.
The Following User Says Thank You to osm0sis For This Useful Post: [ View ]
13th November 2017, 08:30 PM |#531  
linckandrea's Avatar
Senior Member
Flag Roma
Thanks Meter: 1,036
 
Donate to Me
More
Quote:
Originally Posted by osm0sis

Rename it Test-debugging.zip, flash it again and then upload the debug .tgz it creates.

It appears the kernel in question may not be using gzip compression however. Only gzip is supported at this time.

then I understand what the problem is ...
the official LOS kernel ramdisk compression (for moto x2) is lzma...

thanks for the help.
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