How to re-pack odin recovery image?
You can use unmkbootimg from this thread on XDA Developers.

$ unmkbootimg recovery.img


This should give you two files: initramfs.cpio.gz and zImage (the kernel image). To extract initramfs.cpio.gz use this command:

$ mkdir ramdisk &amp;&amp; cd ramdisk
$ gunzip -c ../initramfs.cpio.gz | cpio -i


Check this post for more detailed information.

EDIT:
I just realized I only answered half of the question. To re-pack the image after making changes to the extracted files, use the command that unmkbookimg gave you, e.g.

mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x40000000 --cmdline 'console=ttyS0,115200 rw init=/init loglevel=8' -o new_boot.img


According to the article, use this command to create the new initramfs.cpio.gz file (untested):

find . | cpio -o -H newc | gzip &gt; ../newramdisk.cpio.gz