[Samsung Galaxy Core.] StratOS_HTC:
Update boot,kernel,ramdisk ...

Greetings.

Found a way for editing kernel, ramdisk, creating root update and many other things.

The basic is to backup your boot - kernel.

Been working on SM-G355HN only. Folowing post will be only 4 this phone.

First u have to have rooted phone - see previous posts.

Backup your Kernel - boot ( KERNEL -> /dev/block/mmcblk0p17 )

root@kanas3gnfc:/sdcard # cat /dev/block/mmcblk0p17>/sdcard/boot.img

I've manage to implement and copy mkbootfs,mkbootimg and unmkbootimg in system/bin

mount -o remount,rw -t ext4 /dev/block/mmcblk0p1 /system

root@kanas3gnfc:/system/bin # chmod 755 mkbootfs
chmod 755 mkbootfs
root@kanas3gnfc:/system/bin # chmod 755 mkbootimg
chmod 755 mkbootimg
root@kanas3gnfc:/system/bin # chmod 755 unmkbootimg
chmod 755 unmkbootimg

The rest is simple :

root@kanas3gnfc:/data/local/tmp # unmkbootimg -i boot.img
unmkbootimg -i boot.img
kernel written to 'kernel' (12071152 bytes)
ramdisk written to 'ramdisk.cpio.gz' (391287 bytes)

To rebuild this boot image, you can use the command:
mkbootimg --base 0 --pagesize 2048 --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 --second_offset 0x00f00000 --tags_offset 0x00000100 --cmdline 'console=ttyS1,115200n8' --kernel kernel --ramdisk myramdisk.gz -o newboot.img

In this step I only changed the ro security in ramdisk in default.prop,

rebuild the ramdisk and make the boot.img.

Create the update zip flashable file and flash it throught recovery.

Ramdisk ok - default.prop changed.No more security options. Phone booted ok.

So we have now a simple method of doing and changing stuff.

I have worked only on my phone throught adb/terminal emulator.

Here is the modified file for my phone & update script

ui_print("***************************");
ui_print("*StratOS ramdisk installer*");
ui_print("***************************");
ui_print("");
ui_print("only 4 SM-G355HN !");
ui_print("");
package_extract_file("boot.img", "/dev/block/mmcblk0p17");
ui_print("");
ui_print("| Finished|");
ui_print("Reeboting ...");
run_program("/sbin/sleep", "5");
run_program("/sbin/reboot");

Update : Remove the magafileupload link.

Added xda links.

Added boot images original and changed.

This files are only for Build kot49h.g355hnxxu0anh3

More infos on how to :

Create backup copy of your boot (kernel)

root@kanas3gnfc:/dev/block # cat mmcblk0p17>/storage/extSdCard/boot.orig.img

unpack it :

root@kanas3gnfc:/storage/extSdCard # unmkbootimg -i boot.orig.img
unmkbootimg -i boot.orig.img
kernel written to 'kernel' (12071152 bytes)
ramdisk written to 'ramdisk.cpio.gz' (391287 bytes)

To rebuild this boot image, you can use the command:
mkbootimg --base 0 --pagesize 2048 --kernel_offset 0x00008000 --ramdisk_offset
0x01000000 --second_offset 0x00f00000 --tags_offset 0x00000100 --cmdline 'conso
le=ttyS1,115200n8' --kernel kernel --ramdisk ramdisk.cpio.gz -o boot.orig.img

copy it to internal media :

root@kanas3gnfc:/storage/extSdCard # cp ramdisk.cpio.gz /data/local/tmp/ramdisk.cpio.gz

Unzip it and cpio align :

root@kanas3gnfc:/data/local/tmp # mkdir ramdisk
mkdir ramdisk
root@kanas3gnfc:/data/local/tmp # cd ramdisk
cd ramdisk
root@kanas3gnfc:/data/local/tmp/ramdisk # gunzip -c ../ramdisk.cpio.gz | cpio -i
sk.cpio.gz | cpio -i
1456 blocks

modify the ramdisk default.prop file :

root@kanas3gnfc:/data/local/tmp/ramdisk # cat default.prop
cat default.prop
#
# ADDITIONAL_DEFAULT_PROPERTIES
# MODIFIED BY StratOS
#
ro.secure=0
ro.allow.mock.location=1
ro.debuggable=1
ro.adb.secure=0
persist.sys.usb.config=mtp
root@kanas3gnfc:/data/local/tmp/ramdisk #

now re-cpio and re-gzip the new ramdisk

find . | cpio -o -H newc | gzip > ../ramdisk.cpio.gz

pack it with kernel and command line from unpacking and create modified boot.img :

mkbootimg --base 0 --pagesize 2048 --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 --second_offset 0x00f00000 --tags_offset 0x00000100 --cmdline 'console=ttyS1,115200n8' --kernel kernel --ramdisk ramdisk.cpio.gz -o boot.img -kernel kernel --ramdisk ramdisk.cpio.gz -o boot.img

replace the block and voila :

If u get bootloops of flash the wrong image the phone will go to recovery, you can backup your boot via flashable zip or via flashable zip and adb sideload.

The reason if u use same firmwara as I do could be because i didn't copy or symlinked the 2 remaining files in /sbin/ ramdisk ( the process of making was in the vfat (extSdCard))

ueventd and watchdogd

Have fun ...