[Galaxy S 4 General] SamuriHL:
First the disclaimer:

I am not responsible for what you do to your phone. Following these directions could cause you to brick, locust plague, or end of times. You assume ALL responsibility for what you do with this information.

Now, on to the fun stuff. I take *NO* credit for this information at all. I am a student of people far more knowledgeable about these things. However, I've managed to take what I've learned and apply it in really fun ways. For example, I have a script that takes an OTA and builds a new full ODIN image from it...with all partitions fully signed except system. Many people have asked me to "repackage it" with various requests. This tutorial is going to show how to do that.

Requirements:

o) You will need to install Cygwin. A default installation should suffice for this exercise.

o) You will need one of the ODIN TAR Full Rooted Restore images. They are gzipped to make them smaller.

Process:

o) You need to unpack the files stored inside the gzip. 7 Zip is a handy program for doing that. We need the individual partition files extracted to a work directory that can be accessed from a Cygwin command prompt. I create a C:\Android\S4_GPE directory for my own image creation tasks.

o) Once the individual files are unpacked, we need to repack them. Open a Cygwin command prompt and navigate to the directory you extracted the files to. In my case, that would be cd c:/Android/S4_GPE

Follow the directions below to repack the files as needed. I give a few examples here to show you the basics of how it's done. Basically you run each command in your Cygwin command prompt. Or you can add them to an SH script and run it that way. Whatever you feel most comfortable with.

The output of these commands is an ODIN flashable file that will install what you choose.

BOOT

filename=boot

tar -H ustar -c boot.img > $filename.tar

md5sum -t $filename.tar >> $filename.tar

mv $filename.tar $filename.tar.md5

RECOVERY

filename=recovery

tar -H ustar -c recovery.img > $filename.tar

md5sum -t $filename.tar >> $filename.tar

mv $filename.tar $filename.tar.md5

MODEM

filename=modem

tar -H ustar -c NON-HLOS.bin modem.bin > $filename.tar

md5sum -t $filename.tar >> $filename.tar

mv $filename.tar $filename.tar.md5

FULL ODIN IMAGE

filename=I9505GUEUB_FULL_ROOTED

tar -H ustar -c boot.img recovery.img NON-HLOS.bin modem.bin system.img.ext4 > $filename.tar

md5sum -t $filename.tar >> $filename.tar

mv $filename.tar $filename.tar.md5

gzip $filename.tar.md5

Those are some of the common ones. What if I wanted a "semi-full rooted image"? For instance, without the modems? You just modify this line:

tar -H ustar -c boot.img recovery.img NON-HLOS.bin modem.bin system.img.ext4 > $filename.tar

so that it becomes:

tar -H ustar -c boot.img recovery.img system.img.ext4 > $filename.tar

Of if you don't want recovery, either, and just want boot and system:

tar -H ustar -c boot.img system.img.ext4 > $filename.tar

And the rest stays the same. I really hope this helps people. I will update this post to clarify anything that's confusing and will try to help people in this thread to create whatever they need. Again, you take responsibility for anything you create using these instructions and flash to your phone.