Creating Custom ROMs/Backups for Odin


Neue Antwort erstellen
Erstellt
Dez. '11
letzte Antwort
Noch keine
3,9 T.
Aufrufe
0
„Gefällt mir“
1
Abo
Kefir
FAQ-Schreiber
FAQ-Schreiber


Anm. Datum: 01.01.2001
Beiträge: 14372
Wohnort: Belgien
Handy: Alle Möglichen zum Testen
BeitragSo 04. Dezember, 2011 10:34
Antworten mit Zitat


Nu11u5 hat Folgendes geschrieben:
Here is a brief much more complete guide to creating your own Odin images for distributing custom ROMs or making backups. Thanks to kam197, BH_MAN, chadmd23, SoulCreator, and all the other community members.

Requirements:


  • A Samsung Behold 2 to backup/edit/ ROMs on

  • Root via try3/asroot2, persistent su, or modified kernel
  • Working ADB connection
  • SD Card with ~300MB free
  • Cygwin - if you are working in Windows
  • Basic knowledge of a command line


Making the ROM Dump:

The Behold 2 has 14 partitions in its flash memory, but only a few of these are useful to modify. You will want to focus on different partitions depending on what you want to do. After you make a ROM dump you will need to package it using the instructions in the following section before you can flash it.

Backup your personal data?

You may want to backup your data while trying out a different ROM. It is simple to do.


  1. Start an ADB shell session and obtain root access.
  2. Run the following command to dump the UserData partition:
    Code:
    # dd if=/dev/block/stl14 of=/sdcard/userdata bs=4096

  3. Retrieve the dumped file from the SD Card.
  4. Don't include userdata in a distribution unless you don't mind everyone knowing your email, passwords, app choices, web history, etc!



Make a custom system image (ROM)?


Creating a custom ROM can involve no more than changing out a few included applications to modifying advanced features of the phone. A lot of ing should be performed before distributing a heavily customized system image. It is recommended to make multiple system image dumps as "in-progress" snapshots or saves as you work on the ROM. Otherwise messing up normally means starting over!



  1. Once dumped a system ROM cannot be edited, so you must work with it directly on the phone (recommended while in Recovery Mode). The System dump will be an exact copy of what is already loaded so get everything set up first and that the phone can reboot.
  2. Start an ADB shell session and obtain root access.
  3. Run the following command to dump the System partition:
    Code:
    # dd if=/dev/block/stl9 of=/sdcard/system bs=4096

  4. Retrieve the dumped file from the SD Card.


If you want to get files out of another system image (or userdata image) without flashing, open them in an archive program that can read FAT disk image files - 7-Zip is recommended - or mount them read-only under Linux. Trying to write to the image with these methods will corrupt it as its non-standard.

Make a custom kernel or recovery image (ROM)?

ADVANCED: Modifying the kernel or recovery image can allow you to enable root, change startup logos, and tweak environment settings for boot. In addition to the other requirements you will need an decent understanding of Linux file permissions, startup, and mount process, as well as a hex editor



  1. Start an ADB shell session and obtain root access.
  2. Run the following command to dump the kernel partition:
    Code:
    # dd if=/dev/block/bml8 of=/sdcard/kernel bs=4096

  3. Run the following command to dump the recovery partition:
    Code:
    # dd if=/dev/block/bml6 of=/sdcard/recovery bs=4096

  4. Retrieve the dumped file from the SD Card.
  5. Make a copy for backup purposes! We will be editing these.
  6. Create a working folder for each of the dumped kernel and/or recovery images and move them there.
  7. Split the images in each working folder into the binary and ramdisk.
    Code:
    $ head -c 1785856 kernel > krnl.bin
    $ tail -c +1785857 kernel > rd.cgz
    Code:
    $ head -c 1937408 recovery > krnl.bin
    $ tail -c +1937409 recovery > rd.cgz

  8. In each working folder extract the initramfs filesystem.
    Code:
    $ mkdir initramfs
    $ cd initramfs
    $ gzip -cd ../rd.cgz | cpio -imv

  9. Modify, add, or remove files as need. Check that permissions are appropriate - all files will be owned by root.root after the ramdisk file is remade.
  10. Recreate the compressed ramdisk and then the kernel/recovery image with the following:
    Code:
    $ find | cpio -H newc -R 0.0 -oa | gzip -cn1 > ../rd.cgz
    $ cat rd.cgz >> krnl.bin

  11. Edit the kernel/recovery image in a hex editor. Change the 4 bytes starting at offset 0x10 to be the size of the rd.cgz file in hex, little endian format. So if your compressed ramdisk size is 1647744 bytes that would be 0x192480 in hex and therefore "80 24 19 00" in little endian format.
  12. Save the completed custom kernel/recovery image as "kernel" or "recovery".


Building the Odin Packages:

Odin technically allows you to use two types of packages - Specific and OnePackage.

Specific packages are labeled "BOOT", "PHONE", "PDA", and "CSC" in the software. Selecting these in Odin checks that they contain exactly the expected flash images and presents an error if anything is out of place (extra or missing files, mislabeled files). The CSC specific package is currently not used for the Behold 2.

Since you will rarely want to flash the entire phone at once the Specific Packages are not always appropriate. When someone else goes to flash your ROM they may get an ambiguous error and not know for sure why.

OnePackage allows any the partition flash files to be included with each other in one Odin package. These are easier to distribute and will not cause odd errors when someone loads them into Odin.

TL;DR: Use OnePackage to distribute ROMs!

Note: Errors during flashing are normally recoverable unless the error occurred while flashing the boot partitions (arm9boot and arm11boot). NEVER include these files in an Odin package - they do not need updating!



  1. Open a Cygwin or *nix console and change directory to where you are storing your ROM dumps.
  2. Run the following command to build a package tarball. Be sure to use identifiable names with versions or dates:
    Code:
    $ [B]tar -H ustar -c[/B] [I]image_1 [image_2 ...][/I] [B]>[/B] [I]your_odin_package.tar[/I]

  3. Run the following command to sign each tarball with an md5 tail:
    Code:
    $ [B]md5sum -t[/B] [I]your_odin_package.tar[/I] [B]>>[/B] [I]your_odin_package.tar[/I]
    $ [B]mv[/B] [I]your_odin_package.tar[/I] [I]your_odin_package.tar[/I][B].md5[/B]


Please sign your Odin Packages - its the easiest way to tell if the download corrupted them!

Testing your Odin Packages:


  1. Without clicking Start in Odin, load each of the packages you made to see if there are any errors. Be sure to mark the One Package checkbox under Options if you are using one.
  2. If everything loads correctly you can if Odin will flash them properly - click Start.
  3. If your packages flashed correctly post them online or archive them for backup Smile

Warum willst Du den Post von Kefir melden?




Benutzer-Profile anzeigen Private Nachricht senden

 Post #1

Werbung
Kostenloses Bildhosting

Beiträge der letzten Zeit anzeigen:      

Neue Antwort erstellen

Ähnliche Themen:
RCS-Messaging: Google blockiert eigenes Lieblingsprojekt auf Custom-ROMs
Neues Museum für Marmorkarte des antiken Roms
Toniebox Reverse Engineering: Vortrag über Custom-Firmware und selfhosted Cloud-Ersatz
Blackwidow V4 75: Razer baut ein Custom Keyboard
Apple macht lokale Backups schwerer und drängt Nutzer in die iCloud
Whatsapp-Backups künftig auf Google Drive nicht mehr kostenlos
Nach jahrelanger Kritik: Whatsapp verschlüsselt künftig die Backups
iCloud-Backups nach 180 Tagen ohne Warnung gelöscht
Display des ASUS ROG Phone II und ROG Phone 3 kommt mit Custom Kernel auf 160Hz

Kurze URL:

Du hast bereits für diesen Post angestimmt...

;-)




Alle Zeiten sind GMT + 1 Stunde

Top