system_new.img & vendor - SuperR Kitchen

hi, i have 2 problems:
1. when i choose system.img to extract superr change the original filename to system_new.img before the extraction.
(ver 3.2.2.1 via wsl2)
2. after i extract vendor.img, how do i repack it. the superr give only the system folder.
thank you!!

Related

[Q] Moding ramdisk

Hello guys, I have a small problem,
I wanted to change logo in ramdisk (unlocked bootloader kernel), but after everything I got black screen after trying to boot device (vibra and then black screen)
There is list what I do, maybe someone will find mistake:
1. Unpacked ftf via 7zip -> got kernel.sin and loader.sin
2. Unpacked kernel.sin via unpack-kernelsin.pl
3. Unpacked ramdisk via 7-zip
4. Renamed unpacked ramdisk to ramdisk.cpio (moved to tmp dir)
5. cpio -i -F ramdisk.cpio (in tmp dir)
6. Replaced logo and moved ramdisk.cpio to ../
7. Executed command in tmp dir: cpio -i -t -F ../ramdisk.cpio | cpio -o -H newc -O ../ramdisk_new.cpio
8. Renamed folder with new ramdisk to ramdisk~
9. Packed it via 7zip (gz,Ultra)
10. Moved to sintools and renamed gz file to ramdisk
11. Moved kernel.sin-kerne (from unpacking kernel via unpack-kernelsin.pl), and renamed it to image
12. Executed example_build.cmd from sinTools
13. Moved to flashtool, maked bundle
14. Flashed
15. Black screen : /
If someone can help, I'll be glad

HELP! with Android Kitchen by Ketut

Code:
Galaxy Ace Android Kitchen
1.- Download the kitchen from here.
2.- Copy system.rfs and CF-Root-S5830's boot.img (for ext4 filesystem support) to the kitchen's original_update folder, rename system.rfs to system.img.
3.- Open up a terminal window, change to the folder containing the kitchen.
4.- Start up the kitchen by typing: ./menu
I want to start creating a rom using the manual Ketut, but I have a doubt over 3, indicates that you have to open a terminal window, but refers to the normal window of win7 or cygwin? win7 on the window did not recognize the command ./menu, which is not a valid file and cygwin does not allow me to enter the kitchen folder, and if anyone can guide me what are the right steps in this option were very grateful thank you!
tazlooney89 said:
Code:
Galaxy Ace Android Kitchen
1.- Download the kitchen from here.
2.- Copy system.rfs and CF-Root-S5830's boot.img (for ext4 filesystem support) to the kitchen's original_update folder, rename system.rfs to system.img.
3.- Open up a terminal window, change to the folder containing the kitchen.
4.- Start up the kitchen by typing: ./menu
I want to start creating a rom using the manual Ketut, but I have a doubt over 3, indicates that you have to open a terminal window, but refers to the normal window of win7 or cygwin? win7 on the window did not recognize the command ./menu, which is not a valid file and cygwin does not allow me to enter the kitchen folder, and if anyone can guide me what are the right steps in this option were very grateful thank you!
Click to expand...
Click to collapse
You need to use cygwin and change to the kitchen folder. For ex - if your kitchen folder is in F:/ drive, then you need to give this command
cd F:/Kitchen
And then type ./menu
Sent from my GT-S5830 using iOS ROM
thanks, now I have another problem to make the switch from system to ext4 file opens I system.img, cygwin is in admin mode but even if I fail to convert the system
tazlooney89 said:
thanks, now I have another problem to make the switch from system to ext4 file opens I system.img, cygwin is in admin mode but even if I fail to convert the system
Click to expand...
Click to collapse
Ketut's binary file can format to ext4
Herpderp Adreno + Tegra.

[Q] Using ext4_utils tool

I posted my questions in another thread but got no response.
http://forum.xda-developers.com/showthread.php?t=1933541
I am trying to use the ext4_utils tool to unpack the factoryfs.img in order to modify the system files (add su). No luck so far.
I am now back to square one, testing the unpacking (./simg2img) and repacking (./mkuserimg.sh) tools. All I did was to unpack factoryfs.img, mount it in a temp folder, and repacking the mounted image (with no modification) into a new image. Then I repack this into a tar with md5 checksum (apparently ODIN uses checksum to verify the file to be flashed).
First thing I notice is that, the repacked image files is about 8 MB smaller than the original image (remember all I did was unpack, mount and repack using ext4_utils tool, no modification). When I tried to flash the repacked factoryfs.img (packed into TAR) using ODIN, checksum passed and it proceeded to flashing, but flashing failed.
Anyone have any experience with using ext4_utils to unpack factoryfs.img in order to add su / superuser to the system folder in order to make a rooted Samsung ROM? I feel like I have gone as far as a noob modder can go, and I really appreciate help from the veterans.
NOTE: I know I can use Android Kitchen to root and make a custom ROM, but the modified ROM in ZIP format can only be flashed by CWM. There is no CWM in my Galaxy Player (70 Plus Korean version only). I have a copy of Samsung stock TAR firmware, and I am trying to make a rooted ROM in TAR format which can be flashed by ODIN. I tried Heimdall and it seems that my player is not compatible (device detected but gets "usblib error" when I try to flash).
The repacking command is:
./mkuserimg.sh -s ./tempdir new.img ext4 ./temp XXXmb
I adjusted the "XXXmb" to match the size of the unpacked (eg. output,img) file, and the resulting size of the repacked .img file is now similar to the original factoryfs.img file.
Unfortunately, flashing this still failed (either repacked as a TAR file by itself, or replacing the original factoryfs.img and repacking the TAR firmware).
slim_thumb said:
The repacking command is:
./mkuserimg.sh -s ./tempdir new.img ext4 ./temp XXXmb
I adjusted the "XXXmb" to match the size of the unpacked (eg. output,img) file, and the resulting size of the repacked .img file is now similar to the original factoryfs.img file.
Unfortunately, flashing this still failed (either repacked as a TAR file by itself, or replacing the original factoryfs.img and repacking the TAR firmware).
Click to expand...
Click to collapse
Instead of making the *.tar by this command: tar cvf yourfilename.tar yourdirectoryname ; enter into the directory where all the *.img files reside. then use: tar cvf yourfilename.tar system.img factoryfs.img zImage etc etc. Make sure that the *.tar being created; unpacking it will directly provide those files; not a directory where in that directory all those files reside. This solved my problem. I hope it will solve your problem also.

Advice : Porting Indian ROM to Chinese ROM on Samsung Galaxy A8 8000 Model (China)

hi
I purchased a Samsung Galaxy A8 A8000 from China. I did not like its ROM since it lacked Google Apps and other stuff. So i decided to port system apps (apps+priv-app) from an indian rom. I am totall new to ROM stuff and to linux as well but i decided to go with virtual box and learn few things along the way.
For this,
first i extracted indian rom, it contained following
boot.img, cache.img, hidden.img, modem.bin, recovery.img, sboot.bin and system.img
then i extracted chinese rom, it contained different files as below
aboot.mbn, boot.img, cache.img.ext4, hyp.mbn, modem.bin, NON-HLOS.bin, recovery.img, rpm.mbn, sbl1.mbn, sec.dat, system.img.ext4 and tz.mbn
Since i donot want to mess with partitions and modem and other stuff so i decided to port only apps from indian rom and built an odin flashable tar file
For this i navigated various forum, i even dont exactly remember all but i am thankful to all who wrote useful stuff that helped me decide what to do, well most important of these were
http://forum.xda-developers.com/showthread.php?t=1974014
http://forum.xda-developers.com/showthread.php?t=1941239
http://rwilco12.com/forum/showthread.php?tid=92
first of all i converted indian rom system.img to system.raw using following command in linux virtualbox ubuntu 15.04
simg2img indsystem.img indsystem.raw
then i mounted this raw image using this command
mkdir indsystem
mount -o loop indsystem.raw indsystem/
then i converted chinese rom system.img to system.raw using same command as above
simg2img chcsystem.img chcsystem.raw
then i mounted this chinese raw image using this command
mkdir chcsystem
mount -o loop chcsystem.raw chcsystem/
then i created a system_new.img.ext4 file of 3.1GB size with this command
dd if=/dev/zero of=system_new.img.ext4 bs=4k count=775000
then i formated new image with ext4
mkfs.ext4 system_new.img.ext4
then probably i override the file system check and then mounted new ext4 image
tune2fs -c0 -i0 system_new.img.ext4
mkdir system_new
mount -o loop system_new.img.ext4 system_new
here i had a problem, i could not copy files from both indian and raw mounted images to my new ext4 image since i did not have permission to copy to the destination folder. then i made use of superuser access
gksu nautilus /path/to/image/folder
then i had full access and copied chinese rom to my new ext4 image.
cp -v -r -p chcsystem/* system_new/
then i deleted app, priv-app, font, framework, media, etc/permissions/allfiles-starting-with-android.-and-com.-and-allshare_library.xml from ext4 image.
then i manually copied these folders and permission files from indian system raw image file to my new ext4 image file
next i copy /system/lib/libandroid_runtime.so from chinese rom to the system/lib/ directory of indian rom and then deleted lib folder from chinese rom and replaced it with indian rom
then i sync files with "sync" command
then unmounted all partitions.
I then replaced system.img.ext4 file in my original rom with one that i have just made.
Now i need to compile these files back into flashable tar files with md5sum check with
tar -H ustar -c image_1 image_2 > your_odin_package.tar
md5sum -t your_odin_package.tar >> your_odin_package.tar
mv your_odin_package.tar your_odin_package.tar.md5
1. but before i do so I need some advance developer to please help me out and give some confidence as to the approach that i have used. is that correct.
2. Secondly, if someone can tell me tar ball flashing order for my rom since i heard it is important while compiling odin flashable tar file.
aboot.mbn, boot.img, cache.img.ext4, hyp.mbn, modem.bin, NON-HLOS.bin, recovery.img, rpm.mbn, sbl1.mbn, sec.dat, system.img.ext4 and tz.mbn
3. Also Is it possible that i convert system.img.ext4 into flashable odin tar file with above commands and flash only system image with Odin without messing with anyother settings.
Thank you
No one would like to help me out here.
Hi. I plan to do the same for my SM-A7000. did you get your to work?
waqasjeral said:
hi
I purchased a Samsung Galaxy A8 A8000 from China. I did not like its ROM since it lacked Google Apps and other stuff. So i decided to port system apps (apps+priv-app) from an indian rom. I am totall new to ROM stuff and to linux as well but i decided to go with virtual box and learn few things along the way.
For this,
first i extracted indian rom, it contained following
boot.img, cache.img, hidden.img, modem.bin, recovery.img, sboot.bin and system.img
then i extracted chinese rom, it contained different files as below
aboot.mbn, boot.img, cache.img.ext4, hyp.mbn, modem.bin, NON-HLOS.bin, recovery.img, rpm.mbn, sbl1.mbn, sec.dat, system.img.ext4 and tz.mbn
Since i donot want to mess with partitions and modem and other stuff so i decided to port only apps from indian rom and built an odin flashable tar file
For this i navigated various forum, i even dont exactly remember all but i am thankful to all who wrote useful stuff that helped me decide what to do, well most important of these were
http://forum.xda-developers.com/showthread.php?t=1974014
http://forum.xda-developers.com/showthread.php?t=1941239
http://rwilco12.com/forum/showthread.php?tid=92
first of all i converted indian rom system.img to system.raw using following command in linux virtualbox ubuntu 15.04
simg2img indsystem.img indsystem.raw
then i mounted this raw image using this command
mkdir indsystem
mount -o loop indsystem.raw indsystem/
then i converted chinese rom system.img to system.raw using same command as above
simg2img chcsystem.img chcsystem.raw
then i mounted this chinese raw image using this command
mkdir chcsystem
mount -o loop chcsystem.raw chcsystem/
then i created a system_new.img.ext4 file of 3.1GB size with this command
dd if=/dev/zero of=system_new.img.ext4 bs=4k count=775000
then i formated new image with ext4
mkfs.ext4 system_new.img.ext4
then probably i override the file system check and then mounted new ext4 image
tune2fs -c0 -i0 system_new.img.ext4
mkdir system_new
mount -o loop system_new.img.ext4 system_new
here i had a problem, i could not copy files from both indian and raw mounted images to my new ext4 image since i did not have permission to copy to the destination folder. then i made use of superuser access
gksu nautilus /path/to/image/folder
then i had full access and copied chinese rom to my new ext4 image.
cp -v -r -p chcsystem/* system_new/
then i deleted app, priv-app, font, framework, media, etc/permissions/allfiles-starting-with-android.-and-com.-and-allshare_library.xml from ext4 image.
then i manually copied these folders and permission files from indian system raw image file to my new ext4 image file
next i copy /system/lib/libandroid_runtime.so from chinese rom to the system/lib/ directory of indian rom and then deleted lib folder from chinese rom and replaced it with indian rom
then i sync files with "sync" command
then unmounted all partitions.
I then replaced system.img.ext4 file in my original rom with one that i have just made.
Now i need to compile these files back into flashable tar files with md5sum check with
tar -H ustar -c image_1 image_2 > your_odin_package.tar
md5sum -t your_odin_package.tar >> your_odin_package.tar
mv your_odin_package.tar your_odin_package.tar.md5
1. but before i do so I need some advance developer to please help me out and give some confidence as to the approach that i have used. is that correct.
2. Secondly, if someone can tell me tar ball flashing order for my rom since i heard it is important while compiling odin flashable tar file.
aboot.mbn, boot.img, cache.img.ext4, hyp.mbn, modem.bin, NON-HLOS.bin, recovery.img, rpm.mbn, sbl1.mbn, sec.dat, system.img.ext4 and tz.mbn
3. Also Is it possible that i convert system.img.ext4 into flashable odin tar file with above commands and flash only system image with Odin without messing with anyother settings.
Thank you
Click to expand...
Click to collapse
Hi waqasjeral. Have you already ported the Indian rom to the a8000?

Dumping stock firmware to use for lineage/custom build.

Three .sin files from stock are needed: vendor, kernel, system.
Unsin while in .sin folder:
-d to extract all files in working directory
./unsin.exe -d
You will end up with one .img file and two .ext4 files.
kernel_X-FLASH-ALL-C93B.img
system_X-FLASH-ALL-C93B.ext4
vendor_X-FLASH-ALL-C93B.ext4
While on the linux side of things, mount the .ext4 files using: mount -o loop
make sure folder 'ExtractFirm'(name it whatever you want) exists before hand. Folder closing then opening may be needed
sudo mount -o loop system_X-FLASH-ALL-C93B.ext4 ~/ExtractFirm/
Don't forget to chown the files as yours:
sudo chown -R username:group ExtractFirm/
copy the necessary files(into Firmware_Dump folder), then issue the command below when done with the mount:
sudo umount ~/ExtractFirm
--------------------
Find AIK-Linux in the dev sections on xda
Copy kernel_X*.img to AIK extracted folder then issue:
./unpackimg.sh kernel_X-FLASH-ALL-C93B.img
Own your files:
sudo chown -R username:group ramdisk/
Then copy(into Firmware_Dump folder) the contents of ram disk, if they're some errors(usually because of sym. links) with copying them, hit skip, otherwise merge all, replace all.
Lastly, mount vendor:
sudo mount -o loop vendor_X-FLASH-ALL-C93B.ext4 ~/ExtractFirm/
The kernel copy you did previously gave you an empty vendor folder. Copy all contents of the vendor mount into this empty vendor folder(within Firmware_Dump folder).
Dont forget:
sudo umount ~/ExtractFirm
Now that you have extracted firmware contents, you can run extract-files.sh for lineage/custom build:
~/lineageos/device/sony/poplar_dsds$ ./extract-files.sh ~/location of extracted contents/
These are just reference notes for everyone, I'm sure I'll need them again.
thanks @derf elot
great, thanks for the write up we can redirect people here if the question of how to extract files comes up again - which I'm sure it will
Sent from my Sony Xperia XZ1 Compact using XDA Labs
derf elot said:
great, thanks for the write up we can redirect people here if the question of how to extract files comes up again - which I'm sure it will
Sent from my Sony Xperia XZ1 Compact using XDA Labs
Click to expand...
Click to collapse
Indeed it will.
Great guide! I was thinking about automating stuff, but e.g. the copy works best when not done from the shell but from the file manager. The ignore, replace and merge all works perfect there.
Before anyone tries, here my failed attempts:
- Using 7z to extract the ext4 files, works somehow but fails to keep symlinks. But it would be faster...
- `cp -a` doesn't replace symlinks by actual folders and has some errors shown and some files/folders removed. Not sure if safe... So use file manager
- When using a VM make sure the AIK and the final folder are on ext4 filesystems, not shared/mounted from Windows hosts. Avoids failures with symlinks shown as "permission denied"
Edit: Ok I had failures and got an update to the guide:
- Start with the kernel extraction
- Then extract system*.ext4 to the system folder inside the above folder
- Then extract vendor.*ext4 to the vendor folder inside the above folder

Categories

Resources