[EOL] [KITCHEN] ArchiKitchen - Android Kitchen [Linux]

Search This thread

linuxiano85

Senior Member
Mar 11, 2014
117
15
Casoria/Napoli
I did a search on "SElinux" and I've seen the results, but I did not understand what to do to solve.
Guide me to specific thread.

Sent from my GT-I9301I using XDA Free mobile app
 

Darkman

Inactive Recognized Developer
Jan 16, 2012
974
3,023
Germany
Hi @JustArchi i make many ROMs with your kitchen without any problems.

No i make the first steps with lollipop firmware. The ROM is working but i have trouble with the Root access.
After the first boot i must update the su binary manuell. . . . This works but how can i update the binary in the ROM so that the users not must make the binary update?

I have try to update the su to latest version 2.46 but this have the same effect.

Any idea?
 

Alan-B

Senior Member
May 6, 2006
1,202
1,279
73
WAVRE
Hello,

Thank you for this kitchen, but!
I have just tested the version of the 1/10/2015 under cygwin,
All functions well but the boot.img is not good and the META-INF does not install the zip.
Does y have to you it a solution for the META-INF??
NB: On Rom 4.4.2 Note 2 2014

Thank you in advance

(Beginning of updater-script)

show_progress(0.1, 0);
format("MTD", "system");
mount("MTD", "system", "/system");
package_extract_file("check_data_app", "/tmp/check_data_app");
set_perm(0, 0, 0777, "/tmp/check_data_app");
run_program("/tmp/check_data_app");
mount("MTD", "userdata", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
package_extract_dir("system", "/system");
symlink("dumpstate", "/system/bin/dumpcrash");
set_perm(0, 0, 0755, "/system/xbin/busybox");
run_program("/system/xbin/busybox", "--install", "-s", "/system/xbin");
symlink("/system/xbin/busybox", "/system/bin/busybox");
symlink("debuggerd", "/system/bin/csview");
symlink("dumpstate", "/system/bin/dumpcrash");
symlink("libGLESv2.so", "/system/lib/libGLESv3.so");
symlink("logcat", "/system/bin/lolcat");
symlink("mksh", "/system/bin/sh");

where is the error ??
 

manojpy

Senior Member
Jun 11, 2012
737
558
Pune
Hello,

Thank you for this kitchen, but!
I have just tested the version of the 1/10/2015 under cygwin,
All functions well but the boot.img is not good and the META-INF does not install the zip.
Does y have to you it a solution for the META-INF??
NB: On Rom 4.4.2 Note 2 2014

Thank you in advance

(Beginning of updater-script)

show_progress(0.1, 0);
format("MTD", "system");
mount("MTD", "system", "/system");
package_extract_file("check_data_app", "/tmp/check_data_app");
set_perm(0, 0, 0777, "/tmp/check_data_app");
run_program("/tmp/check_data_app");
mount("MTD", "userdata", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
package_extract_dir("system", "/system");
symlink("dumpstate", "/system/bin/dumpcrash");
set_perm(0, 0, 0755, "/system/xbin/busybox");
run_program("/system/xbin/busybox", "--install", "-s", "/system/xbin");
symlink("/system/xbin/busybox", "/system/bin/busybox");
symlink("debuggerd", "/system/bin/csview");
symlink("dumpstate", "/system/bin/dumpcrash");
symlink("libGLESv2.so", "/system/lib/libGLESv3.so");
symlink("logcat", "/system/bin/lolcat");
symlink("mksh", "/system/bin/sh");

where is the error ??
Check OP post 3, - Question : Is cygwin supported?

Zephyr v4, G900H
 

JustArchi

Inactive Recognized Developer
Mar 7, 2013
8,739
38,807
Warsaw
Hi @JustArchi i make many ROMs with your kitchen without any problems.

No i make the first steps with lollipop firmware. The ROM is working but i have trouble with the Root access.
After the first boot i must update the su binary manuell. . . . This works but how can i update the binary in the ROM so that the users not must make the binary update?

I have try to update the su to latest version 2.46 but this have the same effect.

Any idea?

In Lollipop many things have changed regarding root. AK doesn't work (yet) with all available quirks, SELinux and other awful things Google decided to implement.

I'll probably fix it sooner or later, but at the moment, sorry.
 
  • Like
Reactions: Darkman

carl1961

Senior Member
Dec 5, 2010
7,521
6,201
Tickfaw
Hi @JustArchi i make many ROMs with your kitchen without any problems.

No i make the first steps with lollipop firmware. The ROM is working but i have trouble with the Root access.
After the first boot i must update the su binary manuell. . . . This works but how can i update the binary in the ROM so that the users not must make the binary update?

I have try to update the su to latest version 2.46 but this have the same effect.

Any idea?

@Darkman the way I do it is let my rom update, then I do a backup and then unpack my TWRP backup and then copy the updated files to the new rom

/system/app/Superuser.apk
/system/bin/.ext,
/system/etc/init.d/99SuperSUDaemon ,
/system/etc/.has_su_daemon, .installed_su_daemon,install-recovery.sh ,
/system/xbin/daemonsu,su,sugote,sugote-mksh,supolicy

Code:
CYGWIN Unpacking TWRP Backup Files

rename:
data.ext4.win to data.ext4.win.tar
system.ext4.win000 system.ext4.win000.tar
system.ext4.win001 to system.ext4.win001.tar

Make a directory in your CYGWIN Home [Username]folder
Example: untar

Use Windows File Explorer go to your CYGWING Home
C:\cygwin\home\carl (your user name will be here)
make any folder you choose
Example:
C:\cygwin\home\carl\untar
and C:\cygwin\home\carl\untar\data ( for data files)

put your renamed data files in a folder named  data
C:\cygwin\home\carl\untar\data (this is to keep files separate when unpacked)

While in Explorer put your renamed system files in untar folder

start CYGWIN ( Use the Cygwin Terminal and then you can copy and paste these commands)
cd to untar folder
example:
cd\untar 
do these commands one at a time, it will extract to a folder named system

tar -xvf  system.ext4.win000.tar
tar -xvf  system.ext4.win001.tar

cd to data

do this command
tar -xvf   data.ext4.win.tar

all your data files will extract

Copy your renamed system files to untar folder

cd to untar

Code:
Extracting files from CWM backup's carl1961 UrDroid

I made bat files to do the job easier

copy your backup files to your computer
copy these bat files to backup folder
edit the bat file if you have more files to combine
double click the bat file
use 7-zip to unpack the tar file

example:
From windows CMD promt ( typing by hand)

type without "" 

"type system.ext4.tar.a system.ext4.tar.b system.ext4.tar.c >> system.ext4.tar"

type file1 file2 file3 file4 file5 >> your_final_file.tar
*******************************************

Galaxy note 3 clockworkmod recovery files (Urdroid)

type data.ext4.tar.a  >> data.ext4.tar

type cache.ext4.tar.a  >> cache.ext4.tar

type system.ext4.tar.a system.ext4.tar.b  >> system.ext4.tar



Where  I Learn this:

source: XDA @ yasir.97
http://xdaforums.com/showthread.php?t=2194171
 

Attachments

  • Extracting_files_form_CWM_backup's.zip
    1.4 KB · Views: 68
Last edited:
  • Like
Reactions: Darkman

Darkman

Inactive Recognized Developer
Jan 16, 2012
974
3,023
Germany
@Darkman the way I do it is let my rom update, then I do a backup and then unpack my TWRP backup and then copy the updated files to the new rom

/system/app/Superuser.apk
/system/bin/.ext,
/system/etc/init.d/99SuperSUDaemon ,
/system/etc/.has_su_daemon, .installed_su_daemon,install-recovery.sh ,
/system/xbin/daemonsu,su,sugote,sugote-mksh,supolicy

@carl1961 Thank you for your help!! I give it a try.. but why you are going this way over unpack the TWRP Backup? Should it not works if i just copy this files from the Device after Binary Update?
 

bigrammy

Senior Member
Apr 8, 2011
2,962
2,592
huddersfield
@carl1961 Thank you for your help!! I give it a try.. but why you are going this way over unpack the TWRP Backup? Should it not works if i just copy this files from the Device after Binary Update?

Look here http://su.chainfire.eu/ Section 6 covers custom roms and a link to his reposatory for the latest binarys.
If you look in his SU installer zip you will find it's more than the average update zip and runs checks to see which binary to install and where to install it :eek:
 

Darkman

Inactive Recognized Developer
Jan 16, 2012
974
3,023
Germany
Look here http://su.chainfire.eu/ Section 6 covers custom roms and a link to his reposatory for the latest binarys.
If you look in his SU installer zip you will find it's more than the average update zip and runs checks to see which binary to install and where to install it :eek:

Thanks for this Link! So on the Webpage from Chainfire is a solution that would be very easy in the handling.
@bigrammy found this on the homepage from chainfire.eu (link below).

So Added this lines to your update-script:
Code:
[B]# last thing the script should do[/B] [B][COLOR="Blue"]## I placed this after Kernel flashing[/COLOR][/B]
ui_print("Installing SuperSU ...");
package_extract_dir("supersu", "/tmp/supersu");
run_program("/sbin/busybox", "unzip", "/tmp/supersu/supersu.zip", "META-INF/com/google/android/*", "-d", "/tmp/supersu");
run_program("/sbin/busybox", "sh", "/tmp/supersu/META-INF/com/google/android/update-binary", "dummy", "1", "/tmp/supersu/supersu.zip");
ui_print("SuperSU installed");

now make folder like "supersu" in your ROM ZIP and placed there the latest SuperSU Zip and rename it in supersu.zip.

Now the Script flash the SuperSU, Root and Update to the latest su binary. That it is.... and if Chainfire release a new Version you must only replaced the supersu.zip. Works on my S4 Active with Android 5.0.1

Here is a Example ZIP from Chainfire. (Replace the supersu.zip to the latest!!!)

I think this is a good solution until JustArchi have more time again and can update the kitchen :good:
 
Last edited:
  • Like
Reactions: carl1961 and Dzepar

bigrammy

Senior Member
Apr 8, 2011
2,962
2,592
huddersfield
Thanks for this Link!
Hi,
I did not post the full details and method for a reason bro :rolleyes:
People will now be less inclined to visit chainfire's web site which means he gets less hits and considering all he has done for developers the least we can do is send people over so he gets the hits :rolleyes::rolleyes:

---------- Post added at 02:18 AM ---------- Previous post was at 02:08 AM ----------

I have already working SuperSU integration on my LP AD, but I'm not sure if it still works on SELinux enforcing, we use permissive.

Everything in your Kitchen works 100% for me bro :good:
I had read some place about certain devices encountering problems and I saw in the suupdate.zip he had made provision for different device's
So thats why I shared the info.
 
  • Like
Reactions: Darkman and manojpy

tdotdot

Senior Member
Dec 18, 2012
386
100
I used the kitchen to create a zip file of touchwiz 4.4.2 for my s3. Everything works except that when I restart after flashing, I can't go into recovery anymore (it says booting into recovery but then goes straight into the operating system, have to reinstall twrp through odin to get recovery back) and my wifi doesn't work. I've narrowed it down to my boot.img that's messed up. Can somebody tell me what I'm doing wrong? I haven't modded anything else. I'm on a d2can s3. Thanks for any help.
 

carl1961

Senior Member
Dec 5, 2010
7,521
6,201
Tickfaw
Look here http://su.chainfire.eu/ Section 6 covers custom roms and a link to his reposatory for the latest binarys.
If you look in his SU installer zip you will find it's more than the average update zip and runs checks to see which binary to install and where to install it :eek:

correct, and that why in my previous post I mensiond using the files after sypersu installer installed , so I know I have the correct files for superSU, but also in the past there was a time when SuperSU did a binary update almost weekly and the latest update had extra new files in xbin

But I see @Darkman has posted a much easier way to get latest
 
Last edited:
  • Like
Reactions: Darkman

Top Liked Posts

  • There are no posts matching your filters.
  • 283
    kitchen.png


    ArchiKitchen - Brand new Android Kitchen

    Commits/Changes -> https://github.com/JustArchi/ArchiKitchen/commits/master
    Source -> https://github.com/JustArchi/ArchiKitchen
    TODO list -> https://github.com/JustArchi/ArchiKitchen/issues?state=open

    Download. Of course you can also clone my repository to stay up to date.
    109
    [SIZE="+1"]Features:[/SIZE]
    • Compatible with every Linux, which provides bash shell (every available distro nowadays)
    • Full ARM/X86 support for all included android binaries (Root, Busybox)
    • Dynamic permissions - A generic list of all available permissions, with proper filter for your local build and device
    • Dynamic symlinks - A generic list of all available symlinks, with proper filter for your local build and device. Additionaly if you're building from stock image, support for including symlinks from image itself, which results in best 1:1 copy
    • FS-friendly method of flashing - ROMs created with ArchiKitchen are fully compatible with every available partition, which means that they don't reformat /system partition during flashing. This is extremely important for dual-FS support for example for EXT4 and F2FS on SGS3.
    • Kernel repacking - Powered by mkbootimg, repacking a kernel never was easier. With one click you're extracting the kernel along with ramdisk to the proper folder, and with the second you repack it back
    • Deodexing - With one click you can easily deodex your whole ROM. With multi-threaded process and automatic API detection, this never was easier as well.
    • ArchiDroid Init.d - Forget about relying on kernel's ramdisk. Implement init.d in your ROM, not the kernel!
    • Latest [Bak]smali
    • Latest SuperSU
    • Latest Busybox
    • Latest Zipalign
    • And many more in the unique shell ktichen

    [SIZE="+1"]Credits:[/SIZE]
    @osm0sis - For mkbootimg
    @Chainfire - For SuperSU
    @Stericson - For BusyBox
    @JesusFreke - For [Bak]smali
    @bgcngm - For MTK-Tools
    AOSP - For Zipalign
    64
    ArchiKitchen Tutorial

    Part 1 - Setting up Linux & ArchiKitchen on Windows

    By watching above step-by-step video, you'll learn:
    1. How to install Debian on your VirtualBox machine
    2. How to connect Windows with Linux through a shared VBox folder
    3. How to install ArchiKitchen
    4. How to create your first custom ROM, with built-in Root and Busybox

    Extra information:
    - You can use any virtualization method you want. I suggest using VirtualBox, as it's very easy, flexible and free virtualization solution.
    - You can use nearly any Linux distro. I suggest either Debian or Ubuntu, as both of them have excellent support and are very easy to install and use, compared to some other ones. However if you feel fine in Linux environment, you can install nearly any distro you like.

    Mini.iso link
    Weekly Debian Testing.iso link
    Installing virtualbox additions: apt-get install virtualbox-guest-dkms
    Installing required tools: apt-get install zip unzip openjdk-7-jdk
    Mounting a shared VBox folder: mount -t vboxsf yourName /path/to/yourFolder


    Tutorials made by other developers: @bigrammy
    Part 1. Prepare for linux Installation https://www.youtube.com/watch?v=aDsQTcDvSMY
    Part 2. Install Linux (Ubuntu/Zorin) https://www.youtube.com/watch?v=KwnIjCXXM5Y
    Part 2.5. Edit Winows bootloader to boot Linux: https://www.youtube.com/watch?v=gNpQucQxcFQ
    Part 3. Work as Root Mod & Install ArchiKitchen https://www.youtube.com/watch?v=T_ad7uML8QM
    Part 4. How to add your device locally to the Kitchen: http://youtu.be/YXNDcmf6GhI


    ArchiKitchen Questions & Answers

    Q: What is this "ArchiKitchen"?
    A: A Linux-based kitchen, with a main objective of converting stock ROM drops in .img, .tar.md5 or similar formats to CWM-flashable .zip.

    Q: So I can create my own custom ROM based on stock ROM with it?
    A: Exactly.

    Q: Is it for Linux only? Why windows is not supported?
    A: Let's face it, Android is based on Linux kernel and we could call it a mobile UNIX fork. It's hard to work with Linux-based things on Windows, in fact, Windows doesn't even offer Bash (Bourne-again shell), which is absolutely core for ArchiKitchen. Working with windows is painful, for example - .img mounting. I can very easily mount any filesystem image on Linux with just one command, while doing so on Windows usually requires a massive convertion of whole image to .zip file, then extracting a single files. Also, Windows doesn't support symbolic links, and this makes it impossible to create 1:1 copy of the image "translated" to zip file. Therefore, making a Windows port would require lots of more work and solving issues, and even with that it would still cause some core features to be unavailable. However, launching Linux on Windows is very easy thanks to VirtualBox and other virtualization software, so you don't need to reformat your PC or stick purely with Linux. In fact, this is the proposed way of using ArchiKitchen - Installing a native Linux distro (suggested: Debian or Ubuntu) and then installing ArchiKitchen on it. Take a look at tutorial to see how easily you can install and run ArchiKitchen in Linux VBox.

    Q: Is Cygwin supported?
    A: No. Cygwin IS NOT supported and it's not planned to add such support. Reason is nearly the same as above one. However, ArchiKitchen is open-source project and I'm open for all pull requests, so perhaps somebody will add support for Cygwin in the future. Until then, ArchiKitchen is compatible ONLY with Linux, and if you use it on Cygwin you're on your own with the issues that may happen.

    Q: Which phones are supported?
    A: ArchiKitchen contains a local "database" of devices, which includes a kernel/modem blocks to be used. However, as long as you know the partition layour of your device (kernel block), ArchiKitchen works with every phone and every Android variant. I'm trying to make it as universal as possible, so even if your device does not exist in our local database, it should work.

    Q: How can I add my own phone to the local database?
    A: If it doesn't exist yet, take a look at "product" folder. Inside you can notice various devices with name based on their models. ArchiKitchen will detect your ROM's model and check inside if it exists, if it does, then some properties for this model will be loaded, if it doesn't exist, then ArchiKitchen will ask user for them. Probably the best idea is to copy one of the already available models (for example "m0" - Samsung Galaxy S3), then rename new copied folder to your model name and finally edit files inside.

    Q: What is "NULL" text found for example in some MODEM files in the database?
    A: Some phones have a possibility to flash modem directly from CWM, others don't. "NULL" text indicates that this model does not support flashing modem.bin, so even if ArchiKitchen finds and recognizes it, it will pop up an error telling you that it unfortunately can't be used.

    Q: Where is SYSTEM block?
    A: System block is not being used at all, as it's a valid partition and should be located in "fstab" file in recovery already. ArchiKitchen mounts system automatically through "mount" binary, with automatic filesystem and /system path. I consider providing a system block as something obsolete, because it's only required when you're formatting a partition, and even during flashing, a wipe - delete_recursive() function is enough. Therefore, ArchiKitchen does NOT require providing a /system block.


    ArchiKitchen Troubleshooting

    Q: It looks like something is wrong with zipalign command. I can notice errors like "./zipalign: No such file or directory"
    A: This is because zipalign is x86 binary (32-bit), while you have amd64 (64-bit) Linux. Therefore, we must install some missing core packages to properly support x86 binaries. This will do the trick:
    Code:
    apt-get install lib32stdc++6 lib32z1
    42
    [SIZE="+1"]ArchiDroid Init.d[/SIZE]
    ArchiDroid Init.d is an innovative method for including init.d support in the ROM itself, and not in the kernel. ArchiKitchen supports adding ArchiDroid Init.d to any Android ROM.

    ArchiDroid Init.d is based on two files. A core - debuggerd hook, and a check part - simple init.d script.

    Init.d script is named 00ARCHIDROID_INITD, and it only creates a special file to notify the core that init.d has been already executed, therefore it can't conflict with anything and it's completely safe.

    The core is a hook for special /system/bin/debuggerd binary, which is normally called once during initial boot. Therefore, when it's called, ArchiDroid Init.d firstly waits a specified amount of time (default: 5 seconds), in case if user has already a kernel with init.d support. This is required because otherwise all init.d scripts would be executed twice - by kernel and our init.d. After specified time, if init.d is still not executed, our hook executes all scripts in alfabetical order. Lastly, when we're done, hook is executing original debuggerd binary (default: debuggerd.real) and shares the environment, arguments and everything. This is a perfect method for implementing init.d in the ROM itself, because we don't need to trust the kernel that it supports and executes init.d properly. We give it a 5 seconds to execute it, and eventually we do the job if kernel is not interested in that. This way we can support both custom kernels with native init.d support (we wait initial delay, if kernel executes init.d, all is fine and we don't have to do so), and also pure stock kernels without init.d support (we wait initial delay, kernel doesn't care about init.d, so we're executing it).

    I think that such hook works far better than relying on the kernel and modyfing stock ramdisks. Also we're sure that even if user changes kernel to any custom one, we still have reliable init.d support, regardless if custom kernel supports init.d or not.