yashsingh1/xdaforums huggingface dataset:
[Android Software Development] osm0sis:
You don't need that list=/rdfile stuff since you're not importing any files from the system root. All you need is that skip_override if/else. If you want to include extra files put them in ramdisk/overlay/. There is no initramfs for boot, only for recovery until that skip_initramfs hack/patch is in place. Sounds like flar2's patch might not be working for you?

For anything further you should take your questions over to the AK2 thread, since you're not using AIK anymore. Flash Kernel and Franco Kernel both use AK2 and are out for the OP6 so I'd suggest checking them out for pointers.
[Android Software Development] phenoxis:
Will do!

Thanks for the pointers. Sorry for posting in the wrong place. I'll move it to the AK2 thread in case I have any more questions.
[Android Software Development] ingbrzy:
[MENTION=4544860]osm0sis[/MENTION]

Here is boot.img from Xiaomi MI8 SE.. Before repacking it has size 67.1MB and after repack it has 16.1MB.. is it OK..?
[Android Software Development] osm0sis:
It's actually 64.0MB before, which is the size of the entire boot partition. It's signed with AVBv2:

OnePlus5T:/data/local/AIK-mobile # strings boot-sirius.img | tail -n8
V8*Mf
AVB0
avbtool 1.0.0
sha256
boot}\
$.n9d
''W(
AVBf
OnePlus5T:/data/local/AIK-mobile #

With AVBv2 the signature goes right to the end of the partition (AVBf = AVB footer), so the dumped untouched boot.img can't be trimmed any further without removing the signature. AVBv2 re-signing requires Python and generally isn't being done currently since Google has made it clear it's not required on unlocked bootloaders. If you do want to fool around with it on-device I've got a package linked in my Odds thread.

So, long story short, the repacked one isn't signed so it's basically trimmed down to the unsigned size, and that's nothing to be concerned about.
[Android Software Development] osm0sis:
Feels like these fixes have been accumulating for a bit, so it must be time for a bugfix release! I have also just drastically reduced the size of the AIK-mobile installer using xz to bundle the binaries, so now it can be hosted in the OP attachments again! :victory:

To build along at home please see the updated AIK Build Farm scripts. Happy hacking!

Fla**** v3.3 is available over in my Odds and Ends thread, highly recommended as it's the perfect companion package to AIK-mobile.

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 v3.3:

- fix --forceelf repack of ELF without cmdline

- update mkbootimg, unpackbootimg, pxa-mkbootimg, pxa-unpackbootimg and futility binaries from my repos

- update lz4 binary (1.8.2)

- update mkimage and dumpimage binaries (2018.05)

- update to the latest Cygwin binaries and libraries

AIK-mobile v3.3 + AIK-Linux v3.3:

- fix cleanup as part of aik --uninstall on 18:9 devices (AIK-mobile)

- fix --forceelf repack of ELF without cmdline

- fix installations via Magisk Manager on Android P (AIK-mobile)

- improve installer cleanup on fallback manual loop mounts (AIK-mobile)

- fix booted Magisk Manager installations on Magisk 16.3+ (AIK-mobile)

- fix aik --uninstall/--restore on Magisk 16.3+ (AIK-mobile)

- bump Magisk template version to 1500 (AIK-mobile)

- update mkbootimg, unpackbootimg, pxa-mkbootimg, pxa-unpackbootimg and futility binaries from my repos

- fix AVBv1 not being detected in some MTK images with non-standard trailing data after the signature (AIK-mobile)

- update lz4 binary (1.8.2)

- update file binary (5.33) (AIK-mobile)

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

- update mkimage and dumpimage binaries (2018.05)

- update xz binary (5.2.4) (AIK-mobile)

- improve installer size and speed by bundling bin as .tar.xz (AIK-mobile)

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

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] osm0sis:
[MENTION=6842057]nathanchance[/MENTION] found a major regression issue with busybox 1.29.1's gzip. AIK-mobile pulled temporarily until it's resolved. :good:

More info here:

https://github.com/osm0sis/AnyKernel2/commit/8aa7b787e16206a76fb6adc8874674e7dffd0287

https://xdaforums.com/showpost.php?p=77153682&postcount=6182
[Android Software Development] martyfender:
Although this may not be a problem with your Magisk module, I had problems installing your Magisk Module, busybox for Android NDK v1.29.1 today using the mm downloads section of the app. I was successful installing it, though, on my 4 Nextbook Ares 8A tablets by doing it in TWRP. On one device I have Magisk 16,7 beta and on three devices I have the unofficial [MENTION=3306843]kantjer[/MENTION] 20180721 version of Magisk. I posted an install log in the Magisk beta forum, if you want to take a look.

And I tested Your new Linux version of AIK on my Linux Mint Mate desktop and it appears to be working great, as always. Thanks for all of your great releases.
[Android Software Development] osm0sis:
I replied in the Magisk thread. :good:
[Android Software Development] osm0sis:
Found the offending commit and bug filed: https://bugs.busybox.net/show_bug.cgi?id=11171

Now rolling busybox builds without those gzip commits. :good:
[Android Software Development] osm0sis:
UPDATE-AIK.Mobile.Installer.v3.3-ALL-signed.zip is back up in the OP. The only change is I added new busybox 1.29.1 builds with gzip working again. To the 100 people who downloaded the previous upload, please go ahead and grab it again. :good::)

Thanks again to [MENTION=6842057]nathanchance[/MENTION] for finding this issue and bringing it to my attention quickly! :highfive:
[Android Software Development] godofsalt:
Tanx

Mr osmOsis-

Just want to say thank you.

THANK YOU.

You have done soo much for all of us. Tons of tools, scripts and this, The Kitchen, Majisk scripts, etc., Just LOVE them all.

Plus, (doing anything that I do in spare time, which is hard to come by, btw) you are doing all of this int your spare time. You have so much going on, it is crazy how, all that you do have out, it seems works just fine!!!

Awesome job. Hopefully, you can find some "Spare time" for yourself!

Thank you
[Android Software Development] HesThatGuy:
Hi osm0sis, I've been trying to create a few boot images for the Google Pixel except I've ran into a problem. When modifying any file (Ex. fstab.sailfish) the boot image will not mount and makes the phone reboot as soon as it goes to the Google logo, but if I don't modify any file and instead flash a seperate zip that contains the modified file then the phone will boot up completely. Is there any way this can be fixed? I really just want to change my pagesize down to 2048.

What's also confusing me is that I can modify any file on the Nexus 5X with AIK and it mounts and boots up just fine.
[Android Software Development] ale8530:
[MENTION=4544860]osm0sis[/MENTION]

Hello I thank you for your great work, but I wanted to inform you of a problem encountered with the new boot.img avbv2:

If decompile boot.img with avb1 your tool create split_img/boot.img-avbtype

If decompile boot.img with avb2 your tool not create split_img/boot.img-avbtype

then I noticed that the size of the file undergoes changes

For example original size 67 mb after repack i have size 16 mb with other boot.img this does not happen

When I compile and flash the new boot.img at power up I get this message "Android System: There's an internal problem with your device. Contact your manufacturer for details."(view image attached)

Boot.img for your test here

Thanks for collaborations
[Android Software Development] osm0sis:
Sounds like dm-verity is enabled. Root first, then dump the boot.img to do it easily.

Read my answer to ingbrzy on the previous page of the thread. That message can be avoided by using "Preserve AVB 2.0/dm-verity" in Magisk Manager.
[Android Software Development] ale8530:
Sorry i have not read :(

---------- Post added at 12:44 PM ---------- Previous post was at 12:31 PM ----------

Excuse me again, but it is not possible to fix it without Magisk Manager? Will your tool AIK fix this problem?
[Android Software Development] osm0sis:
You can modify the boot.img however you want, but AIK doesn't hold your hand while you do it. You'll have to take a look in Magisk's zip and GitHub to see how it does KEEPVERITY and then you can do it manually if you like.
[Android Software Development] ale8530:
I tried magisk 16.4 is enabled the preserve avbv2 did not solve the problem of the warning message
[Android Software Development] HesThatGuy:
I've disabled dm-verity using both Magisk and this commit to patch my own kernel: https://github.com/reddv1/msm/commit/a8ddca8d7175a7fb2445e9d1e0bb9c1bb4661b5a on separate occasions and they are confirmed to have dm-verity disabled, but the issue still persists.

The only file I'm able to modify is the boot.img-zImage by switching it with a different one.
[Android Software Development] osm0sis:
You have to do it over the unmodded ROM default boot image and with an unmodded dtbo partition so that it actually gets preserved, if I recall correctly. It works on my OP6. Any further problems with Magisk Manager should probably go to the Magisk Beta thread for troubleshooting.

[MENTION=6842057]nathanchance[/MENTION], any Pixel insights you can provide?
[Android Software Development] nathanchance:
[MENTION=7309286]HesThatGuy[/MENTION] So you're able to unpack and repack without issues? I'd unpack then repack with the '--original' flag to see if that works.

Additionally, I was under the impression that the fstab was on /system (maybe /vendor now?) with the Pixel, you sure that that file is in the ramdisk?

You may need to remove the ',verify' tag from here: https://github.com/aosp-mirror/kern...rm64/boot/dts/htc/msm8996-htc-common.dtsi#L63
[Android Software Development] HesThatGuy:
Yeah I'm able to unpack and repack without any issues, it's just that the phone won't accept certain files if they are modified via AIK.

An example: I can unpack the stock boot image, switch the boot.img-zImage with my custom one, repack it and it'll boot just fine, but if I switch or edit any other file like the fstab.sailfish, boot.img-pagesize, etc... the booting sequence will only get to the Google logo and immediately reboot.

As for the fstab issue I'm not worried about that specifically as I have a separate flashable zip that I use to replace it and I've removed the verity flags in it. I was just using it as an example. My main target is the boot.img-pagesize. After testing on the 5X with setting it to 2048 I've noticed that RAM management is better and I would like to set it to that on the Pixel
[Android Software Development] osm0sis:
Are you in Windows? Simple, but could be explained by line endings.
[Android Software Development] HesThatGuy:
Yeah, I'm using AIK on Windows. The text editor I'm using is Notepad++ and has worked fine with editing other unix based(not sure that's the term I want here) files without any issues.
[Android Software Development] osm0sis:
Okay, yeah, just make sure it's LF line endings to rule that out.

[MENTION=3292224]franciscofranco[/MENTION]'s Pixel AK2 zips work, they even add files to the ramdisk, and that's basically the same as AIK, so I'm not sure what's going on in your setup.
[Android Software Development] HesThatGuy:
Just checked to see if it's the line endings issue and heres what my terminal gave me:

hesthatguy@vm:~/Desktop$ file boot.img-pagesize
boot.img-pagesize: ASCII text

I unpacked on Windows and moved the file to my Ubuntu VM.
[Android Software Development] ashyx:
I don't get it. Are the pixels different to other Oreo devices then?

There is no dm-verity flag in the FSTAB any more, nor should the FSTAB be in the Ramdisk.

As per Google's specs for Oreo the FSTAB has moved to System and the system flags including dm-verity have moved to the dtb.

I don't know how Pixels work, so maybe I've misunderstood somewhere.
[Android Software Development] HesThatGuy:
For the 1st Gen Pixels the fstab is located in the ramdisk on Nougat builds and contains the mount points for System & Vendor. Those mount points have a verify flag as shown here on the latest Nougat build: https://android.googlesource.com/device/google/marlin/+/android-7.1.2_r36/fstab.common

As for Oreo builds the fstab is located in the Vendor partition under the directory: \vendor\etc and contains the mount point for System: https://android.googlesource.com/device/google/marlin/+/android-8.1.0_r41/fstab.common while Vendor is mounted through the dtb:https://github.com/aosp-mirror/kern...rm64/boot/dts/htc/msm8996-htc-common.dtsi#L58
[Android Software Development] osm0sis:
Try AIK-mobile, see if it makes a difference to what you're seeing. Some devices also just might not accept the changes you're trying to make - maybe the Pixel doesn't like 2048 or whatever you're changing in the fstab.
[Android Software Development] Mogster2K:
There's another option: you could install Windows Subsystem for Linux and run AIK for Linux inside it.

One caveat: copying files into the WSL folder doesn't work (you can copy out but not in.) Setting up SSH in WSL is probably the easiest way to transfer files.
[Android Software Development] Aqq123:
Thank you for this excellent tool I've been using over the years. Just dropping the following note here, in case anyone else runs into the same issue:

At least with the image I've just been repackaging (TWRP 3.2.2-0 for Redmi Note 5, aka Whyred), with AIK for Windows, if you try to repack a

copy

of the ramdisk folder, not the original created by AIK, the rebuild is successful and ends without errors but the resulting image will be unbootable. In other words, only the original ramdisk folder created by AIK can be repackaged back.

I guess this could be because one of the tools uses alternate data streams to store metadata, which is silently lost upon making a copy of it with Windows Explorer. Or perhaps the cause is something different yet. Anyway, the solution is to only work on the original ramdisk folder created by AIK. Hope this helps anyone trying to find out how an unmodified image could suddenly become unbootable after repack.
[Android Software Development] Mogster2K:
My guess is permissions; many of the files need to be owned by root which is why the Linux version asks you for your root password. I'm not sure how the Windows version handles it.
[Android Software Development] minhducsun2002:
Many thanks for the developer, whose tools have been in my hacking kit for years.

May I ask if the kitchen can be used for HTC devices? They seem to use an irregular header, apart from the usual format of Android boot images (ANDROID! offset isn't at 0). And if possible, may I know the alternatives to be used?
[Android Software Development] osm0sis:
Depends if the signature header is enforced on the device in question. I'm told HTC generally work fine without their header. :good:
[Android Software Development] minhducsun2002:
Really sorry for bothering you. Yes, it worked, as you say.

Saying about my device, it is less known : HTC Desire 700 (dual SIM), with codename cp5dug.

What I did was compiling kernel from official source and then replace the official zImage with my new compiled one. Possibly some configurations weren't matching.

I included here the official stock boot image, extracted from RUU, in case it is helpful to someone. Surprisingly, it got a size of 9.21MB, which is kind of oversize for a typical Android boot image of 8MB.

Many thanks again, for everything you've done.
[Android Software Development] osm0sis:
Full partition is probably 16mb on your device. Pixel has 32mb and most current devices are 64mb now. :good:
[Android Software Development] it's pointless:
Noob here.

I have a Chinese Oppo R9 which wont let you install Google services. Managed to root and install xposed, signature spoofing, microg, flashing international version rom (this does not work due to hardware incompatibilities), etc... but the oppo will automatically disable any com.google.android.gms, com.google.android.gsf , and invite you to install a fake google apps version from their servers, presumably spyware that of course is incompatible (different signature) with any app needing real Google Apps.

Could any of the tools in this thread help overcome this oppo "feature"?

Thanks
[Android Software Development] osm0sis:
Check the boot services in the init.*.rc files maybe.
[Android Software Development] it's pointless:
Thanks! I never noticed these files. Lots of things to check in there!

Sorry that this was not the place to ask
[Android Software Development] turbo81:
Hi,

I have successfully compile my kernel and also tested newly generated Image.lz4-dtb by:

fastboot boot Image.lz4-dtb

My phone booted up with the new kernel without any issue.

Then I downloaded the factory image from

https://dl.google.com/dl/android/aosp/marlin-ppr1.180610.009-factory-90a4fa8b.zip

Unzip the factory image.

Got the latest Android Kitchen 3.3 and run:

unpackimg boot.img
cd split_img

Renamed Image.lz4-dtb to boot.img-zImage, replaced the boot.img-zImage in split_img with the new boot.img-zImage

and then repack the image:

repackimg.sh

One repacked I rename image-new.img to boot.img

Subsequently flash the new boot.img

fastboot flash boot boot.img

Then boot loop.

Anyone able to point me to the right direction. Did I unpack and repack wrongly? I thought I got it right since I am able to boot successfylly with

fastboot boot Image.lz4-dtb

Many thanks.

Wayne
[Android Software Development] osm0sis:
I don't have a Marlin so we'll have to get someone else to confirm/help past the basics here ([MENTION=6842057]nathanchance[/MENTION]?), but have you tried `fastboot boot boot.img` with the repack? You could also try repackimg --original since you're not altering the ramdisk to see if that makes a difference. If none of that works, might it be verity related? A log and more details about the platform you're running AIK on might be useful. This is a device that was previously reported working, and continues to work with AnyKernel2, so AIK should be much the same.
[Android Software Development] turbo81:
Thanks. I have not tried `fastboot boot boot.img`. I will give that a crack and see how it goes as well as 'repackimg --original'.
[Android Software Development] nathanchance:
I'll try to find time to test this today. Stable merges are kicking my rear :p
[Android Software Development] lehmancurtis:
Have you tried booting the image.lz4-dtb on it's own after the name change to boot.img-zImage?
[Android Software Development] osm0sis:
Name doesn't make a difference to anything in the boot.img structure.
[Android Software Development] nickrule1896:
What if I get only Image and Image.gz files in the boot folder? Do I need to do anything to the dtb files or ramdisk? If I simply use the Image file to replace with the zImage for repack, is it correct?

>>>>> Time used for generated all hashes is 14 sec
OBJCOPY arch/arm64/boot/Image
GZIP arch/arm64/boot/Image.gz
DTC arch/arm64/boot/dts/exynos8890-smdk8890.dtb
DTC arch/arm64/boot/dts/exynos8890-universal8890.dtb
[Android Software Development] ashyx:
Image and image.gz is the kernel.

One compressed one not.

Use whichever one is appropriate to swap with the zImage.
[Android Software Development] RebelLion_:
I keep getting this error while trying to unpack my boot.img I got from Fla****. :/ I deleted the busybox to use my own, since it was giving the same error. Do you know what I can do to fix it? [MENTION=4544860]osm0sis[/MENTION]

/data/local/AIK-mobile/unpackimg.sh[85]: /data/local/AIK-mobile/bin/file: not executable: 64-bit ELF file
/data/local/AIK-mobile/unpackimg.sh[117]: /data/local/AIK-mobile/bin/file: not executable: 64-bit ELF file
Unrecognized format.

Edit: I found out my default.prop gets modified when I go in recovery and for some reason it sets my arch as arm64. I manually put the arm binaries in and its all good now, sorry to bug
[Android Software Development] nickrule1896:
Does the exclusion of dtb files affect the boot image's stability in any way? My kernel build output does show dtb files created but it is named differently?

OBJCOPY arch/arm64/boot/Image
GZIP arch/arm64/boot/Image.gz
DTC arch/arm64/boot/dts/exynos8890-smdk8890.dtb
DTC arch/arm64/boot/dts/exynos8890-universal8890.dtb

I'm trying to build a custom kernel for my S7 for a school project. Correct me if I'm wrong, what I did is i took a boot.img from my nandroid backup, unpacked it with AIK, replaced the zImage in split_img folder with the file "Image", repacked it and flashed the image_new.img using TWRP. No considerations done with regards to ramdisk. Am I supposed to do anything else?
[Android Software Development] ashyx:
Just use the dtb from the unpacked boot image.

Nothing else needs to be done except swap the zImage.
[Android Software Development] nickrule1896:
Thanks for the confirmation! I have successfully unpacked and repacked the boot.img, however it fails to boot on my S7 (stuck on splash screen). Not sure what's the problem :confused:
[Android Software Development] Fravin:
Thank you!
[Android Software Development] Oki:
[MENTION=4544860]osm0sis[/MENTION], you can add the ZTE Axon 7 to the list of compatible devices. I have been using your tool for Windows for unpack and repack boot images and TWRP images for this device.

Nonetheless I have reached a limitation when repacking. I can't add more files to the ramdisk. If I do that, TWRP doesn't boot. I am starting to customize the TWRP ramdisk, adding specific tools for this device. The device has enough memory to not having any limit on the ramsize. It has 3GB of RAM and the 64MB partition shouldn't be a problem to have everything in ram.

I haven't found any mention to this detail in this thread. Is your AIK able to increase the ramdisk size during the repacking so we could integrate more tools inside the ramdisk?

Thanks in advance
[Android Software Development] osm0sis:
You're probably hitting the limit of the partition size. You can't change the partition size since repartitioning is of course drastic, but you can try to use repackimg --level 9 for higher compression, or if your kernel supports it switch to a higher compression format like xz or lzma.

Also, glad to hear it works now.. I was under the impression it wouldn't since there's an unlisted dtb and unlisted second ramdisk hidden in the stock boot.img someone supplied earlier in the thread. :good:
[Android Software Development] Oki:
I was hoping that there was a solution to this. This quote from source.android.com made me think it was possible:
[Android Software Development] osm0sis:
Ramdisk can be as large as you want, your boot.img is valid, it just won't fit on your device; can't change that limit without repartitioning. Hopefully that makes more sense now.

If your image shouldn't be hitting the partition size limit then maybe try doing it on AIK-mobile and see if that makes a difference.
[Android Software Development] Oki:
Thanks for your answer, but the partition size is not the problem here. I have created a tool for repartitioning non Treble devices to add the vendor partition taking space from system or userdata partitions. In the Axon 7 case, the Recovery partition has a size of 64MB. The image-new.img file generated is less than 25MB in size. The problem happens when the uncompressed ramdisk-new.cpio image is larger than 32MB. I'll try AIK-mobile. Thanks again.
[Android Software Development] the-blind-bandit:
I've just had a pretty unusual problem, unpacking and repacking a twrp img in the linux version of AIK - TWRP won't start ... If I do the same in the windows version TWRP starts.

I don't get any errors in either terminal so what could be the problem?