yashsingh1/xdaforums huggingface dataset:
[Android Software Development] ouroboros12:
Oh so, i have to split it and not extract. What am i supposed to do with split_img?
[Android Software Development] osm0sis:
No idea what you're trying to do. Normally you do nothing because this tool is for ramdisk edits. I don't think you'll be able to do what it seems you want to.
[Android Software Development] ouroboros12:
I just need zImage, the kernel itself. Cause the there are differences on inits on the ramdisk of cm10 and cm10.1.. am i right here? Since the sources are the same? :confused: srry im a noob. :(
[Android Software Development] osm0sis:
There's more to it. Sources are not the same. :(
[Android Software Development] ouroboros12:
Oh i thought it was. So making one is the only way then :( thanks for the help mister! :)
[Android Software Development] avinashrocks1990:
[MENTION=4544860]osm0sis[/MENTION]

lzop not workin after this modification
[Android Software Development] osm0sis:
[MENTION=5154676]avinashrocks1990[/MENTION] But is before? The image boots when you're using AIK v1.5 as-is?
[Android Software Development] sirxdroid:
The unpackimg.bat does not seem to work on the attached boot.img (from PA 3.55 for Nexus 4)

Any ideas?

Edit: the image is fine, it unpacks OK on Linux using abootimg
[Android Software Development] osm0sis:
Worked flawlessly here. Make sure you've got the boot.img in the same directory and that you're following the instructions in the OP. :)
[Android Software Development] sirxdroid:
Thanks. The mistake was that I didn't put boot.img in the same directory, I tried to pass the full path of boot.img to unpackimg.bat

Sorry about the false alarm.
[Android Software Development] suraj-b:
sir how do i repack image using xz compression.did not understand whats given in the guide.
[Android Software Development] osm0sis:
It's automatic. If the image uses xz it will unpack and repack with it. You can't just switch compressions on a ramdisk without compiled-in kernel support, since most only include the switches for the specific compression they're using.

You're free to try, but I wouldn't expect it to work in most cases from what I've seen.
[Android Software Development] suraj-b:
i understand that sir.but how do i use it(xz compression)
[Android Software Development] osm0sis:
After it's unpacked, go into split_img and change the contents of the -ramdiskcomp file from gzip to xz, then repack. I think this was explained in the other thread you brought it up in as well, with [MENTION=6552280]MSF Jarvis[/MENTION]?
[Android Software Development] shoey63:
unpack. elf is inside bootimg binary right? How do I execute it on the command line? answered

Edit: Blatantly cross posting so as not to hijack the other thread
[Android Software Development] shoey63:
[MENTION=4544860]osm0sis[/MENTION]

I unpacked the xz kernel.elf in windows and got this output

C:\Users\shoey\Desktop\rootkernel_v5.0_rc1_Windows_Linux\New folder>bootimg unpack
elf -i kernel.elf -k zImage -r ramdisk.cpio.gz -d dtb
BOARD_KERNEL_OFFSET="80208000"
BOARD_RAMDISK_OFFSET="82200000"
BOARD_KERNEL_CMDLINE="androidboot.hardware=qcom user_debug=22 msm_rtb.filter=0x3
F ehci-hcd.park=3 vmalloc=400M androidboot.bootdevice=msm_sdcc.1"
BOARD_PAGE_SIZE="4096"

Compare it to the AIK output of a working xz boot.img

Supplied image: boot228.img

Removing old work folders and files . . .

Setting up work folders . . .

Splitting image to "/split_img/" . . .

BOARD_KERNEL_CMDLINE androidboot.hardware=qcom user_debug=22 msm_rtb.filter=0x
ehci-hcd.park=3 vmalloc=400M androidboot.bootdevice=msm_sdcc.1
BOARD_KERNEL_BASE 80200000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 02000000
BOARD_TAGS_OFFSET 00000100

Unpacking ramdisk to "/ramdisk/" . . .

Compression used: gzip
26034 blocks

Done!

BOARD_PAGE_SIZE can be either 2048or 4096, but BOARD_KERNEL_OFFSET and BOARD_RAMDISK_OFFSET don't look right when using the bootimg binary. (Not to mention there is no BOARD_TAGS_OFFSET or BOARD_KERNEL_BASE)

Edit: Re-packing the generated ramdisk and zImage into a working boot.img and flashing it doesn't work either. Wont get past the boot splash screen. I suspect that is due to Windows not being able to unpack and repack AS ROOT, which is required for the good old XZ - strangely enough :p
[Android Software Development] osm0sis:
Looks like a ramdisk address instead of offset (since there's no base), which should be fine since that's how they're actually stored in a boot.img. When repacking did you use the offsets from the boot.img that work? Also xz/root shouldn't matter where there's mkbootfs. :)

Did you post this .elf before? I'd like to add it to my testing folder.
[Android Software Development] shoey63:
I only substituted the zimage and ramdisk into the working boot.img - wouldn't boot, and yeah, it's the same kernel.elf.

Have you looked at SuperR's elf2boot plugin script ?
[Android Software Development] osm0sis:
Yup, I was looking at that first, but I'm just trying to see if tobias can work unpackelf into something universal, since that's been sorely lacking for the Sony modding community, and it's done with some pretty clean and nice C coding which we can cross-compile for all the things.

I'll have to compare what each splits and see what's going on there.
[Android Software Development] devilmaycry2020:
Hi all

i've tried to unpack boot.img from xperia z5 mm 6.0.1 but had error

Splitting image to "split_img/"...

Android boot magic not found.

Error!

if someone knew help me please. thank you
[Android Software Development] shoey63:
You sure it's a boot.img and not a kernel.elf? How did you get it?
[Android Software Development] devilmaycry2020:
First I extracted kernel.sin from ftf rom, using flashtool to

extract kernel.sin to kernel.elf then rename it to boot.img
[Android Software Development] shoey63:
Ok so it's a kernel elf. Not currently supported by the kitchen (yet). It needs to be converted to boot.img format. If your bootloader is unlocked you could try the tool from Here
[Android Software Development] devilmaycry2020:
That tool is for patch kernel to disable drm,ric,v.v, not convert.
[Android Software Development] shoey63:
Of course it can convert. Just say no to all the options. It will still produce a boot.img, just without all the modifications.

Edit: You will at least need to disable dm-verity if you intend to modify /system, or else the phone wont boot.
[Android Software Development] shoey63:
[MENTION=4544860]osm0sis[/MENTION]

Ive been playing with the [MENTION=357342]tobias.waldvogel[/MENTION] bootimg binary on my Linux system with my Xperia Z kernel.elf

I unpacked it and got the following output -

shoey@Mint-Sarah-18 ~/Desktop/rootkernel_v5.0_rc1_Windows_Linux $ ./bootimg unpackelf -i kernel.elf -k zImage -r ramdisk.cpio.gz
BOARD_KERNEL_OFFSET="80208000"
BOARD_RAMDISK_OFFSET="82200000"
BOARD_KERNEL_CMDLINE="androidboot.hardware=qcom user_debug=22 msm_rtb.filter=0x3F ehci-hcd.park=3 vmalloc=400M androidboot.bootdevice=msm_sdcc.1"
BOARD_PAGE_SIZE="4096"

(The Z doesn't have dt image)

I then repacked it useing the values provided

shoey@Mint-Sarah-18 ~/Desktop/rootkernel_v5.0_rc1_Windows_Linux $ ./bootimg mkimg --kernel zImage --ramdisk ramdisk.cpio.gz --cmdline "androidboot.hardware=qcom user_debug=22 msm_rtb.filter=0x3F ehci-hcd.park=3 vmalloc=400M androidboot.bootdevice=msm_sdcc.1" --base 0x80200000 --kernel_offset 80208000 --ramdisk_offset 82200000 --pagesize 4096 --output boot.img

However, the device won't boot with those values. So I used the ones from the Official Documentation

shoey@Mint-Sarah-18 ~/Desktop/rootkernel_v5.0_rc1_Windows_Linux $ ./bootimg mkimg --kernel zImage --ramdisk ramdisk.cpio.gz --cmdline "androidboot.hardware=qcom user_debug=22 msm_rtb.filter=0x3F ehci-hcd.park=3 vmalloc=400M androidboot.bootdevice=msm_sdcc.1" --pagesize 4096 --base 0x80200000 --ramdisk_offset 0x02000000 --output boot.img

Fastbooted it, and it fired up like a champion [emoji4]
[Android Software Development] osm0sis:
Ah good, so we're not that far off! If you look at the difference between the values, it's what I was saying before, they are are raw header values before base gets subtracted, not the computed (address - base = offset) like we're used to from unpackbootimg and mkbootimg.

Does tobias' mkimg create a kernel.elf or a boot.img? Could you try with mkbootimg again using the working values just to make sure we didn't just miscommunicate before?
[Android Software Development] shoey63:
tobias' mkimg definately creates a boot.img. Verified by unpacking it with your kitchen :cyclops:

I used your mkbootimg to repack the ramdisk and zImage produced by tobias' bootimage binary using the working values, and no problems.

I also tried it this way, and the resultant boot.img also booted without issue:good:

shoey@Mint-Sarah-18 ~/Desktop/AIK-Linux/bin/x86_64 $ 7z e ~/Desktop/AIK-Linux/bin/x86_64/kernel.elf
7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=en_AU.UTF-8,Utf16=on,HugeFiles=on,8 CPUs)
Processing archive: /home/shoey/Desktop/AIK-Linux/bin/x86_64/kernel.elf
Extracting 0
Extracting 1
Everything is Ok
Files: 2
Size: 9212670
Compressed: 9216922

Then:

shoey@Mint-Sarah-18 ~/Desktop/AIK-Linux/bin/x86_64 $ ./mkbootimg --kernel 0 --ramdisk 1 --cmdline "androidboot.hardware=qcom user_debug=22 msm_rtb.filter=0x3F ehci-hcd.park=3 vmalloc=400M androidboot.bootdevice=msm_sdcc.1" --pagesize 4096 --base 0x80200000 --ramdisk_offset 0x02000000 --output boot2.img

Edit:

Enough of Linux, will boot to Windows and see what happens there...

Edit2:

Above results replicated in Windows.

Only difference is, with the 7zip method Windows doesn't like 0 and 1 for kernel and ramdisk. Need to rename it. I used zImage and ramdisk.cpio.gz for consistency.
[Android Software Development] lkdevil:
I flash this aik zip in my android but now I want to remove aik ...so how can I remove
[Android Software Development] osm0sis:
Simply delete /data/local/AIK-mobile and /system/xbin/aik (or /su/bin/aik). I'll add a switch to the `aik` command in the next version to automate this. :good:
[Android Software Development] kirito9:
[MENTION=4544860]osm0sis[/MENTION] soo I have another device that's not Mediatek but Qualcomm. I get the same error as on Mediatek with this boot.img.

It's an Alcatel A462C.

Should I post a log or is it a waste of time?
[Android Software Development] osm0sis:
Please post the boot.img so I can test/dissect it. ;)
[Android Software Development] kirito9:
Here you go :)

Let me know if you need anything else.
[Android Software Development] osm0sis:
It's got a weird MTK-like header tag at the beginning of the ramdisk (but not the kernel :confused:):

88 16 88 58 DD 06 2C 00 52 45 43 4F 56 45 52 59 ˆ.ˆXÝ.,.RECOVERY

You can chop it (and the blank 00 and FF data after it) out in a hex editor first and then try unpacking it again, then put the header back after you repack. Doing so worked for me; unpacked correctly as gzip. :)
[Android Software Development] kirito9:
Yeah, surprisingly I noticed some MTK files like "ramdisk-recovery.img.mtk.header" and "ramdisk-recovery.img.mtk" but didn't know how they got there.

I'm trying to compile to a TWRP recovery but getting this error "error: could not load device tree image '/cm12/device/alcatel/a462c/prebuilt/dtb.img".

Sorry for the /OT

EDIT: It was actually a bad(?) recovery.img (previously compiled) that was sent to you and not the boot.img. I unpacked the boot.img and I didn't get any errors. So the problem must be how this recovery.img is being compiled. I'm checking xda for make files that'll work lol.

Thanks for the suggestion.

EDIT: My bad, your AIK works with the stock boot.img, that
[Android Software Development] noo100:
AIK-Mobile works on HP Slate 21
[Android Software Development] :
Is there any way to apply a boot.img.p to a boot.img?
[Android Software Development] osm0sis:
Easily done on a phone; you can use the applypatch command, it's just in /system/bin so might need LD_LIBRARY_PATH=/system/lib at the front the command to function.
[Android Software Development] ashyx:
Don't suppose you could give me a little input on this:

http://xdaforums.com/showthread.php?t=3419003
[Android Software Development] nanico:
Gt-p1000 boot.img

Hi.

Can someone help me with this img? I need to modify the init.rc.

How to decompress/compress it again?
[Android Software Development] osm0sis:
Looks like a Samsung headerless kernel format. There are scripts on the xda wiki (see splitting ramdisk) to potentially handle these.
[Android Software Development] nanico:
Can't find nothing ... :(
[Android Software Development] osm0sis:
Follow the link in the second OP after I list unsupported headerless image devices. Yours has been added to the list. :good:
[Android Software Development] nanico:
Thanks.

It work's but only on the original zImage or I9000 boot.img. I don't know how to do it... But thanks again.
[Android Software Development] ballerd:
thanks to osmOsis for his work brilliant tool what contents should ramdisk be and will some one have a look at my kernel I compiled from source to see if it look OK if they not mind thanks guys

---------- Post added at 11:52 PM ---------- Previous post was at 11:47 PM ----------

https://drive.google.com/file/d/0B2XSl4S2GfBMM1Q4aVJtRElMSHc/view?usp=docslist_api
[Android Software Development] metteduch:
sys/class folder

Would really appreciate it if someone could give me a hand on this one.

I am trying to fix this issue I am having (these lines get spammed repeatedly in logcats):

952 989 W PhoneWindowManagerEx: cannot find file:/sys/class/graphics/fb0/mdp/vfps_boost
952 989 W PhoneWindowManagerEx: cannot find file:/sys/class/devfreq/g3-display.0/polling_interval
952 989 W PhoneWindowManagerEx: cannot find file:/sys/class/devfreq/g3-display.0/cur_freq
952 989 W PhoneWindowManagerEx: cannot find file:/sys/class/devfreq/g3-display.0/polling_interval

I have unpacked boot.img but it is only the root of the ramdisk folder that have files. All subfolders are empty. The split_img folder contains 11 files in total (IMG files if I am not mistaken)

My question is how I can acces or extract the content of /sys/class/ in order to add these missing files and then repack boot.img. If needed, I can upload the boot.img. Please help :)
[Android Software Development] osm0sis:
sysfs is created on every boot and controlled by the compiled kernel code, not the ramdisk. If those locations exist but just aren't seen by the app you can adjust some of the permissions on those locations using the ramdisk to possibly resolve it, but if they're just plain missing then it's a kernel source/driver issue that needs to be resolved in the zImage.
[Android Software Development] metteduch:
Thanks bro.

I also had a thought of it being in zImage. I am on Windows so trying to unpack it through tools here on XDA but so far I have not had any luck with it.

Likely easier on Linux. If someone here can unpack it without hassle then please hit me up :)
[Android Software Development] osm0sis:
As I said, if they're missing (check when booted using a File Explorer app) you likely won't be able to do anything with repacking, you'll need to recompile the zImage from the C source code to fix missing sysfs entries.
[Android Software Development] Murali dharan:
I'm getting only this files in ramdisk..

Sbin

Init

Logo.rle
[Android Software Development] cam30era:
I've picked up a second hand Pixel C on Swappa. Is there any chance I can use AIK? I know it's not listed on working nor non working devices. And I did a search of the thread and found no previous question....

Ryu boot.img attached.

Edit: I tried it (which I know I should have done before posting here), and got the expected "no Android Magic found" error, for an unsupported device...
[Android Software Development] osm0sis:
Then that's all there is..

Chainfire went through some crazy hoops - looking like hacked headers and stuff - to support it in the SuperSU zip. Take a look there for an idea what I mean. No promises but I'll look into it.
[Android Software Development] cam30era:
Holy cow! :rolleyes:

Thank you.
[Android Software Development] livedten:
Windows 7sp1 x64 good :good: It unpacks and packs boot.img - android 5.1(intel)

Windows 10 x64 bad :confused: Do not unpack and packs boot.img - android 5.1(intel)

View attachment 3881284

Please help to get to work on windows 10
[Android Software Development] osm0sis:
Working fine on my x86 Windows 10. By the screenshot it looks like there's an extra character sneaking into the parsed output from file messing up the detection.
[Android Software Development] livedten:
View attachment 3882071
[Android Software Development] osm0sis:
Interesting, same as split_img on my Windows 10 x86.. so must be something weird with reading that file using type or something.. again, no issues on x86, but I'll look into it best I can without a test machine.
[Android Software Development] cam30era:
To your point, I found this article enlightening > http://xdaforums.com/pixel-c/general/pixel-c-rant-developer-perspective-t3301632
[Android Software Development] Hamidreza2010:
[MENTION=4544860]osm0sis[/MENTION] i have a custom kernel which supersu was integrate to it but its old.how can i update supersu in this kernel with your tool?

this is kernel:

http://xdaforums.com/xperia-z5/development/kernel-rytek-kernel-team-project-desire-t3439300

thanks a lot
[Android Software Development] RaceJay:
Hi,

First of all, congratz to osm0sis for taking the time to gather and create this tool.

Second, some question of my own. I've got a Samsung Galaxy Alpha on which i want to change the CSC code by creating a separate .TAR.MD5 file with the original HIDDEN.IMG file and a modified CACHE.IMG file.

Can i accomplish the unpacking/repacking with the use of AIK v2.4?

Sorry for my dumbness, i'm a total and complete newbie regarding things Android...

Thanks for reading :)
[Android Software Development] DespairFactor:
[MENTION=4544860]osm0sis[/MENTION] I am looking to pull apart this Pixel XL boot, but I get "Android boot magic not found." error. Any clue on what can be done? If this is too big of a scope of work for it to be dealt with in this thread, I can arrange to speak with you elsewhere.

The file is too large to upload here, but it is on drive here: https://drive.google.com/open?id=0BzqRyOUmJsSedEdDX0RxSEs5U0k
[Android Software Development] Surge1223:
That's the bootloader img, it contains the partitions that comprise the bootloader
[Android Software Development] DespairFactor:
Why is it labeled boot.img then?
[Android Software Development] Surge1223:
I don't know, but it definitely has the bootloader image format and magic. View attachment 3899645
[Android Software Development] evildog1:
how do find correct recovery and boot img on Cortex Allwinner A23 based devices?

My device does not excatly tell where recovery and boot is located. i can't dump without any info
[Android Software Development] bovirus:
[MENTION=4623971]evildog1[/MENTION]

I believe that the request is out of the scope of this thread.

Depend by CPU model of your tablet (brand/model?) and Android system version.
[Android Software Development] osm0sis:
Try my Flashlt package from my Odds and Ends thread. It may be able to dump it for you. :good:
[Android Software Development] evildog1:
sorry i don't understand but i wasn't able to find Fla**** package.
[Android Software Development] osm0sis:
Then you didn't try very hard: http://xdaforums.com/showthread.php?t=2239421

Top of the list, under "Flashable Installer Zips".

Then use FX Explorer to execute the dumpit.sh script, similar to the instructions for AIK here: http://xdaforums.com/showpost.php?p=66146450&postcount=881
[Android Software Development] Helmi Adam:
work on win64bit?
[Android Software Development] ashyx:
Of course, it states so in the OP. It would have been quicker to have just tried it.
[Android Software Development] robcore:
[MENTION=4544860]osm0sis[/MENTION]

More direct question for you man, and in the appropriate thread this time ;) I've noticed that the linux AIK does a fine job at unpacking images that include dtb's. Now I'm wondering, am I able to repack with a new dtb if I change the name of my dt.img or something? Sorry i'm SUCH a noob when it comes to device tree stuff.
[Android Software Development] ashyx:
Just swap it. It will repack fine.
[Android Software Development] vinaykharayat:
Working fine for spreadtrum 7731

But getting error in mtk6735 something like /data compression error....
[Android Software Development] DarkHeart Z:
[MENTION=4544860]osm0sis[/MENTION] I tried building mkbootfs using mingw64 cross compiler . But no matter how much i try ; even after applying a lot of patches i always run into this error in the end :

/tmp/ccfUBn6z.o:mkbootfs.c:(.text+0x79a): undefined reference to `lstat'
/tmp/ccfUBn6z.o:mkbootfs.c:(.text+0x905): undefined reference to `S_ISLNK'
/tmp/ccfUBn6z.o:mkbootfs.c:(.text+0x926): undefined reference to `readlink'
./libcutils.a(fs_config.o):fs_config.c:(.text+0x30c): undefined reference to `__android_log_print'
./libcutils.a(fs_config.o):fs_config.c:(.text+0x35f): undefined reference to `__android_log_print'
./libcutils.a(fs_config.o):fs_config.c:(.text+0x3d9): undefined reference to `__android_log_print'
./libcutils.a(fs_config.o):fs_config.c:(.text+0x438): undefined reference to `__android_log_print'
collect2: error: ld returned 1 exit status
make: *** [Makefile:180: mkbootfs] Error 1

Can anyone help me with these please ? I already have a libcutils.a file compiled and others . I just wanna make a independent mkbootfs win32 binary .
[Android Software Development] cam30era:
[MENTION=4544860]osm0sis[/MENTION],

AIK Linux confirmed working for Pixel XL. Thanks again.
[Android Software Development] osm0sis:
That's why I left fs_config separated out from libcutils. Use my source, it's self-contained. I'm going to try a bit of a bring-up on any Nougat changes in the next few days. :good:
[Android Software Development] DarkHeart Z:
Yep i tried yours too . But unable to build independent win32 binary using mingw64 compiler . Don't like cygwin's built in gcc because of the additional hassel of the dll files . What's wrong with mkbootfs ? mkbootimg and unpackbootimg compiles just fine . Why doesn't mkbootfs ? Any way to make it work with mingw64 cross compiler ? i tried with mingw64 installer's packages too . Same result .
[Android Software Development] osm0sis:
The remaining linker errors were for lstat, ISLNK and readlink. Might be the long-time issue that Windows doesn't have symlinks in the same way Linux does? Cygwin compiles and works for that reason. No mingw builds I tried ever worked (though it compiled fine) because of symlinks, all the way back to the beginning of this thread.
[Android Software Development] DarkHeart Z:
Got it man . Windows sucks . But yet it's the last os that has 32 bit platform support from the developers side . Linux became out of the picture long ago . Hey bro do you happened to have a working source for simg2img ; make_ext4fs too ? Like independent win32 executable compilable source working with mingw32 ? I tried google's git source . This two keeps showing errors in the end of compilation . I know there's a lot of source in internet and i probably could look right into'em . But as you're a developer you will know better ; so that's why asked .
[Android Software Development] osm0sis:
For most things straight mingw will be extremely difficult because of all the Android libraries that need to also be compiled and linked. Your best bet might be through the NDK; look at how I've got aapt and zipalign set up via my GitHub, and see if you can do the same for the source you're looking at. You can edit the mk files to instruct the NDK to build a host executable (if it doesn't already), and that should be similar to using mingw.

Anyway this is off-topic for my AIK thread, so if you have any further questions please direct them to my Odds and Ends thread. :good: