> Forums > Samsung Flashen/Flexen/Modden

C

Creating Custom ROMs/Backups for Odin

Erstellt
Dez. '11
letzte Antwort
Noch keine
Antworten
Noch keine
Aufrufe
3.9T
0
„Gefällt mir“
Abos
1
So., 04. Dezember, 2011 um 9:34
#1

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.


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

  • Retrieve the dumped file from the SD Card.
  • 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!



  • 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.
  • Start an ADB shell session and obtain root access.
  • Run the following command to dump the System partition:
    Code:
    # dd if=/dev/block/stl9 of=/sdcard/system bs=4096

  • 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



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

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

  • Retrieve the dumped file from the SD Card.
  • Make a copy for backup purposes! We will be editing these.
  • Create a working folder for each of the dumped kernel and/or recovery images and move them there.
  • 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

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

  • 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.
  • 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

  • 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.
  • 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!



  • Open a Cygwin or *nix console and change directory to where you are storing your ROM dumps.
  • 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]

  • 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:


  • 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.
  • If everything loads correctly you can if Odin will flash them properly - click Start.
  • If your packages flashed correctly post them online or archive them for backup


  • > Forums > Samsung Flashen/Flexen/Modden

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

    ;-)



    Logo https://t.ress.at/94Nd3/


    Ähnliche Themen:











    Top