yashsingh1/xdaforums huggingface dataset:
[Android Software Development] krija:
Hi, i use something like this for my personal purposes.

http://xdaforums.com/showthread.php?p=57127796

I have put it together with AIK and i have added these few lines to repackimg.bat

set bin=android_win_tools

set bump=bump_tools

set "errout= "
.
.
.
echo Done. Image is ready to BUMP!

%bump%\timeout 2 >NUL

goto ToDo

:ToDo

cls

echo.

echo =================================================

echo * LG BOOT AND RECOVERY OPEN BUMP *

echo =================================================

echo.

echo. 1 - Boot BUMP

echo.

echo. 2 - Recovery BUMP

echo.

echo. c - Clean Workspace

echo.

echo. x - Exit

echo.

set /P menunr=" Enter option: "

if %menunr%==1 (goto Boot_Bump)

if %menunr%==2 (goto Recovery_Bump)

if %menunr%==c (goto Clean_Workspace)

if %menunr%==x (goto Exit)

echo.

echo. Invalid option

echo.

pause

cls

goto ToDo

:Boot_Bump

cls

move image-new.img NOT_BUMPED\boot.img

%bump%\timeout 4 >NUL

%bump%\bump NOT_BUMPED\boot.img >NUL

%bump%\timeout 4 >NUL

move NOT_BUMPED\boot_bumped.img BUMPED\boot.img

del NOT_BUMPED\boot.img

del *new.* > nul 2>&1

echo Done. Bumped boot.img is ready at BUMPED folder.

goto end

:Recovery_Bump

cls

move image-new.img NOT_BUMPED\recovery.img

%bump%\timeout 4 >NUL

%bump%\bump NOT_BUMPED\recovery.img >NUL

%bump%\timeout 4 >NUL

move NOT_BUMPED\recovery_bumped.img BUMPED\recovery.img

del NOT_BUMPED\recovery.img

del *new.* > nul 2>&1

echo Done. Bumped recovery.img is ready at BUMPED folder.

goto end
...

I don't know add it as addon. My knowledge not enough to do it.

Timeout is added because i unpack and repack images with 10 years old notebook ;)
[Android Software Development] osm0sis:
When I was manually fixing the HTC images ramdiskaddr (before I started compiling my own mkbootimg), I used this in Windows (Cygwin) to write hex:

%bin%\echo -ne '\x80' | %bin%\dd conv=notrunc obs=1 count=1 seek=22 of=image-new.img

Something similar would likely work for bump.
[Android Software Development] 6ril1:
Thank you my friend, you're really nice, it's nice to publicly discuss with someone who really is committed to share and grow knowledge. Someone who has taken advantage of this system to acquire a very good level and restores it to the rest of the community. I really appreciate.

That said, I know nothing about cyggwin and am not sure I can for now take advantage of the code which you speak;) But, at my own pace, I'll be paying all the attention that deserves (and sorry for the google translation) ;)

Thank you for your answer. From what I understand, because i download your code from the post you linked, and have a really speed look at the code that it contains, + have a look at the code from your post, you didn't have published your code merged with AIK (i didn't find any trace of AIK), you just put here (in this thread) a brief code that you add to AIK that serves you as a gateway from windows AIK to your open_bump windows transcodage (i hope you 'll translate from my bad english, if not, tell me) ?
[Android Software Development] krija:
PM Sent :)
[Android Software Development] fonz93:
I don't know if you are updating the device list, if yes, you can add Moto G 1st and 2nd gen. with stock and custom rom to the list
[Android Software Development] jancsessz:
Running my PC Windows 10 64bit and not unpacking my Xperia Sp boot.img

Android Image Kitchen - UnpackImg Script

by osm0sis @ xda-developers

Supplied image: image-boot.img

Setting up work folders . . .

Splitting image to "/split_img/" . . .

0 [main] unpackbootimg 4240 cygwin_exception::open_stackdumpfile: Dumping stack trace to unpackbootimg.exe.stackdump

Error!

Press any key to continue . . .

"drag and drop"

Supplied image: boot.img

Setting up work folders . . .

Splitting image to "/split_img/" . . .

Android boot magic not found.

Error!
[Android Software Development] osm0sis:
I don't think I can be much clearer about posting the img files in question with bug reports. :mad:
[Android Software Development] DarkHeart Z:
[MENTION=4544860]osm0sis[/MENTION] darwinsys.com is not accessible . tried several times . url doesn't work .
[Android Software Development] osm0sis:
I'm on it right now, so I'm not sure what you mean.

http://www.darwinsys.com/file/

https://github.com/file/file

ftp://ftp.astron.com/pub/file/

http://bugs.gw.com/

http://mx.gw.com/mailman/listinfo/file

The first is what I link in the OP, but all of these links work for me. Check your URL, your adblocker or http://downforeveryoneorjustme.com/
[Android Software Development] DarkHeart Z:
the url keeps loading but doesn't finish loading at all only white page . it's the magic url darwinsys.com/file

edit : downfromanywhere.com didn't work for me either . only darwinsys.com has issues .
[Android Software Development] osm0sis:
It's www.darwinsys.com/file NOT darwinsys.com/file
[Android Software Development] DarkHeart Z:
bro sorry I tried short one here . I just clicked the link you provided in the op . And my browser automatically put www. before them and it does everytime . and also downfromanywhere.com did too . Anyways thanks I got the magic files . but got confused in the lz4 . There's a lot of source links for different platform . which one I should choose . arm-cortex decoder ( my guess only ) ? which one you have used ?
[Android Software Development] osm0sis:
I compiled it myself.
[Android Software Development] DarkHeart Z:
yes i understand that . But I need to go from scratch that's why I am asking did you use arm cortex decoder or any other one ? :)

Edit : i have a plan for adding mtk support in your image kitchen and sending them to you for extending your kitchen . That's why I am going from scratch so that it doesn't become complicate for later troubleshooting . And there's a bunch of lz4 platforms . Just can't get which one to download .
[Android Software Development] osm0sis:
You're over-thinking a bit, just use the source: https://github.com/Cyan4973/lz4

Then cross compile to arm or whatever using the NDK. :)
[Android Software Development] stang5litre:
I need some help if possible. 1st off love this tool. I was able to make a kernel from source and it boots but when my phone is off and I plug in the charger it boots the phone up. Any ideas? Thanks for any help in advance sch-i545 OC1 kernel from source v3.4.0 Verizon s4
[Android Software Development] 6ril1:
Hi @osmOsis,

I come to you for some news of my experiments.

As I said to you rather I do not know much about cygwin, even nothing.

So I looked a little how it worked, but I have not been able to find versions of echo.exe or printf.exe that works with the cygwin libs version distributed in AIK.

I also installed cygwin and have tested it alone, after having unpacked/repacked with AIK, with echo -ne hexa >> file.img cmd, and it worked well.

However, in view of staying in a distributable thing, that uses AIK first, I could not be satisfied with this solution.

Executable win files (echo and printf) i found in my Cygwin install did not work in AIK (with the cygwin libs distibuted by AIK).

So I looked elsewhere, and I finally found one executable printf that worked:

https://github.com/bmatzelle/gow/downloads

I extracted printf.exe from this tool, and two dlls too (libintl3.dll and libiconv2.dll) taking into account the windows error messages when I tried to execute printf.exe without any tool libs.

So I put these three files (printf.exe + libintl3.dll and libiconv2.dll) in the android_win_tools AIK folder and added in repackimg.bat, just after mkbootimg cmd:

%bin%\printf \x41\xA9\xE4\x67\x74\x4D\x1D\x1B\xA4\x29\xF2\xEC\xEA\x65\x52\x79 >> image-new.img

And it finally worked ;)

My question: Would it be possible to include in win AIK these exe (printf and echo), please? It would really be very practical and could be useful in other cases like the fix you spoke of earlier.

Adding dd, would be a must too ;)
[Android Software Development] osm0sis:
Definitely just update all the Cygwin files at once and the binaries from them should work together. :good:

What's the story on bump for different devices? Different hexadecimal hash?
[Android Software Development] DarkHeart Z:
Internet has gone more problemetic today couldn't make thanks button work becuase of it . web page issue . But thanks a lot . I got what I wanted :)
[Android Software Development] 6ril1:
Pffff, i'm so stupid....It didn't work first because i tried with the 64-bit version of cygwin without thinkink that win AIK should be in 32.... I've just tried, after reading your answer, with the cygwin 32 bit version and it works well (just put printf.exe alone in android_win_tools, without need of any other file as dll).

Sorry for the inconvenience and thank you very much again @osmosis for your kindness.

About bump, i just tried it on the two device i've owned, G2 and G3, and both have identical sign. I don't really know for other LG devices, but it seems to me that i read other LG devices has the identical signs two (pads as well). It works only with KK (and JB) Bootloader, no more with LP (we have to downgrade bootstcak for making it work on next version of firmwares after KK).
[Android Software Development] stang5litre:
Anyone have any issues with the kernel booting your phone up when its off and you plug it into the charger?@osmosis

Thanks tool is awesome just need to find this fix. Thanks for any help sch-i545 Verizon v3.4.0 on OC1. MDK BL if that matters to anyone
[Android Software Development] 6ril1:
Please note that I made a mistake to copy and paste to the hexadecimal sequence (that you quote in your answer and that you take away from my post to which you answer). The good sequence is

%bin%\printf \x41\xA9\xE4\x67\x74\x4D\x1D\x1B\xA4\x29\xF2\xEC\xEA\x65\x52\x79 >> image-new.img

Thank's again for all.
[Android Software Development] jancsessz:
here is my kernel: http://www.mediafire.com/download/27kdc34dovne02s/boot.img
[Android Software Development] osm0sis:
Rereading your output (and attempting to make it readable), it looks like it worked fine with the drag and drop. How did you run it the first time? Executable crash aside, your image won't unpack because it has an ELF header, so isn't standards compliant, like most Sony devices; see the 2nd OP.
[Android Software Development] D_Vovan_238:
:D

1.7 Version working just perfectly on my Xperia Z1 :D

Now will try AIK Mobile V1.9 ;)

THANK YOU VERY MUCH FOR GREAT WORK :)
[Android Software Development] AthlonLozano:
I'm having issues with the kitchen. Tryied with another boot.img and it unpacks fine. But I need the new boot.img. Could you help me?

I have a Razr I - XT890

It has a x86 processor.

I'm trying to port MIUI.

As for as I was searching, the main dev for a CM11 for this ROM is Hazou. In his github, I've found a tool to pack/unpack boot.img, but unfornately I couldn't.

This is the output:

Android Image Kitchen - UnpackImg Script

by osm0sis @ xda-developers

Supplied image: boot.img

Setting up work folders . . .

Splitting image to "/split_img/" . . .

Android boot magic not found.

Error!

boot.img < XT890
[Android Software Development] osm0sis:
Seems pretty clear it isn't a standard image. Unfortunately you'll have to look elsewhere.
[Android Software Development] AthlonLozano:
Thx anyway! I'm a fan of your work!
[Android Software Development] fonz93:
[MENTION=4544860]osm0sis[/MENTION]

I am experiencing a very strange issue on my Moto G 2013 (falcon XT1032) after switching from ubuntu 15.04 to 15.10 (clean installed), i don't remember which version i was using previously (can you link me some of them?), but it was working fine, the problem is that after booting the device with the repacked boot.img, there is no network (no IMEI) and wi-fi is not working (no MAC adress, too), same issue if i try to use AIK on Windows 10 (tested 2.3), i didn't find any strange reference on dmesg (i am not much experienced), so, unfortunately, i have to give you the full log: http://pastebin.com/pQ3GPZrX

This is my untouched stock boot.img: https://drive.google.com/file/d/0B-xonQbKq2U2RGhVeHJoNTlXb3M/view?usp=sharing, taken from the full firmware package (http://www.filefactory.com/file/2qvmxcf924wn/XT1032_FALCON_RETEU_5.1_LPB23.13-56_cid7_CFC.xml.zip)

Here the source code of the kernel with tags: https://github.com/MotorolaMobilityLLC/kernel-msm/releases/tag/MMI-LPB23.13-56

The bug occurs even if i just unpack and repack the .img without modifying anything.

There's something else that bothered me in the past (but the kernel always worked so i didn't care so much), the stock image is 10 MB, if i repack the same image with no changes it is something like 8-9 MB, is that normal?

Thanks for your help.

Edit: it seems 1.9 that for Linux is working, 1.9.1 was the problem, but i can't get to work the 2.3 on windows
[Android Software Development] osm0sis:
Sounds like mkbootfs doesn't know what to set for some proprietary thing Moto's got going on. CM is usually good at keeping up with that stuff which is why I also pull in patches from them. AIK-Linux using the --sudo will be the way forward for you once I release v2.0 so you retain full perms and ownership from the original ramdisk unless there's a newer CM patch that fixes it (or we narrow it down to something newer CM added that I can revert). Does it work with any of the older Windows versions?
[Android Software Development] fonz93:
I had a previous version on my PC, but it doesn't work either, unfortunately i don't know which version it is (last modified 06/26/2015, but i don't know if it is 2.2..., i usually used to not update AIK version because if all is working i don't have any reason to check the thread), also, i only used to unpack Y300 boot.img on windows, as soon as i switched to Moto G i started to use AIK on linux.

I can't find any link for previous versions in OP (or i am blind xD), can you link me some?
[Android Software Development] osm0sis:
You're blind. GitHub! :)
[Android Software Development] fonz93:
:angel:

sooo, i did some tests:

Windows (10):

2.3-->no network, etc..

2.2-->same

2.0-->same

1.9-->can't unpack, error (..\android_win_tools\magic, 274: Warning: Printf format `l' is not valid for type `long' in description `, original size: %ld bytes'

..\android_win_tools\magic, 879: Warning: Printf format `l' is not valid for type `beshort' in description `- version %ld'

file: could not find any valid magic files!)

Linux (Ubuntu 15.10):

1.9.1-->no network, etc..

1.9-->working :good:

So, i've practically only used 1.9 on Linux since i got this Moto G until yesterday, i have been so lucky.
[Android Software Development] osm0sis:
Yeah, it's likely as I said then. I'll see if CM has anything new that might fix it, but barring that you'll have to stick to AIK-Linux and use the --sudo option to make sure it does it all as root instead of using mkbootfs once I release v2.0, hopefully soon. busybox cross-compiled to Android API 21 64-bit is currently driving me nuts because I had to start from scratch figuring out patches with it again vs. 32-bit (which I have at API 9 for compatibility), but I'm making progress.
[Android Software Development] fonz93:
Thank you for looking into it, there's no problem for me to wait, i used 1.9 for months without any problem so i can continue to use it
[Android Software Development] osm0sis:
Good news! I have become my own busybox provider! ;) :victory: :cool:

It took a fair amount of work but this means I have now been able to add full Android x64 binary builds (ARM64, x86_64 & MIPS64) and support to AIK-mobile! My Cygwin AIK Build Farm has been updated accordingly for those interested. It's becoming a bit of a monster! The main thing was I had to split busybox building into 32-bit and 64-bit since they accept different patches due to the different supported API levels - I like to shoot low for broad support with 32-bit at API 9 whereas 64-bit starts at API 21.

I also helped the developer of the file binary track down the segfault bug in Android compiles that's been around since file 5.21, so finally the included build has been updated, and is current up to that fix, on November 13th. :highfive:

The solution for Marshmallow ramdisks requiring strict ownership is now present in AIK-Linux as described below. Note, if a user opts to go the non-root route, then any extra added files must have their permissions set manually during boot via init.rc or a script because mkbootfs is limited to setting correct ownership/permissions only on stock/OEM Android files. The repackimg script automatically detects whether the ramdisk was unpacked as root and acts accordingly. Also, thanks 6ril1 for the Linux drag-and-drop fix. So, without further ado..

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

- Add advanced unpackimg --sudo commandline option to unpack as root and maintain full control over all repacked ramdisk file permissions, otherwise mkbootfs will automatically handle basic ownership/permissions at repack (AIK-Linux).

- Update file binary (5.25-003c7fc) (AIK-mobile).

- General script cleanups, removing the limitation on filenames/paths with spaces.

- Add/fix drag-and-drop support (AIK-Linux).

- Detect systemless root and install helper script to /su/bin if detected (AIK-mobile).

- Update busybox binary (1.24.1) and switch to my own builds (AIK-mobile).

- Sign zip to fix installation on CM Simple Recovery (AIK-mobile).

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

Installation information and details on each edition can be found in 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] Captain_Throwback:
Hey [MENTION=4544860]osm0sis[/MENTION]! Having an issue with v2.0 in Linux - it won't unpack my boot.img (v1.9.1 did this okay). Error message is "file: could not find any valid magic files!" The boot image has no special format - it's just a standard qcom type image w/dtb.

This is on my HTC One (M8), Google Play Edition (Android 6.0) boot image. I tried running with the sudo option and without and get the same error.

I'm running Ubuntu 15.10 64-bit.
[Android Software Development] osm0sis:
Hmm. I had it tested and working a week or two back, but I'll check it out again tonight and see. Sounds like the variable for $bin in $bin/magic isn't working, maybe from the change to allow for drag-and-drop by starting with aik=$(dirname $0). :confused:

Edit: [MENTION=1162986]Captain_Throwback[/MENTION] reproduced. Damn, not sure when that bug crept in! Working on it now, and I'll repost AIK-Linux v2.0 once it's fixed. :)

Edit 2: The issue is the drag-and-drop fix switches the stored aik path to a relative one, whereas previously we used pwd to get an absolute one. Currently looking up bulletproof ways to get the real path of the executing script, which seems smarter than rewriting the part with file to use relative.

[MENTION=2308854]6ril1[/MENTION] does switching aik="$(dirname $0)"; out for aik="$(cd "$(dirname "$0")"; pwd)"; still work for drag-and-drop support?

Edit 3: Uploaded to the OP, let me know how it goes. :good:
[Android Software Development] 6ril1:
Hi @osm0sis,

All is OK , with "$(cd "$(dirname "$0")"; pwd)", no problem with the drag an drop, as on the previous that the new version ;)

:good:
[Android Software Development] Crytix:
Confirmed workin on HTC one m7

Thanks for your work.

AIK Mobile worked on HTC one m7 with latest twrp from mdmower.

Device S-Off, GPE 5.1 H11, latest twrp :)

Greetings

Crytix
[Android Software Development] DarkHeart Z:
lucky me I just downloaded it and you updated it yesterday thanks man :D
[Android Software Development] Captain_Throwback:
The updated version does properly extract my boot.img as root. I guess the next question is, is there any way for me to modify the files without also using root? So I copied a zImage and a dtb from another folder into the current split_img folder to include them in the boot.img, but when I went to repack, I got an error, I guess because those files didn't have proper permissions? Trying to figure out how exactly to edit these Marshmallow boot images is a bit of a pain. It seemed to work the easiest just doing sudo /unpackimg.sh versus using the --sudo parameter. Since I then have to use a root File Manager to edit the files anyway, it just seems to make retaining the permissions and being able to freely copy/paste less unwieldy. Unless there's something I'm missing to make it easier (which is possible).

Also, how exactly does the "drag-n-drop" work in Linux? Can I finally copy the bin folder to my home bin folder and run aik from any path to unpack a boot image? Or is that referring to something else?
[Android Software Development] osm0sis:
You can not use --sudo and just let mkbootfs handle things, that should work for most devices. Only ramdisk files are root in the new version when using --sudo, split_img is still user level because root user isn't necessary in the image building process. What's the error you get?

As for drag-and-drop, the idea is to still have AIK be self contained in its own dir so you can have multiple ones going at once if you simply copy the whole folder. My understanding is that it simply lets you drag an image file onto unpackimg.sh to get things started, as in Windows.