Repackaging Odin package - Galaxy Note 10.1 (2014 Edition) Q&A, Help & Troubl

Hi all. I'm trying to repackage Odin package. I need to change smth. in cache.img.
Package contains cache.img and recovery.img.
I'm following these steps:
Untar package
simg2img cache.img cache.raw.img
mount -o loop -t ext4 cache.raw.img cache
umount cache
ext2simg cache.raw.img cache.img
tar -H ustar -c cache.img recovery.img > pkg.tar.md5
md5sum -t pkg.tar.md5 >> pkg.tar.md5
I do not change anything in cache.img, hust mounting to verify that image unpacks successfuly.
Then I'm trying to flash the package, but flashing fails on "NAND Write start" for cache.img.
As I understood, I've made a mistake when at the 5 step. How should I fix it?

Ax-Soft said:
I'm following these steps:
tar -H ustar -c cache.img recovery.img > pkg.tar.md5
...
try this:
tar --create --format=gnu -b20 --quoting-style=escape --owner=0 --group=0 --totals --mode=644 -f pkg.tar boot.img recovery.img
md5sum -t pkg.tar >> pkg.tar
mv pkg.tar pkg.tar.md5
Click to expand...
Click to collapse

Related

[Download] system.img was extracted to a 7z file (Prerooted)

It's a 7z file. It was extracted from system.img
link: http://minus.com/lJ9OQT5ktY7Vr
I used the below command to get the system.img. Root is required. Image size is 1Gb.
Code:
dd if=/dev/block/mmcblk0p15 of=/sdcard/system.img
adb pull /sdcard/system.img
To mount:
Code:
mkdir sys
sudo mount -o loop system.img sys
Is this Gingerbread or ICS? What version?
popfan said:
Is this Gingerbread or ICS? What version?
Click to expand...
Click to collapse
LT28H 4.0.4
ganeshbiyer said:
I used the below command to get the system.img. Root is required. Image size is 1Gb.
Code:
dd if=/dev/block/mmcblk0p15 of=/sdcard/system.img
adb pull /sdcard/system.img
To mount:
Code:
mkdir sys
sudo mount -o loop system.img sys
Click to expand...
Click to collapse
Now we need a usable cwm

Need stock 4.3.1 kernel

I need the official tmob noteII jb 4.3.1 kernel in tar or zip can anyone give me a link please
or latest official kernel
(Assuming you're running under Windows.)
Download the complete stock ROM from sammobile or the like. You could also get the boot.img from a repacked zip here, but YMMV.
Extract boot.img from the .tar.md5 file with a compression utility that handles tar archives, 7-Zip works well for this. (The error message about the end of the file is normal, that's because the MD5 hash isn't part of a normal tar archive.)
Get cygwin, namely its tar.exe command. With boot.img in your Cygwin home directory, from the Cygwin shell run:
tar -H ustar -cf youroutputfilename.tar boot.img
As an aside, my Windows-based setup to make Odin-flashable images is fancier than that. I've added the Cygwin binaries to my PATH environment variable (jury is still out on whether that's a good idea overall, but it works for a number of tricks) and I've created a script named tarodin.cmd in that directory which contains the following command:
tar -H ustar -cf %1 sboot.bin tz.img md5.img efs.img m9kefs1.bin m9kefs2.bin m9kefs3.bin param.bin boot.img recovery.img system.img modem.bin tombstones.img cache.img hidden.img userdata.img
The missing files just cause an error to show but the file itself works perfectly. I haven't bothered adding the MD5 hash, but it could be done.
The other way is to take a working t0lte kernel zip and substitute the boot.img in it then flash through recovery.
Good luck,
Darkshado
Got Kernel working
Darkshado said:
(Assuming you're running under Windows.)
Download the complete stock ROM from sammobile or the like. You could also get the boot.img from a repacked zip here, but YMMV.
Extract boot.img from the .tar.md5 file with a compression utility that handles tar archives, 7-Zip works well for this. (The error message about the end of the file is normal, that's because the MD5 hash isn't part of a normal tar archive.)
Get cygwin, namely its tar.exe command. With boot.img in your Cygwin home directory, from the Cygwin shell run:
tar -H ustar -cf youroutputfilename.tar boot.img
As an aside, my Windows-based setup to make Odin-flashable images is fancier than that. I've added the Cygwin binaries to my PATH environment variable (jury is still out on whether that's a good idea overall, but it works for a number of tricks) and I've created a script named tarodin.cmd in that directory which contains the following command:
tar -H ustar -cf %1 sboot.bin tz.img md5.img efs.img m9kefs1.bin m9kefs2.bin m9kefs3.bin param.bin boot.img recovery.img system.img modem.bin tombstones.img cache.img hidden.img userdata.img
The missing files just cause an error to show but the file itself works perfectly. I haven't bothered adding the MD5 hash, but it could be done.
The other way is to take a working t0lte kernel zip and substitute the boot.img in it then flash through recovery.
Good luck,
Darkshado
Click to expand...
Click to collapse
Thanks bud used the Kernel and subbed it in zip that did the trick God Bless

How to create a odin file without aboot

hello developers,
I am in pure stock odexed rom with unlocked bootloader and rooted by magisk. I would like to create a odin file to update the stock rom.
Steps:
1. Extract zip file from sammobile
2. Extract tar.md5 file contents using 7zip to /cygwin64/home/username/rom folder
3. Delete aboot.mbn
4. open cygwin64 and execute the following commands in windows 10 PC
$ cd rom
$ tar -H ustar -c sbl1.mbn rpm.mbn tz.mbn sdi.mbn NON-HLOS.bin boot.img recovery.img system.img.ext4 modem.bin cache.img.ext4 > stock.tar
$ md5sum -t stock.tar >> stock.tar
$ mv stock.tar stock.tar.md5
5. Odin stock.tar.md5
All threads completed. (succeed 1/failed 0)
But when I boot it, there is no /system/csc folder and I don't get network.
So I did the following steps to make it work.
1. Odin twrp
2. Boot to recovery
3. Use cacheripper to extract cache.img.ext4 to cache.zip file
4. mount system in twrp and activate sideload
5. adb sideload cache.zip
6. wipe dalvik and cache
7. Reboot
It works now - I have updated stock with all my apps and settings intact.
What am I missing in creating odin file? Why cache.img.ext4 is not flashing csc folder even though odin says success?
Thanks
sam298 said:
$ tar -H ustar -c sbl1.mbn rpm.mbn tz.mbn sdi.mbn NON-HLOS.bin boot.img recovery.img system.img.ext4 modem.bin cache.img.ext4 > stock.tar
Click to expand...
Click to collapse
I've read in other threads that the order of the files in the tar command is important. You might try ordering the files as they listed in the stock firmware (i.e., list cache.img.ext4 before modem.bin.

booting custom kernel

SOLVED: I was using the G980F boot.img instead of G985F image. THANKS everyone
The device won't reboot if I unpack and repack the boot.img on S20
Did someone else here succeed in flashing a new boot.img ? THANKS
Code:
[email protected]:~/GS20_kernel_build$ unpackbootimg -i boot.img
BOARD_KERNEL_CMDLINE androidboot.hardware=exynos990
BOARD_KERNEL_BASE 10000000
BOARD_PAGE_SIZE 2048
[email protected]:~/GS20_kernel_build$ mkbootimg --kernel boot.img-zImage --ramdisk boot.img-ramdisk.gz -o boot_repacked.img
[email protected]:~/GS20_kernel_build$ heimdall flash --BOOT ./boot_repacked.img
[...]
Downloading device's PIT file...
PIT file download successful.
Uploading BOOT
100%
BOOT upload successful
Ending session...
Rebooting device...
modem__ said:
The device won't reboot if I unpack and repack the boot.img on S20
Did someone else here succeed in flashing a new boot.img ? THANKS
Code:
[email protected]:~/GS20_kernel_build$ unpackbootimg -i boot.img
BOARD_KERNEL_CMDLINE androidboot.hardware=exynos990
BOARD_KERNEL_BASE 10000000
BOARD_PAGE_SIZE 2048
[email protected]:~/GS20_kernel_build$ mkbootimg --kernel boot.img-zImage --ramdisk boot.img-ramdisk.gz -o boot_repacked.img
[email protected]:~/GS20_kernel_build$ heimdall flash --BOOT ./boot_repacked.img
[...]
Downloading device's PIT file...
PIT file download successful.
Uploading BOOT
100%
BOOT upload successful
Ending session...
Rebooting device...
Click to expand...
Click to collapse
You need to make a tar file containing the img and flash it with odin. You need a Windows computer for that. Linux won't do sadly
If you don't feel like making a flashable zip file you can just use dd to install it from within TWRP (via terminal on console or ADB) if you have that installed:
dd if=boot_repacked.img of=/dev/block/by-name/boot
No Windows/Odin required.
sjevtic said:
If you don't feel like making a flashable zip file you can just use dd to install it from within TWRP (via terminal on console or ADB) if you have that installed:
dd if=boot_repacked.img of=/dev/block/by-name/boot
No Windows/Odin required.
Click to expand...
Click to collapse
dd always scares me lol.
You sure this works with S20? Even Fastboot fllashing doesn't work so I doubt this will
JanBoyGamer23 said:
dd always scares me lol.
You sure this works with S20? Even Fastboot fllashing doesn't work so I doubt this will
Click to expand...
Click to collapse
My phone wouldn't boot last night after I tried flashing my own boot image and this was how I put the previous one back. It booted right up.

Repack Stock Firmware with Android 10 for Odin

I am trying to de-bload/modify the original stock firmware and flash it to my phone using odin without installing TWRP. I have already successfully flashed Magisks this way. However, all the guides I found on modifying the system.img seem to be outdated and do not work anymore.
Here is my current workflow (all on Debian 10)
Code:
tar xvf AP_*.tar.md5 #from original stock rom package or magisk_patched_*.tar) into sub-directory
lz4 -d system.img.lz4
simg2img system.img system.raw.img #either the Debian version or fresh compile from https://github.com/anestisb/android-simg2img
mkdir sys
sudo mount -t ext4 -o loop system.raw.img sys/
# Do a bunch of changes in the mounted image e.g. delete Samsung bloatware
sudo umount sys/
img2simg system.raw.img system.img
lz4 -B6 --content-size system.img system.img.lz4
tar --owner=1000 --group=1000 -H ustar -cvf AP_modified.tar *
md5sum -t AP_modified.tar >> AP_modified.tar
mv AP_modified.tar AP_modified.tar.md5
Unfortunately, the resulting file does not work because odin hangs or odin finishes and the phone is stuck in a boot loop. Anybody knows what I am missing here. Bootloader is unlocked, as I said, I could successfully flash the modified AP_* from magisk.

Categories

Resources