[Galaxy S II Themes and Apps] Chenglu:
My English is not good, pls forgive me.

I use COMPILER : arm-eabi-4.4.3/bin/arm-eabi-gcc

I upload the modify initramfs for you. in "/bin/script/post-init.sh" & "recovery.sh" use payload Method.

recovery.tar.xz:resources/payload/recovery

boot.tar.xz:resources/payload/boot

Use "payload" Parameter,repack process will be auto generate "recovery.tar.xz & boot.tar.xz", auto pad to zImage.

When you need payload file, use script unpacked from the kernel partition:

post-init.sh:

boot_extract()
{
eval $(/sbin/read_boot_headers /dev/block/mmcblk0p5)
load_offset=$boot_offset
load_len=$boot_len
dd bs=512 if=/dev/block/mmcblk0p5 skip=$load_offset count=$load_len | xzcat | tar x
payload=1
}
recovery_extract()
{
eval $(/sbin/read_boot_headers /dev/block/mmcblk0p5)
load_offset=$recovery_offset
load_len=$recovery_len
dd bs=512 if=/dev/block/mmcblk0p5 skip=$load_offset count=$load_len | xzcat | tar x
}

recovery.sh:

cd /
eval $(read_boot_headers /dev/block/mmcblk0p5)
load_offset=$recovery_offset
load_len=$recovery_len
dd bs=512 if=/dev/block/mmcblk0p5 skip=$load_offset count=$load_len | xzcat | tar x

My command:

./repack.sh zImagezslpq initramfs-zslpq new-zImage payload
---------------------------kernel repacker for i9100--------------------------- √
Extracting gzip'd kernel from zImagezslpq (start = 18100) √
Non-compressed CPIO image from kernel image (offset = 193152). √
Check MMC_CAP_ERASE instruction: √
Linux version 3.0.15-1005264 (se.infra@SEP-110)
(gcc version 4.4.3 (GCC) ) #3 SMP PREEMPT Thu Sep 6 15:53:31 KST 2012 √
1 occurrences of the bad code signature. ×
Found unsafe instruction at offset 5852884(0x00594ed4) ×
Do you want to patch kernel?(N/y)y
Patching kernel... √
Done. √
make initramfs.cpio √
Now we are rebuilding the zImage: √
CPIO image MAX size:2201600 √
Head count:2394752 √
Making head.img ( from 0 ~ 193152 ) √
Making a tail.img ( from 2394752 ~ 10858340 ) √
Current ramdsize using cat : 2608640 with required size : 2201600 bytes √
Current ramdsize using gzip : 1469837 with required size : 2201600 bytes √
gzip accepted! √
Merging [head+ramdisk] + padding + tail √
Image ---> piggy.gzip √
piggy.gzip ---> piggy.gzip.o √
Compiling head.o √
Compiling misc.o √
Compiling decompress.o √
Compiling lib1funcs.o √
Create vmlinux.lds √
head.o misc.o piggy.gzip.o decompress.o lib1funcs.o -> vmlinux √
vmlinux ---> zImage √
Compiled new zImage size:5334288 √
MAKE_FIPS for zImage. √
Make payload file(boot.tar.xz|recovery.tar.xz). √
Padding payload files to new-zImage. √
Now zImage size:7753216 bytes. √
Padding new zImage to 8388608 bytes. √
new-zImage has been created. √

Cleaning up... finished.

Use other compression formats:

./repack.sh zImagezslpq initramfs-zslpq new-zImage payload xz
---------------------------kernel repacker for i9100--------------------------- √
Extracting gzip'd kernel from zImagezslpq (start = 18100) √
Non-compressed CPIO image from kernel image (offset = 193152). √
Check MMC_CAP_ERASE instruction: √
Linux version 3.0.15-1005264 (se.infra@SEP-110)
(gcc version 4.4.3 (GCC) ) #3 SMP PREEMPT Thu Sep 6 15:53:31 KST 2012 √
1 occurrences of the bad code signature. ×
Found unsafe instruction at offset 5852884(0x00594ed4) ×
Do you want to patch kernel?(N/y)y
Patching kernel... √
Done. √
make initramfs.cpio √
Now we are rebuilding the zImage: √
CPIO image MAX size:2201600 √
Head count:2394752 √
Making head.img ( from 0 ~ 193152 ) √
Making a tail.img ( from 2394752 ~ 10858340 ) √
Current ramdsize using cat : 2608640 with required size : 2201600 bytes √
Current ramdsize using gzip : 1469837 with required size : 2201600 bytes √
gzip accepted! √
Merging [head+ramdisk] + padding + tail √
Image ---> piggy.xz √
Compiling ashldi3.o √
piggy.xzkern ---> piggy.xzkern.o √
Compiling head.o √
Compiling misc.o √
Compiling decompress.o √
Compiling lib1funcs.o √
Create vmlinux.lds √
head.o misc.o piggy.xzkern.o decompress.o lib1funcs.o ashldi3.o -> vmlinux √
vmlinux ---> zImage √
Compiled new zImage size:4190312 √
MAKE_FIPS for zImage. √
Make payload file(boot.tar.xz|recovery.tar.xz). √
Padding payload files to new-zImage. √
Now zImage size:6609408 bytes. √
Padding new zImage to 8388608 bytes. √
new-zImage has been created. √

Cleaning up... finished.