The command line options for Linux/WSL/WSL2/Mac are a result of all the requests for a way to build img files outside of the kitchen. Now there is a way to do exactly this and more.
This post will be updated as features/commands are added or changed. The example commands below will work with the latest version of the kitchen.
If you have problems, make sure you are fully updated.
If something works in the kitchen but does not work in the CLI, please post about it in this thread.
If something does not work in the kitchen and does not work in the CLI, please post in the main kitchen thread.
Command Line Examples:
Unpack img file
Code:
$ /path/to/kitchen/superr -f unpack_img system.img -p superr_project-name
Pack img file
Code:
$ /path/to/kitchen/superr -f pack_img system.img raw -p superr_project-name
$ /path/to/kitchen/superr -f pack_img system.img sparse -p superr_project-name
$ /path/to/kitchen/superr -f pack_img system.img dat -p superr_project-name
$ /path/to/kitchen/superr -f pack_img system.img lz4 -p superr_project-name
Unpack super.img
Code:
$ /path/to/kitchen/superr -f unpack_super super.img -p superr_project-name
Pack super.img
Code:
$ /path/to/kitchen/superr -f pack_super system_new.img vendor_new.img product_new.img raw -p superr_project-name
$ /path/to/kitchen/superr -f pack_super system_new.img vendor_new.img product_new.img sparse -p superr_project-name
$ /path/to/kitchen/superr -f pack_super system_new.img vendor_new.img product_new.img dat -p superr_project-name
$ /path/to/kitchen/superr -f pack_super system_new.img vendor_new.img product_new.img lz4 -p superr_project-name
Deodex
Code:
$ /path/to/kitchen/superr -f deodex -p superr_project-name
Remove dm-verity
Code:
$ /path/to/kitchen/superr -f dmverity -p superr_project-name
Remove forceencrypt
Code:
$ /path/to/kitchen/superr -f forcee -p superr_project-name
Reserved
amazing, thank you!
Want to thank you for this. Awesome !!!
Thank you
PLZ HELP
I am trying to unpack stock rom for moto g play 2021 (C:\Users\Code3p0\Downloads\XT2093-3_GUAMNA_BOOST_11_RZA31.Q2-146-14-6_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip)
super.img_sparsechunk.0
cannot upload rom to Kitchen
cannot unpack due to errno 2 (file not found no such file system.img)
hi, good move.
adding plugins options via cli will be appeciated
Related
I *think* I got this to work, but someone with less n00b should verify.
Code:
'find your header
grep -a -b --only-matching $'\x1f\x8b\x08\x00' < zImage
'use your header value
dd bs=1 if=zImage skip={your number} | gzip -d -c > initramfs.cpio
'extract
sudo cpio -i --no-absolute-filenames < ../initramfs.cpio
I did compile this into a new zImage, but it made no difference, still looping samsungs..
This method (not mine) also works, but generates a file list. You should be able cpio out the files with minor adjustments.. credit to skeeterslint for this.
Code:
grep -a -b --only-matching `perl -e'print "\x1F\x8B\x08"'` zImage
dd if=zImage bs=1 skip=#fromsteponehere | gunzip > Image
grep -a -b --only-matching `perl -e'print "\x1F\x8B\x08"'` Image
dd if=Image bs=1 skip=#fromstep3goeshere | gzip -d -c | cpio -t
How to copy device files from a folder (src) to proprietary/ and have the blobs build. ????
(I really dont want to connect my device to the pc all the time!)
I have my device (Rom files) in the folder: src
My device tree is in: home/ICS/device/YG/m805_892x/
This is what i have sow far now. Well what i found and changed a bit:
#!/bin/sh
if [ $# -lt 1 ]
then
echo "Usage:" $0 "<Source>"
exit
fi
SOURCE=$1
VENDOR=YG
DEVICE=m805_892x
rm -r ../../../device/$VENDOR/$DEVICE
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary
# Pull needed standard libs voorbeeld:
cp -a $SOURCE/system/lib/libaudio.so ../../../device/$VENDOR/$DEVICE/proprietary
cp -a $SOURCE/system/lib/libaudiopolicy.so ../../../device/$VENDOR/$DEVICE/proprietary
#and sow on.
./setup-makefiles.sh
Any one?
Well i got something working. Here a small example of my copy-files.sh
#!/bin/sh
VENDOR=YG
DEVICE=m805_892x
#MANUFACTURER=YG
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/bin
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/etc/bluetooth
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/etc/dhcpcd
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/etc/permissions
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/etc/ppp
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/etc/ril
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/etc/wifi
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/fonts
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/framework
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/lib/egl
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/lib/hw
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/lib/modules
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/media/audio/alarms
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/media/audio/notifications
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/media/audio/ringtones
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/media/audio/ui
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/usr/idc
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/usr/keychars
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/usr/keylayout
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/usr/share/zoneinfo
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/usr/srec/config/en.us/dictionary
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/usr/srec/config/en.us/g2p
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/usr/srec/config/en.us/grammars
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/usr/srec/config/en.us/models
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/vendor/lib/egl
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/vendor/lib/hw
mkdir -p ../../../device/$VENDOR/$DEVICE/proprietary/wifi
cp -a src/lib/libril.so ../../../device/$VENDOR/$DEVICE/proprietary/lib/libril.so
cp -a src/key_921600.psr ../../../device/$VENDOR/$DEVICE/proprietary/key_921600.psr
cp -a src/key_3000000.psr ../../../device/$VENDOR/$DEVICE/proprietary/key_3000000.psr
cp -a src/ts.conf ../../../device/$VENDOR/$DEVICE/proprietary/ts.conf
cp -a src/bin/bugmailer.sh ../../../device/$VENDOR/$DEVICE/proprietary/bin/bugmailer.sh
cp -a src/bin/busybox ../../../device/$VENDOR/$DEVICE/proprietary/bin/busybox
cp -a src/bin/chkntfs ../../../device/$VENDOR/$DEVICE/proprietary/bin/chkntfs
cp -a src/bin/flash_eraseall ../../../device/$VENDOR/$DEVICE/proprietary/bin/flash_eraseall
cp -a src/bin/hostapd ../../../device/$VENDOR/$DEVICE/proprietary/bin/hostapd
cp -a src/bin/hostapd_cli ../../../device/$VENDOR/$DEVICE/proprietary/bin/hostapd_cli
cp -a src/bin/hostapd_wps ../../../device/$VENDOR/$DEVICE/proprietary/bin/hostapd_wps
cp -a src/bin/iptables ../../../device/$VENDOR/$DEVICE/proprietary/bin/iptables
cp -a src/bin/iwconfig ../../../device/$VENDOR/$DEVICE/proprietary/bin/iwconfig
cp -a src/wifi/wlan.ko ../../../device/$VENDOR/$DEVICE/proprietary/wifi/wlan.ko
./setup-makefiles.sh
my copy-files.sh
I've read several tutorials both here and elsewhere. I've got a few different methods down using mkbootimg, unpackbootimg, abootimg, the perl scripts, and I have gzip/gunzip/cpio commands down. Splitting and repacking go without errors.
However, I cannot, to save my life, whether I modify something or not, get a boot image that I split and repacked to boot on my device.
I have a G4 H811 the T-Mobile variant. I have been playing with boot images and kernels included with ROMs and a custom kernel, even dd'd the working boot partition from my device. I simply cannot repack something that boots.
Here's an example approach, here I'm using binaries from a custom kernel zip mkbootimg, unpackbootimg, and the busybox included in the zip. I'm doing exactly what the kernel maintainer does to split the image, replace zImage and repack, only manually in a terminal and modifying the ramdisk leaving everything else alone.
mkdir boot
cd boot/
cat /dev/block/bootdevice/by-name/boot >boot.img
chmod 755 busybox
chmod 755 mkbootimg
chmod 755 unpackbootimg
./unpackbootimg -i boot.img
mkdir initrd
cd initrd
cat ../boot.img-ramdisk.gz | ../busybox gunzip | ../busybox cpio -vid
vi init.rc(made changes)
../busybox find . | ../busybox cpio -o -H newc | ../busybox gzip >../myinitrd.img
cd ..
./mkbootimg --kernel boot.img-zImage --ramdisk myinitrd.img --cmdline "$(cat boot.img-cmdline)" --base 0x$(cat boot.img-base) --pagesize 4096 --ramdisk_offset $(cat boot.img-ramdiskoffset) --tags_offset $(cat boot.img-tagsoffset) --output myboot.img
./busybox dd if=myboot.img of=/dev/block/bootdevice/by-name/boot
I end up with with a 26.8MB myboot.img and a bootloop
Here's a really good example, I changed absolutely nothing. After unpacking and repacking I end up with two different size boot images. What am I missing here?
Hey Guys,
i got a broken Tolino Vision 3 HD from a friend to fix the issues with the android. It´s a popular ebook reader in Germany.
At the moment I got the device it stuck in language selection and the partition for the ebooks wasn´t shown after USB connection.
So I downloaded the new software version from the vendor "mytolino" (I am not allowed to post urls). I tried to update via
fastboot update
Click to expand...
Click to collapse
but i got this error:
archive does not contain 'android-info.txt'
error: update package '..\update.zip' has no android-info.txt
Click to expand...
Click to collapse
. So I unpack the .zip and try to flash the images manualy. This didn´t work. After this is tried to copy the update.zip to /sdcard via adb push but this didn´t work, too.
Question:
Is there any way to flash the device with the given update.zip?
Regards and all good wishes from sunny Germany
Did you tried to do factory reset? Are you able to boot into recovery using key-combination?
The more heavy way I used yesterday to reanimate my Tolino page after trying to install OpenGapps on them (no, did not work oO).
I am not allowed to post URL's because of "Noob-Protection" in Forum. There is a "Tolino Vision 2 rooten" howto in web. Some parts of them you can use to solve your problem.
1. Create own ADB-Enabled custom recovery (Did worked for me only with 10.0.1 update package). Should be done on Linux
Code:
$ mkdir custom_recovery
$ cd custom_recovery
$ unzip ../update.zip recovery.img
$ mv recovery.img recovery.img.orig
$ abootimg -x recovery.img.orig
$ mv initrd.img initrd.img.orig
$ mkdir initrd
$ cd initrd
$ zcat ../initrd.img.orig | cpio -vid
Adjust default.prop with values "ro.secure=0", "ro.debuggable=1" und "persist.sys.usb.config=mass_storage,adb".
Code:
$ find . | cpio --create --format='newc' | gzip > ../initrd_adb_enabled.img
$ cd ..
$ abootimg --create recovery_adb_enabled.img -f bootimg.cfg -k zImage -r initrd_adb_enabled.img
You get error : "updated is too big for the Boot Image" with new size value. Calculate this value to hexadecimal and adjust the "bootsize" in "bootimg.cfg" to hex-value
Do abootimg again.
2. Use the custom recovery to trigger update manually
Code:
$ fastboot boot ../custom_recovery/recovery_adb_enabled.img
$ adb shell
# mount -t vfat /dev/block/mmcblk0p4 /sdcard/
# exit
$ adb push update.zip /sdcard/update.zip
$adb shell
# cd /sdcard
# busybox unzip update.zip META-INF/com/google/android/update-binary -d /tmp
# busybox chmod u+x /tmp/META-INF/com/google/android/update-binary
# /tmp/META-INF/com/google/android/update-binary 3 1 /sdcard/update.zip # Update installieren
# sync && sleep 5 && sync # sicherheitshalber, wenn man dran glaubt
# reboot
Source: google for "e-reader-forum Toolino vision 2 rooten"
I'm looking for a way to transfer files with the correct permissions over adb. I can create a tarball and push it to my phone on the fly but for some reason I can't extract it without creating a temporary file. What I mean is that
Code:
tar -c file | adb exec-in 'cat > /file.tar' && adb shell 'tar -xf /file.tar -C dir'
works but
Code:
tar -c file | adb exec-in 'tar -xf - -C dir'
doesn't. Actually, it does but not all files are transferred over. Am I missing out on something?
@Ciren__
adb exec-out and/or adb exec-in
writes/reads to/from only files
I've used this:
Bash:
tar czplf - --acls --selinux --xattrs --numeric-owner -C /mnt/tmp/ data/com.android.messaging | adb exec-in tar -f - -x -p -z -v -C /data
... to restore an app from a whole partition image backup (mounted with `kpartx` and `mount -t ext4 -o ro,noload`).
I'm not sure if all those flags are actually needed, but that was my first guess at something which I thought would work.