yashsingh1/xdaforums huggingface dataset:
[Android Software Development] tajimura:
Sorry, but my device is anzu, not haida.

Nobody cares what/where is this sent from.
[Android Software Development] osm0sis:
Oh really? Sorry, got it backwards. Alright. Well that is confusing then! avinash definitely reported it working with one of his.. :p

Hopefully he can get them both in working order and verify. If not then maybe just lzop is borked right now like I said before.. even though they're all Cygwin binaries at this point so it doesn't make sense.

Edit:

Using trevd's all-in-one alpha (which he sent me the other day), I compared the input and repack images. Everything is the same but the following -

boot-orig:

ramdisk_size :3696885

ramdisk_padding :00001803

entry_count :1369169920

boot-repack:

ramdisk_size :3697996

ramdisk_padding :00000692

entry_count :1369170244

entry_count likely doesn't mean anything since the alpha doesn't support lzo (crashes), but the ramdisk_size and padding differences are interesting. 1111 is the difference between both, so the ramdisk is slightly larger in the repack, resulting in less padding. I don't think that would be the reason for it to not boot, but you never know.
[Android Software Development] trevd:
It shouldn't affect it.... boot images are page aligned. In simple terms that means the size of each section ( kernel , ramdisk and second ) should be dividable by the page size and result in a whole number which is the page count.

Also, Although not strictly required in my experience but the cpio file should be byte aligned , so dividable by 256. but like I say I've booted unaligned cpio files before.

I've spent way too long looking at boot images LOL...
[Android Software Development] lambstone:
When I try to unpack a recovery.img without the kernel components just the ramdisk, your kitchen splits successfully but the ramdisk is empty.
[Android Software Development] osm0sis:
Link or I can't help. :rolleyes:
[Android Software Development] lambstone:
I've uploaded the recovery.img here https://mega.co.nz/#!TN0lgSyb!Cav1eROS8QnRlIG18PFxuXXcd8EmvF9e60l4iNY9HNA
[Android Software Development] osm0sis:
Yeah that's a weird one. It actually isn't splitting correctly, and it appears to be ALL ramdisk. unpackbootimg doesn't know what to do with it and just assumes the ramdisk is the zImage and splits it that way (which is why it didn't unpack anything with AIK). trevd's bootimg-utils can unpack the ramdisk but doesn't split out a zImage or any header information (which is why I don't think there is any), so wouldn't be useful for repacking either.

What device and recovery is this?
[Android Software Development] trevd:
I'll tell you now before I even look at it, You ain't squeezing an Android kernel in 1.9MB.

and just having a look at the hex....It's brought back some bad memories. *shudders* LOL

It's a rokchip rk3066 or similiar based device there. That's what was wrecking my mind a couple of weeks ago as they are found in alot of Android TV Sticks. I tried in vain to create a boot image that would boot but ennough of my inability to follow instructions and carry out simple tasks,

There's a couple of different toolsets available ( which only added to my confusion ) rkutils and rk-tools, unpacking these things is easy it was just the putting back on the device which I had trouble with.

So, Is the ability to unpack ramdisks located anyway in a binary file, is that a bug or a feature in my tool? :D An unconsidered side-effect at the least very least
[Android Software Development] lambstone:
Yeah, it is a Rockchip RK3188 device. It's just the recovery alone without any kernel in it.
[Android Software Development] osm0sis:
Yeah, definitely not intended for such bizarre devices. ;)
[Android Software Development] Antagonist42:
You could be dealing with differing REGION ROM's as I have found between EMEA and GEN1 the 512k Partition info is different and cannot swap BOOT images between both as they fall in different ROM areas and have differing addressing which could explain the 4081 and 8081 difference. :confused: ;)
[Android Software Development] Antagonist42:
If you get a spare few mins is there any chance you could get this to repack to it's original size? It falls short by about 495k on the boot.img and altering settings for compression makes it about 2k larger or 100k smaller :eek: and cpio only increases :confused: it looks to unpack ok but repack is a mile off.

Boot is for ACER E320 (or C6)

Many thanks if you can :D
[Android Software Development] osm0sis:
Worked this out already actually. Thanks for trying to help though! :) The HTC images needed a --ramdiskaddr parameter that wasn't supported on any Windows builds of mkbootimg that I'd ever seen until I found CosmicDan's awesome custom build that also fixed the large pagesize issue for my v1.5 release.

I'll see what I can do. Does it not boot with it 2kb larger? That hasn't been a big deal in my experience thus far. (And if it doesn't boot, it's probably not because of the filesize).
[Android Software Development] Antagonist42:
Thanks for the info and solving that 40/80 address (gives me ideas on my phone ;) )

Not to worry then if the file size hasn't been an issue, it'll be my phone more than likely (still foolishly playing with it :fingers-crossed: ) as i've been playing with it heavily and it doesn't like it :laugh:

It did boot of sorts, then boot looped to recovery, only way to get out of it was to flash a TWRP system that works (i've got a blip in my system partition - 20Mb or so isn't there... but is!!! {SCHOOLBOY ERROR :lol: }) now have it back to normal AFAIK!

I'm trying to get root on UK version phone because only other ROM is GEN1 and is a pain to flash back, the Orange ROM is stable but sucks big time with out of date apps and demos (why lock demos in a ROM :silly: ) and root was disabled with OTA/EUU update and no 'STOCK' Orange ROM available (1.008.00 or earlier for UK) which was rooted.

That aside if I don't get it i'll enjoy the learning curve destroying the phone whilst trying to keep it running :laugh: :eek: :victory:
[Android Software Development] osm0sis:
Haha all good fun. Just unpack and repack directly without changing anything in the ramdisk. If it boots then you can rule out the repacking process as being the problem and know that has to be something you changed. :) :good:
[Android Software Development] defiant07:
Thanks for this great tool, but unfortunately it does not seem to work on my device (see signature) as most of the folders in the unpacked ramdisk are empty and if I just unpack/repack without edits the new image is one fourth the size of the original image; it goes from 32mb to around 8 mb. Here is my boot image. Any insights would be most appreciated.
[Android Software Development] trevd:
Hi

Most folders in the ramdisk are meant to be empty, they are place holders for the mount points. the only one that should have anything in is sbin

Alot of the 32mb is padding ( lot's of 00 and FF bytes ) . Is this an mtd based device? if it is the flash_image program should handle padding it out the although I'll have to double check the code.

What tools are you using to flash it?

I must admit it's another freaky boot image. The kernel isn't packed, nothing to worry really you just don't see it to often, and there's also another ramdisk inside the kernel image, I've not unpacked it yet to see what's in it, They're also done some freaky s**t in the init files.

A very interesting objet de curiosité - well for me at least :D
[Android Software Development] defiant07:
Thanks for the illuminating information regarding the empty folders and padding. Is all that padding because it is from cwm or would all this padding still exist if the image was pulled by some other means?

No, I do not think it is mtd based ("cat /proc/mtd" returns a no such thing error and there are no signs of mtd partitions in "cat /proc/partitions" or the recovery.fstab).

I have not tried to flash any of the repacked images because the size discrepancy had me concerned (I unpacked/repacked some random boot images I found floating around and the repacked image was always the same size as the original). But after I got this tool working I was going to replace the initlogo and try to adb/fastboot push it first or flash it with this, which looks like it just automates the adb/fastboot process, if I failed via manual adb/fastboot.

Damn random Chinese tablet foils many of my customization attempts, not to mention my neophyte nature :p.
[Android Software Development] harsh.:
Well if cache partition is the only place where it can unzip then no problem on your or [MENTION=2719389]z31s1g[/MENTION]'s end. cz i had 128mb space for cache which i parted and reduced to 10mb. :p ty for help ;) but if it can be unzip anywhere else it will be helpful. :fingers-crossed:

EDIT:- Got sorted with z31s1g ;) ty both of you:D
[Android Software Development] osm0sis:
Just a quick FYI, to any that have cloned my GitHub repo https://github.com/osm0sis/Android-Image-Kitchen since v2.6's release, I've just force-pushed to the master (Win32) branch, since I noticed I'd mistakenly included an older testing version of my androidbootimg.magic file there. The actual released v2.6 Win32 zip has the newer, correct one, so it was only the git repo itself that was wrong/out-of-sync.

So nothing for the typical Windows end-user to worry about, carry on. :):good:
[Android Software Development] HarshOne:
My device repositories are not available on github, But I got device tree and vendor blobs by making changes in similar device repo. That reference device's kernel's lineageos_defconfig is situated in htc msm8974 kernel repo. So how can I get lineageos_defconfig for my device, and which other my device related kernel files(.dtsi or any other) I have to push in htc msm8974 repo and get those files to make things ready for build?

Please help......
[Android Software Development] osm0sis:
If you're lucky, when booted your device/kernel might generate a /proc/config.gz, but this and your general question are way out of scope of this tool and thread (ie. completely unrelated). You should take it to your device's forum ROM thread or Q&A.
[Android Software Development] kozmikchuck:
Mobile Version works on Samsung Galaxy Victory 4G LT.E [SPH-L300] . I've used it from a Android shell and in TWRP 2.8.3.0 via Aroma File Manager. I've used it on my kernel and TWRP. I used it to change paths, usb config, and to upgrade my TWRP's busybox to 1.26.2. Also to add other binaries. Fantasic results and it working from Android or recovery really helps. It has rescued me from more than one boitloop. Thanks a bunch. you rock like Slayer!
[Android Software Development] osm0sis:
Thanks for the report, please remove the OP quote from your post though. :good:
[Android Software Development] partner22:
Hi! I've got a BQ M8 too. I've tried to unpack and repack, but it does seem to require the signature. When trying to flash I get s_security_secure_usb_dl_image_sign_header_not_found (6045)
[Android Software Development] osm0sis:
Does SuperSU root and repack it correctly?
[Android Software Development] partner22:
We don't even have a recovery... Or an open boot loader.
[Android Software Development] osm0sis:
Ahh gotcha, okay. Thanks for the report. I'll add it to the OP in the confirmed not working section.

[MENTION=2882999]partner22[/MENTION], don't suppose hex editing the pre-header signature back onto the repacked image works, does it?
[Android Software Development] freaks211:
Cant unpack on windows 8.1

when i run the unpack.bat and then drag and drop the img to the unpack.bat it just closes :(
[Android Software Development] ashyx:
What do you mean run it? You don't run anything, just drag and drop.

It would also help if you'd give a little more detail as to what OS you are using.
[Android Software Development] osm0sis:
Also ughh, edit your post to remove the OP quote please. Works fine in Windows 10 so 8.1 should be okay I'd think.
[Android Software Development] ashyx:
What are your intentions, why do you even need to unpack the DTB?
[Android Software Development] elocnix:
Maybe it sounds crazy, but I'd like to provide device tree for review and (eventually) official support by TWRP crew. It's not very popular device and I was told that's the only way to make it happen. :)
[Android Software Development] Captain_Throwback:
That's not what a dtb is for.
[Android Software Development] ingbrzy:
bootimg-info sha256

[MENTION=4544860]osm0sis[/MENTION]

Can you add support for sha256 boot.img to bootimg-info binary..?

boot.img download

For now it just crash...

======= Backtrace: =========
[0x412151]
[0x441de2]
[0x441d7e]
[0x441ad9]
[0x415820]
[0x452ff0]
[0x441b5c]
[0x441abd]
[0x400769]
[0x401076]
[0x40126a]
[0x400d39]
======= Memory map: ========
00400000-004c2000 r-xp 00000000 08:31 6560173 /home/ingbrzy/Downloads/bootimg-info-master/bootimg-info
006c1000-006c4000 rw-p 000c1000 08:31 6560173 /home/ingbrzy/Downloads/bootimg-info-master/bootimg-info
006c4000-006c6000 rw-p 00000000 00:00 0
01c5f000-01c82000 rw-p 00000000 00:00 0 [heap]
7f1daab78000-7f1daab79000 rw-p 00000000 00:00 0
7ffd6e63b000-7ffd6e65c000 rw-p 00000000 00:00 0 [stack]
7ffd6e724000-7ffd6e726000 r--p 00000000 00:00 0 [vvar]
7ffd6e726000-7ffd6e728000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)
[Android Software Development] ashyx:
You build your own device tree, the DTB contains nothing useful for compiling TWRP.
[Android Software Development] elocnix:
[MENTION=1162986]Captain_Throwback[/MENTION]

[MENTION=4899305]ashyx[/MENTION]

Guys, I'm really confused now. :eek: Obviously I'm lost and in desperate need of guidance. Please advise. Thanks!
[Android Software Development] Captain_Throwback:
Look at the TeamWin Github - all of the repos that start android_device...are device trees. You build those from scratch, usually by taking one for a similar device/SoC and customizing it for your device. Has nothing to do with this thread or the dtb (though that will likely be needed in the device tree for the recovery built from the device tree to boot).
[Android Software Development] ashyx:
You may want to start here, but this is now OT, so make your posts there :

https://xdaforums.com/showthread.php?t=1943625
[Android Software Development] elocnix:
Ok, thank you! BTW I posted here because I was using osmOsis' AIK tools and ... you know. :good:
[Android Software Development] osm0sis:
Yes it's on my to-do, along with adding it to AIK and AK2 of course! :)
[Android Software Development] osm0sis:
Worked fine for me! MinGW Win32 build even.. ;):

Android Boot Image Info Utility

Printing information for "boot.img"

Header:
magic : ANDROID!
kernel_size : 14928792	(00e3cb98)
kernel_addr : 0x0a080000

ramdisk_size : 4470914	(00443882)
ramdisk_addr : 0x0c400000
second_size : 0	(00000000)
second_addr : 0x00f00000

tags_addr : 0x0c200000
page_size : 4096	(00001000)
dt_size : 1010009	(000f6959)
os_version : 7.1.1
os_patch_level : 2017-02

name :
cmdline : console=ttyS0,115200 earlyprintk=uart8250-32bit,0xF900B000 androidboot.hardware=song no_console_suspend debug user_debug=31 loglevel=9 buildvariant=user

id : f5e9512105887b3ffe4ed0a8c2c4c63edfe94434600dbec982fe7ab4a9e220b8

extra_cmdline :

Other:
magic offset : 0x00000000
base address : 0x0a078000

kernel offset : 0x00008000
ramdisk offset : 0x02388000
second offset : 0xf6e88000
tags offset : 0x02188000

I did notice id printing will bail after the first 00 it encounters (but doesn't cause a crash) so I'll look into fixing that, but otherwise seems like an issue with your compile. Make sure you're using the latest source.

I might also add the "hash type:" to the Other section just in case it wasn't clear enough from the length. Edit: Nah. Don't like it. :p

Edit 2: There, printing the whole hash in all cases now - https://github.com/osm0sis/bootimg-info/commit/8560e40b0ff223114610c1e81cb198c0d79d2fde :)
[Android Software Development] farovitus:
Hi,

I changed compression format to lz4 but how can i choose the level of compression ? Thanks [MENTION=4544860]osm0sis[/MENTION]
[Android Software Development] osm0sis:
You can change it at repack with the command line option: --level

Since you missed that, please go back and read the entire OP and, if you're using Linux or Mobile, follow the link to the initial release notes for your platform and read those as well.

Be aware, your kernel zImage must also support lz4 ramdisks to work - changing the format alone isn't enough.
[Android Software Development] farovitus:
Phone booted with lz4 np.

Should i change only line 51 ?

# level="-$2";

Thanks
[Android Software Development] osm0sis:
Read harder. Please. You add it to the commandline like: repackimg.sh --level 9
[Android Software Development] ingbrzy:
Thanks..!

Good job..!

Now its perfect..!
[Android Software Development] osm0sis:
Stuff... and things..!

https://github.com/osm0sis/mkbootimg/commit/f8946a263eb6f53369359dafcc86dd780949a413
[Android Software Development] ingbrzy:
cant build libs with that commit

gcc -o unpackbootimg.o -ffunction-sections -O3 -c unpackbootimg.c -Werror
unpackbootimg.c: In function ‘main’:
unpackbootimg.c:274:9: error: implicit declaration of function ‘fstat’ [-Werror=implicit-function-declaration]
fstat(fd, &st);
^
cc1: all warnings being treated as errors
Makefile:44: recipe for target 'unpackbootimg.o' failed
make: *** [unpackbootimg.o] Error 1
[Android Software Development] osm0sis:
Hmm weird, but fopen, fclose and fseek work fine for you.. :confused:

I'll test all my cross-compiles and mess around with it.
[Android Software Development] ingbrzy:
Built fine on Cent OS... Failed for me on Ubuntu...
[Android Software Development] ale8530:
[MENTION=4544860]osm0sis[/MENTION] confirmed bug of [MENTION=3854189]ingbrzy[/MENTION] on ubuntu is impossibile recompile from your source
[Android Software Development] osm0sis:
Yes, I'm sure it just needs another include added.. for some it might be covered in stdlib.h and unistd.h, and others I'm guessing it needs <sys/stat.h> and maybe <sys/types.h>. I'm looking into it, probably have it fixed tomorrow some time. :good:
[Android Software Development] ale8530:
No problem take the necessary time :).

I would like to ask you how to rebuilt boot.img sha256 with AIK v.2.6 linux, when new-boot.img is built, has sha1 instead of sha256

How can I solve this problem?

Thanks for your attetion
[Android Software Development] ale8530:
i have attachement various file
[Android Software Development] osm0sis:
Support for sha256 will be added in AIK v2.7. You can take a look at my sha256 AK2 commit if you want to try to hack it into v2.6 in the meantime.
[Android Software Development] mm2236:
hey fellas

is there anyway to make custom cwm? I've a note3 broken screen, I want to make custom CWM and putting mount USB storage on the first page of CWM, or in someway add a button to enable USB debugging.

it would be grate if you help me

thnx
[Android Software Development] ale8530:
Thanks :)
[Android Software Development] osm0sis:
[MENTION=3854189]ingbrzy[/MENTION] [MENTION=2941718]ale8530[/MENTION] can you please try with the latest commit?

I honestly can't reproduce the issue with fstat on my Ubuntu VM, but I simplified it to stat so perhaps that will work better for you. If you still have an issue please try adding the stat.h include I mention in my quote above, and then also types.h if it complains that it needs it as well. :good::fingers-crossed:

Edit: Not exactly the same, but I did manage to get an include-related error once I tried all my NDK cross-compiles.

unpackbootimg.c: In function 'main':
unpackbootimg.c:272:21: error: storage size of 'st' isn't known
struct stat st;
^
make: *** [Makefile:44: unpackbootimg.o] Error 1

I force-pushed the latest commit to amend it with the necessary <sys/stat.h>, so hopefully all is fixed now for your compiles as well!

Let me know. :)
[Android Software Development] ale8530:
[MENTION=4544860]osm0sis[/MENTION]

Perfect recompile! :)

Good job!

Thanks
[Android Software Development] ingbrzy:
[MENTION=4544860]osm0sis[/MENTION]

Works like a charm now!

Good job!
[Android Software Development] bovirus:
[MENTION=4544860]osm0sis[/MENTION]

Will you inlcude this new bootimg tool in a fresh update of AIK?
[Android Software Development] osm0sis:
Well yeah, that's the idea. ;)
[Android Software Development] cam30era:
[MENTION=4544860]osm0sis[/MENTION],

I'll say it again: The work you do is very much appreciated.

You can add the Pixel C to your list of devices confirmed working. :svetius:
[Android Software Development] osm0sis:
Asus SignBlob support, the new sha256 hash support (versus sha1 hash still in the boot.img standard) required on some newer Xiaomi devices, support for the hidden new "second_signature" Xiaomi and Google(!) are using in their factory images (suggesting Google's got an internal forked version of mkbootimg they haven't made public :mad:), and a number of fixes!

The file binary dev corrected the off-by-one error I discovered interfered with "search" in the magic file, so we're able to update to a more recent git commit post-5.30. Hopefully that's all the file binary issues for a while and we can stay on the stable track once 5.31 comes out.

The AIK Build Farm has been updated accordingly, also with a number of handy new features for any playing along at home.

I work on these projects in my limited time off, so if you like the progress I'm making, or enjoy anything else I've done on xda, please do hit the donate link from my profile. Thanks for your support!

Android Image Kitchen v2.7:

- add DENX U-Boot header detection to get properly flagged as known currently unsupported

- remove missed remaining workaround (--level) for old lz4 since we are up-to-date since previous release

- add sha256 boot.img unpack/repack support

- refactor ChromeOS signing support into separate variable signature support, adding proper unsigning

- add error catching for the image build command

- add SignBlob signature header detection and use blobtools to unsign/re-sign

- keep unlokied/unsigned images in split_img directory

- update to the latest Cygwin binaries and libraries

AIK-mobile v2.7 + AIK-Linux v2.7:

- add DENX U-Boot header detection to get properly flagged as known currently unsupported

- fix chromeos subfolder permissions during install (AIK-mobile), and execution

- update busybox binary (still 1.26.2) with the latest patches and fixes from my repo (AIK-mobile)

- update file binary (5.30-3590556) (AIK-mobile)

- update mkbootimg and unpackbootimg binaries from my repo

- add sha256 boot.img unpack/repack support

- update Magisk module.prop to define template v3 (AIK-mobile)

- refactor ChromeOS signing support into separate variable signature support, adding proper unsigning

- add SignBlob signature header detection and use blobtools to unsign/re-sign

- update to latest versions of set_perm, set_perm_recursive and file_getprop from my Complete Shell Zip Documentation (AIK-mobile)

- keep unlokied/unsigned images in split_img directory

- fix unlokied-new.img and unsigned-new.img getting selected in error when run with no filename

More on my own build changes in the commits here: https://github.com/osm0sis/mkbootimg; https://github.com/osm0sis/android-busybox-ndk.

Installation information and details on each edition can be found in the OP for Win32 or the AIK-mobile and AIK-Linux initial release notes.

If you are reporting a problem with your device, please clearly state your device name and model/variant as well as provide a link to the image file.
[Android Software Development] ob1silvia:
Are the mobile ak links working.

The link provided will not allow me to download mobile aik 2.7

Created 2013-11-13

Last Updated 2017-05-01[/QUOTE]

Cannot download 2.7
[Android Software Development] bovirus:
[MENTION=3884805]ob1silvia[/MENTION]

Please don't QUOTE an entire paragraph just for add one line.

Pelase edit your post and delete the entire QUOTE (not necessary).

Pleas post the full details. Which version of AIK 2.7 yoyu cannot downlaod?
[Android Software Development] ob1silvia:
The link in post one mobile image kitchen version 2.7