yashsingh1/xdaforums huggingface dataset:
[SuperR Kitchen] jbrivers7:
Error when building system.img

Hello gentlemen! I'm sorry to bother, but I've been pounding on this issue for nearly 3 days now, with no luck whatsoever. Could you all please help me with this?

What I'm trying to do:

Build a system.img from my current TWRP backup files.

What's happening:

I keep getting the following error message when attempting to build the system.img from the extracted TWRP backup file: "ERROR: Something went wrong building the image. Make sure your partition size is correct and that the directory is not too big to fit." (I have a screenshot, if necessary)

What I've tried:

I have read through too many of these thread responses to even count, tried every single thing that I could google imaginably, and even searched the thread for keywords regarding this, but still with no luck. The options that I'm currently attempting to use are: Odexed, set_perm (have tried all four options), Build system.img, Device through adb shell (have tried all three options)...I even tried a combination of ALL options available, but still with no luck. I have the necessary config, META-INF, system, and boot.img files, properly extracted from TWRP backup files (boot.emmc.win, system.ext4.win000, system.ext4.win001, and system.ext4.win002)

What hardware I'm attempting to run this on:

Samsung Galaxy S6 (SM-G920T) - Unlocked T-Mobile Phone

Build Number: G920TUVS6FRA3

Rooted (started unrooted, but thought this might be causing the issue...come to find out...it wasn't)

Ubuntu 16.04 build

SuperR Kitchen v1.1.8.2

TWRP Custom Recovery

If you need any further detailed screenshots, logs or files, please let me know. Thank you VERY much in advance for your time sirs! :D
[SuperR Kitchen] SuperR.:
I did not have this issue. I only test on 64-bit Ubuntu 16.04.3, so maybe something is different. You could try Ubuntu4Ktichen or Mint4Kitchen linked in my signature. They have everything set up for the kitchen.

Try entering this number manually when it asks your system partition size:

3879731200

I found it by Google searching "SM-G920T device tree", then looking at the BoardConfig.mk file.
[SuperR Kitchen] AL_IRAQI:
Mint seems a bit problematic for me, i didnt try out yours tho, ill try os your Ubuntu build
[SuperR Kitchen] jbrivers7:
THANK YOU!!!

Thank you VERY much sir! That is exactly what I needed!! I'm sorry for my ignorance regarding this topic. I will attempt to flash this image, and see if it runs successfully.
[SuperR Kitchen] jbrivers7:
Unable to ODIN Flash

I attempted to package the system.img as a tar.md5 hash file, for ODIN flashing, but the flash fails every time. I have tested the .img to .tar.md5 conversion tool on several other STOCK ROM .img's, and it works without issue; for creating .tar.md5 flash-able files. Any ideas as to what else I need to do here? I can't set perm to "set_metadata" because the SM-G920T cannot change SELinux to permissive or disabled with stock kernel, even though my device is rooted.
[SuperR Kitchen] SuperR.:
I have 2 guesses:

You built a raw system.img when you need to build a sparse system.img

The file permissions/capabilities are not correct for your device. make_ext4fs uses AOSP permissions/capabilities when building a system.img. If your device has different ones (it probably does if it is not a Nexus/Pixel), it will cause issues.

If guess 2 is correct, the donate version of the kitchen has an advanced feature allowing you to build a system.img with the original permissions/capabilities from the firmware you extracted. It also has a tar.md5 plugin for creating the odin flashable files :)

If the donate version is not for you, the TWRP flashable set_metadata perm type is your best bet with the free kitchen.

I am not sure why you would need to run permissive. Generally removing dm-verity from your stock boot.img will allow custom roms to boot and you can do that from the kitchen boot menu after unpacking. Of course this assumes you have an unlocked bootloader and TWRP.
[SuperR Kitchen] sravan@xda:
Installed superrkitchen in Linux mint,

I am unable to extract system.img of nougat,

Where as I can extract the system.img of lollipop and marshmallow successfully,

Why I am unable to extract the nougat system.img?

It gives error cannot stat output.

What's the error?
[SuperR Kitchen] narshi shukla:
I extracted boot img and statement img from my phone while it was in twrp mode(not twrp backup, it's piling images from rom itself).

And replaced few Chinese bloatware, used patched boot. Img which works without problem if flashed along with old zip of ROM.

But new zip is not hooting, giving me boot loop.

Also there is huge difference in original zip folder structure and placement of files with that of new output zip.

What i m missing here, ho to resolve this.
[SuperR Kitchen] SuperR.:
I only test on 64-bit Ubuntu 16.04.3. You could try Mint4Kitchen (linked in my sig) which is all set up for the kitchen. Otherwise if you send a fast link to your firmware that does not require registration I will take a look.

It is possible the file permissions/capabilities are not correct for your device if you are building sparse_dat or raw_img. make_ext4fs uses AOSP permissions/capabilities when building a system.img. If your device has different ones (it probably does if it is not a Nexus/Pixel), it will cause issues. If this is correct, the donate version of the kitchen has an advanced feature allowing you to build a system.img with the original permissions/capabilities from the firmware you extracted. Otherwise, if you send a fast link to your firmware that does not require registration I will take a look.
[SuperR Kitchen] narshi shukla:
I find out myself. I extracted rom with Adb shell, earlier it was throwing errors but reflashing my phone and replacing magisk with supersu worked,

I extracted boot.img,system. Img and recovery. Img.

How the recovery file it extracted was a wrong one its side were is similar to boot. Img(67.1 mb)

I build a full rom and my phone was completely bricks, however later i recovered it using deep flash cable methods.

Then i build a rom without that recovery. Img and it worked.

But there is a problem, now the whole rom is lagging, performance is down, and in modded gcam, portrait mode makes the app crash.

Later i restore my boot image backup and portrait is working and lag are gone.

However i m not able to convert boot.emmc.win into img file or flashable zip as error is something went wrong, unable to extract zip, however it creates a boot folder and 99% files can be found there, but those missing files are causing bootloop.

So now i have working rom and i have to restore boot backup everytime i flash this rom.

Can you suggest me a way to make it simpler, there are some paid software to claim turn any zip into flashable zip, but I will have two flashable zip, one is rom and other will be this one..

Suggest me a way by which i can turn or create flashable imgur zip of my boot.emmc.win file.
[SuperR Kitchen] SuperR.:
Simply rename boot.emmc.win to boot.img and use it in your ROM.
[SuperR Kitchen] narshi shukla:
Now rom is lagging like he'll, am i missing something?
[SuperR Kitchen] kevintm78:
I'm not sure you're providing enough info. If you're deodexing your rom that can definitely cause some problems. If not, it's possible that what SuperR said earlier may be your issue.

This:

If I were you I would post a link to the firmware you're trying to build (a fast link that does not require registration) and the support.zip from the kitchen itself. Before doing that though, you may want to get some logs from your phone while this lagging is going on to see exactly what's going on.

The kitchen can only build from what it is given and any changes made to the original firmware can have adverse effects. Just keep at it and you'll get it figured out. :)
[SuperR Kitchen] bcrichster:
Some ROMs just run like crap after boot.img modifications since they were designed to run with other settings.. Fixing that can require extensive kernel adjustments.. Just food for thought
[SuperR Kitchen] narshi shukla:
[MENTION=5787964]SuperR.[/MENTION]

Hey buddy, changing permission to raw_img solved the lagging issue, but now gcam video recording is broken and all the gcam app is very unstable, crash everytime when changing options, video recording is causing app crash.

Can u suggest me which files may be responsible for this behaviour.

All I wanted to do is to enable cam2 api by replacing some camera related files in system, i have done this on my nougat roms everything went smooth but this rom is having problems.

Here is the link to gdrive folder where the full rom zip is present which i build yesterday.

https://drive.google.com/drive/mobile/folders/1GuDm5c8XI9L3g_nXtCjS1j-14Mdy0gv5
[SuperR Kitchen] moriel5:
For some odd reason, repacking the Blackview BV6000S's stock ROM using the kitchen, even without modifying it (aside from it being repacked), nets me a force-close loop of the Play Services each time I boot the device, preventing me from setting up the device, does anyone have any ideas?

To be clear, I do not use GAPPS, this is meant for a friend.
[SuperR Kitchen] SuperR.:
v1.1.8.3 (Free Bash version)

Changes:

Added support for Oreo deodexing with vdexExtractor by [MENTION=407497]anestis[/MENTION]b.

Fixed some file capabilities not being read completely from the mounted img and getting ignored.

Added support for extracting new Samsung firmware that uses lz4 compression.

Fixed /data mount when flashing after adding userdata to the ROM.

NOTE: There is a known issue where the phone lags after deodexing Oreo. This is not a kitchen issue. I don't know the best way to fix this, but I have heard that edits to sepolicy or running selinux permissive fixes it. I do not recommend running permissive, just informing you of what I have heard :) Thanks to [MENTION=4544860]osm0sis[/MENTION] for the lz4 binaries in AIK :)

EDIT: Apparently xda changed something and no longer allows downloading from a direct link in DevDB. I am not sure how to deal with this yet but I will find a solution ASAP. For now new installs may say "The tools download/install failed. AIK". Kitchen updates are not affected since AIK was not updated.

EDIT2: For now, you can download AIK manually and add it to the kitchen if you want.

Extract it into a directory named AIK. Make sure the directory structure is as follows:

Linux: kitchen/tools/boot/AIK/unpackimg.sh

After this the kitchen should start right up. Sorry for the trouble.
[SuperR Kitchen] moriel5:
Thanks, I had tried to create raw images before, now I had set it to "set metadata".

One bug that is affecting me right now (ever since I had updated to v1.1.8.3), though, is that the updater script being created is always blank.
[SuperR Kitchen] gaganbajwa:
How to extract tar file using superr kicthen in linux help me plz
[SuperR Kitchen] SuperR.:
v1.1.8.4 (Free Bash version)

Changes:

Fixed AIK download failing due to xda devdb no longer allowing direct downloads from external source.

Thanks to [MENTION=4544860]osm0sis[/MENTION] for helping to get the AIK download issue sorted :)
[SuperR Kitchen] narshi shukla:
Which type of tar files? Do you want to extract twrp backup files? You can do them directly in. Win format, place boot. Emmc. Win and system win files in you project folder and extract.
[SuperR Kitchen] gaganbajwa:
Stock rom my samaung galaxy j7 pro md5.tar file how to extract
[SuperR Kitchen] SuperR.:
Let the kitchen extract the full firmware package. It will do everything for you.
[SuperR Kitchen] gaganbajwa:
Ohh i paste only single ap file so its not working right?
[SuperR Kitchen] gaganbajwa:
Sir i try working my rom extracted thnx u very much sir

---------- Post added at 12:12 PM ---------- Previous post was at 12:10 PM ----------

Sir i try working my rom extracted thnx u very much sir only 1 more help me how to deodex my rom with kichen
[SuperR Kitchen] bcrichster:
Go to ROM tools
[SuperR Kitchen] gaganbajwa:
When click on Unpack boot.img showing error plz help me
[SuperR Kitchen] russel5:
In oreo we have this in sepolicy zygote

# When WITH_DEXPREOPT is true, the zygote does not load executable content from
# /data/dalvik-cache.

and thats why we have a massive lags. dex2oat can't create something in dalvik only zygote can, but after deodex even zygote can't

no more need make sepolicy permissive. we are only need patch sepolicy with this

allow zygote dalvikcache_data_file:file execute;

try it on my xz1 compact, works perfect, no lags or dex2oat errors in logcat

glad to help you
[SuperR Kitchen] sumitr3ddy:
After making flashble rom

Its not booting why

Is thair any issues in updater script

Or the extracting system.img or system.new.dat

---------- Post added at 02:03 PM ---------- Previous post was at 02:00 PM ----------

I have oppo a33f

And i ported twrp from oppo f1f
[SuperR Kitchen] putipa66:
Badass......

Thank you so much for creating a noob friendly Linux utility! My phone went tits up and I got a good deal on an LG G6 US997 from my neighbor. She's an ol' bittie and is paranoid about inputting her info. I have searched for almost 2 days for something Linux compatible that I felt competent enough to use to get past the FRP.

Not sure what the outcome is going to be, but at least I understand the instructions.

Thanks again, you rock! :highfive:
[SuperR Kitchen] narshi shukla:
Help needed,

Tool is not creating zip, but it's behaving and showing like its creating but actually zip is there.

I have used similar methods before and it was successful, however after super kitchen update, this is my first project.
[SuperR Kitchen] SuperR.:
When it asks for the name of your zip, don't use / in the name.
[SuperR Kitchen] narshi shukla:
Yes it treats title and create parent folders before / so finally i found zip inside multiple folders,

Thanks by the way

:)
[SuperR Kitchen] SuperR.:
v1.1.8.5 (Free Bash version)

Changes:

Added option to patch sepolicy to allow zygote execute permission for dalvikcache_data_file after deodexing Oreo.

Updated vdexExtractor by [MENTION=407497]anestis[/MENTION]b.

Moved changelog to a different server.

Added several files to the Samsung knox remove list.

Make sure all files with unique permissions make it into the set_setadata updater-script.

Removed pre-defined set_metadata_recursive lines from the updater-script when extracting from img file.

Prevent / being used in zip name.

Fixed updater-script getting wiped when building ROM if there are a large amount of set_metadata lines.

NOTE: There are major changes to the set_metadata updater script when extracting system/vendor.img files as your base. I suggest extracting your firmware fresh to take advantage of the improvements :)

NOTE2: You will find the sepolicy patch option in the Boot Tools menu after unpacking the boot.img.

Thanks to [MENTION=4688377]russel5[/MENTION] for pointing me in the right direction and helping/testing to get the sepolicy patch and new set_metadata method working properly.

Thanks to [MENTION=357342]tobias.waldvogel[/MENTION] for the bootimg binary that allows patching sepolicy.
[SuperR Kitchen] Barthlon:
hi guys, i just installed virtualbox and the kitchen-ubuntu and everything seems to work ok. i opened up the kitchen, extracted a rom i got from samfirm, extracted it, deodexed it, zipaligned it and build a flashable zip. everything works fine so far!

i only got the error about ram, while trying to sign the zip. is it possible to appoint nearly all system ram to virtualbox? i've got 8 gb of ram and i guess i need approx. 7.5 gb to sign a 2gb zip, right? will my host (windows 10) be able to pull that off or are there any other concerns? :)

is there any guide here, that explains the different options / choices in the kitchen? and how to go through the menu, to build a basic rom?

my goal is a deodexed, zipaligned, twrp flashable zip of a (nearly stock, but a bit debloated) rom. the steps above i managed, but now i want to know:

1) how to add a custom kernel

2) how to root it properly (and do i need supersu or magisk?)

3) how to make sure the rom flashes without getting the rmm issue of a 7 day lockout :)

hopefully someone can help me out a bit. thank you guys!
[SuperR Kitchen] ale8530:
Thanks for providing solution lag OREO, but I still have some problems, if you see this logcat I do not know if you can help to understand

Logcat

Thanks
[SuperR Kitchen] narshi shukla:
Can someone help me to port roms, all the guides /tools are outdated or don't support Oreo.

U have tried almost every available guides and rom never boots. I doubt boot.img is not correctly porting.

I m porting oos based rom from op3 to zuk z2 plus which are very much similar in specs.

I also want to port latest stock miui which is Oreo based from Mi5 which is almost similar in every aspects to my device.

We already have oos based rom which is h2os on our device but it is nougat based and miui 9 which is also nougat based.

I m trying to use these roms as base rom but don't know what to edit what to replace.

Every guide have different tools mentiones and they extract in different way, some fails to repack boot.img or gives bootloops.

Thanks in advance
[SuperR Kitchen] bcrichster:
Advice? Replace the frameworks-res.
[SuperR Kitchen] SuperR.:
v1.1.8.6 (Free Bash version)

Changes:

Fixed skipping nonplat_file_contexts on Pixel style system.img causing failure when building ext4 img.

Show preparing files text after extracting system.img files.
[SuperR Kitchen] narshi shukla:
From where? Boot.img or system?

Is it enough to make it boot on my device?
[SuperR Kitchen] bcrichster:
Try looking in system/ framework/.. (For the framework-res.apk
[SuperR Kitchen] narshi shukla:
Thanks bro,

But first i need to modify boot.img to make this rom to boot on my device,

Can you help me in porting boot.img?
[SuperR Kitchen] bcrichster:
Nope, sorry. needs to go before you and kids lose everything-. Another thing to consider future, are the atrocities I travel in (my car, Lol)
[SuperR Kitchen] khanhesham:
where is this file so we can modify can you please elaborate steps in detail ?

stuck deodexing my xzs oreo rom..
[SuperR Kitchen] bcrichster:
I could be wrong but.. It kind of looks like something we add to a device tree before building. But in this case (referring to [MENTION=5787964]SuperR.[/MENTION] 'S kitchen) I'm thinking it may just be a build.prop addition. Not 100% sure atm, so please don't take my suggestion as a certainty.
[SuperR Kitchen] kevintm78:
I believe he's referring to the sepolicy file that is located in the ramdisk of your kernel. In my case I need to unpack the boot.img first to get to that file, but I'm still on 6.0.1.
[SuperR Kitchen] sumitr3ddy:
After making stock rom

Imei gone not working and

And apps not working automatic closing why ?
[SuperR Kitchen] :
Hey Guys.

So its fallen on me to provide a pre-modded stock rom for the LG V30. Ive been playing with Super R's Kitchen the last couple of days and I have some issues.

Logcat constantly puts out "xport_reg failed for service_id=0x35 version0x1001 on 19"

Using Set_Metadata creates 200 lines of blank "set_metadata("/", "uid", , "gid", , "mode", , "capabilities", , "selabel", "");"

Wi-FI does not work with set_perm perm type.

Id prefer to use Set_Metadata so I can quickly add to /system is need be.

Forgive me if im being thicker then the offspring of a village idiot and a TV weather girl.

Firmware Link
[SuperR Kitchen] SuperR.:
You linked to a ROM, not firmware. If you start with official firmware as your base (normally a system.img), you will get the correct set_metadata updater-script. The free kitchen uses AOSP file permissions and capabilities when building a system.img/sparse_dat roms like the one you linked. It is very likely any issues you have will be related to that. set_metadata is the best option for non-Google devices in the free kitchen.

I am not sure how you end up with blank set_metadata lines. If you are extracting from a system.img, It is possible you do not have python 3.5 or higher (required). You can check by typing "python3 -V" in a terminal.
[SuperR Kitchen] :
Sorry. Thought thats what you meant. This is a stock rom from a original KDZ that I extracted from the phone. I had the same logcat read out problem with Set_Perm as well as sparse_dat regardless of wifi not working. Python installed is 3.5.2

Does the donate version build things differently ? I was looking to get it for a while but ive been broke.
[SuperR Kitchen] SuperR.:
set_perm should not be used for anything above Android 4.3.

Did you extract it as a system.img from the phone? If so, the set_metadata permissions/capabilities should be good as they come directly from the system.img. The permissions are only pulled from the system.img when you extract it, and are stored in the 00_project_files directory (set_metadata and set_metadata1 files). If you deleted them and did not extract again they would not be generated again without extracting and something could get messed up. Additionally, I only test in 64-bit Ubuntu 16.04.3 so if you use anything else I would not be able to help much. If you are not picky about your OS, you could try one of the kitchen ready distros linked in my signature.

The donate version builds system.img/sparse_dat with the permissions/capabilities from the original system.img.
[SuperR Kitchen] :
Yes I extracted as a system IMG in newly setup Linux Mint VMWares which I had to setup twice both times had the same results. . I'll look at the project files tomorrow to see what they say. I haven't deleted anything since this 2nd extraction.
[SuperR Kitchen] Barthlon:
guys, is there anyone that can help me out here? let's rephrase the stuff above:

i've got the kitchen in ubuntu all set up and working. a first run worked out fine, except for signing, so i'll skip that in the future.

what i want is to:

get an official oreo rom from samfirm for s8 (including bootloader, baseband, etc)

add to kitchen and extract it (so far i can manage)

add

custom

kernel

making sure the kernel will work on rooted/unlocked devices (i think most of the custom kernels have all the verity and permission stuff already incorporated, so i don't have to take action here, but i'm not sure)

add latest twrp

add root with SuperSU (and install the app?)

add busybox (no app needed/wanted)

remove some bloat i don't want by removing apk's/files (i think i can manage this ;))

get it set on a generic csc or a csc of my choice

deodex it all

zipalign it all

pack up as a twrp flashable zip (and force it to wipe / clean flash on install)

what are the steps to take here? is there any other stuff that i have to do/take into account while building the rom?

i've been looking all over, but i can't find a guide/tutorial that explains the different steps to take in the kitchen.

thanks so much
[SuperR Kitchen] Barthlon:
hmmm, at one pc everything worked fine. now i try to set up another machine and i get nearly the same error as this guy, while extracting the rom. boot and cache go ok, but system fails. i did a refresh of the kitchen and installed the latest git-lfs, but this didn't solve it. now i'm redownloading the firmware, to see if it was a bad download, but i think it isn't.

it's this firmware (https://updato.com/firmware-archive-select-model?record=262505861DD011E89F15FA163EE8F90B)

any clues?
[SuperR Kitchen] :
Ok so the set_metadata files are both blank lines as well

set_metadata_recursive("/", "uid", , "gid", , "dmode", , "fmode", 0644, "capabilities", , "selabel", "");
set_metadata_recursive("/", "uid", , "gid", , "dmode", , "fmode", 0755, "capabilities", , "selabel", "");
set_metadata("/", "uid", , "gid", , "mode", , "capabilities", , "selabel", "");
set_metadata("/", "uid", , "gid", , "mode", , "capabilities", , "selabel", "");
set_metadata("/", "uid", , "gid", , "mode", , "capabilities", , "selabel", "");
set_metadata("/", "uid", , "gid", , "mode", , "capabilities", , "selabel", "");
set_metadata("/", "uid", , "gid", , "mode", , "capabilities", , "selabel", "");