[XPERIA X10 Android Development] DooMLoRD:
< ANNOUNCEMENTS >

these scripts are no longer supported as we plan to make app for this

</ ANNOUNCEMENTS >

PLEASE DO NOT RUSH TO TEST THIS,

PLEASE READ THIS COMPLETE POST TILL THE END AND ONLY THEN USE THE FILES PROVIDED IN 2ND POST.

PLEASE MAKE A NANDROID/RECOVERY BACKUP OF UR CURRENT ROM. AND MAKE SURE THAT U CAN USE FLASHTOOL TO FLASH STOCK SE FW IF THE OS FAILS TO BOOT (IF U R STUCK AT SE TEXT LOGO)

PLEASE READ THE WARNING POSTED TOWARDS THE END OF THIS POST

This Kernel Manager will provide a slight easier way to test/use/switch between custom kernels available for X10... This is as of now its based off GScript (need help from others if it has to become an app)... its basically a bunch of shell scripts... which can be executed to get the desired Kernel Manager :P

MANY thanks to jerpelea, zdzihu, Bin4ry, Androxyde & others involved in creating custom recovery for X10, FreeXperia Project & developing custom kernels

Thank you anantshri for helping out during testing phase.

Thanks to everyone who tested out v1.0 and provided invaluable feedback/comments/suggestion... Thank you very much...

DIFFICULTY

: MEDIUM

Requirements

for using custom kernels u will need to be on baseband 2.0.xx (2.0.52 preferred)... you can download it from BaseBand Collection...

froyo users (who have roms ment for basebands 2.1.5x) can use Base Band Patch for 2.2 roms...

Any working recovery

Features:

Single chargemon script for:

Reboot into recovery

Boot custom kernel at next bootup

Boot stock/custom kernel as default

Slightly elegant way (in my opinion) of selecting custom kernels

Tried my best to keep it as backward compatible with existing scripts as possible

Ability to take backup of stock modules of current ROM

All files will be having LOTS of log capability so that error/bug hunting can be easier

System mounts will be handled more securely and after required operations are complete the system will be remounted to original state

Backup of current chargemon will be taken which can be restored later so as to not disturb current recovery

Included FreeXperia recovery into the kernelmanager package (Thank you jerpelea & zdzihu for ur work on custom recovery)

Some Busybox binaries included in kernelmanager package (this will not interfere with the current busybox on ur current ROM)

This is currently based on shell scripts. There are three types of scripts which are executed:

[Type 1] Some scripts are executed during flashing update.zip

[Type 2] Some shell scripts are executed during bootup (by chargemon)

[Type 3] Others will have to be executed by user.

U will need GScript to be able to use user-executable Kernel Manager scripts. I have not included GScript in package because I found that there can be an issue if GScript gets overwritten. So u can install GScript Lite from market (or download from here). The scripts which require user-interaction and the files which need to be run from OS will be saved in /sdcard/gscript folder.

The files which need to be run from android OS:

backup_stock.sh

DEPRECATED FUNCTION. NO NEED TO RUN THIS.

restore_stock.sh

This program restores the stock modules of current rom. Before running this script make sure that u switch off WIFI/BT. Once restore is complete reboot the device to see if changes worked.

set_default_stock.sh

This sets a flag (/system/kernel/defaultstock) so that STOCK kernel is booted by default and all custom kernel flags are removed.

set_default_custom.sh

This sets a flag (/data/local/tmp/defaultcustom) so that CUSTOM kernel is booted by default and all other flags are removed.

set_test_custom.sh

This sets a flag (/data/local/tmp/kexecboot & /data/local/tmp/defaultcustom) so that CUSTOM kernel is booted ONLY ONCE during NEXT bootup and all other flags are removed. After subsequent reboots the stock kernel will be selected by default.

select_KERNELNAME.sh

This file will be provided in each custom kernel package and will write the name of the folder containing the custom kernel files to /data/local/tmp/selectedkernel

There will also be a “identifier” file in each kernel package which will be displayed to the user.

check_current_kernel.sh

This program is ment to show the currently selected kernel. But for some odd reason it doesn’t show the intended info.

reboot_recovery.sh

This program is ment to reboot the device into recovery.

uninstall_km.sh

This program marks a flag "/data/local/tmp/uninstall_km" which will be read by kernelmanager on next reboot and will restores the stock modules & original chargemon of current rom. Once restore is complete during next bootup the device will automatically reboot (this is expected). Then please see if everything is restored back to stock. For now this will NOT DELETE KERNELMANAGER files.

Add these files into GScript:

just launch the app

click on "Load File" and select each script, all the contents will load automatically

u need to make sure that the option "Need SU?" is checked (ticked)

now save

if u try running the script a popup for SU permissions might come up, this will only come the first time its run, select "Allow"

Short HOW-TO:

Reboot into recovery

Flash KM_v1.1_install.zip

Reboot device

Add all the files into GScript as mentioned above

NOW select the kernel u want to test select_KERNELNAME. the device wont reboot.

U can now select if u want to just test the custom kernel out set_test_custom.sh or want to set custom kernel as default set_default_custom.sh. the device wont reboot.

Once these programs are executed now u can reboot device and enjoy custom kernels

If u want to go back to stock kernel for the current ROM u can just select set_default_custom.sh and stock kernel for the current ROM will be booted on next reboot

If u want to switch kernels just select the kernel u want to use select_KERNELNAME

U can always flash KM_v1.1_restoremodules.zip if u face any problems like installer update.zip did not flash properly / u are stuck at SE text logo (ramdisk related) / facing contant system FC/crashes (ramdisk related)

If u had any problems using kernel manager just pull the log files via ADB shell:

adb pull /system/kernelmanager/log/ .
adb pull /data/local/tmp/km_log/ .

after which u can flash uninstaller update.zip to return to ur default chargemon & recovery... also it would be helpful if u can post the log files here so that i can look into wht the problem was exactly...

Logs saved at:

/system/kernelmanager/log/ for [Type 1]

/data/local/tmp/km_log/ for [Type 2] & [Type 3]

All filenames of logs will start with km_log_

So if u run into any problems please get the log files from the above directory and post them here.

WARNINGS:

Only those files which are provided here (including kernel packages) will be supported

I have used the miniloader provided in the latest kernels, this version does not print out any on screen text. I am aware that some users are having an issue with using this version of miniloader. A hotfix package released check POST #2.

If ur current rom does not require default custom kernel then please delete /system/kernel folder before flashing installer update.zip

IMPORTANT for CM7 users / users who have ROMs which uses custom kernel as default booting option. PLEASE use v1.1 which is compatible for u guys. also NO NEED TO DELETE /system/kernel/

To-do:

move kernel files to SDCARD

Md5 checker for files before copying to /system

Ideas for future:

Create some sort of framework which will allow to store all currently available custom kernels centrally (may be on some central server), so that the users can download them to their devices as required

APP for this

If we can integrate it into Recovery as an option

Or can be launched (some sort of text interface) via Recovery as an update.zip (something like the interface used by OpenRecovery available for Moto Droid/Milestone)

PLANNED FUTURE WORK

also at this point i would like to disclose some interesting news to everyone...

we.. DooMLoRD, MrHassell, Chumby_666, kxhawkins are working to create an amazing thing for our X10 based on this... basically we are planning to create an APP for this AND CUSTOMIZED RECOVERY WITH KERNEL MANAGER INTEGRATED so that u can select custom kernels right from recovery [no need to keep flashing zips ;) ]

THANK YOU ZDZIHU FOR RELEASING THE XRECOVERY SOURCES

MrHassell is planning to work out android APP related aspects

Chumby_666 & kxhawkins are planning to work out recovery menu integration aspects...

i will help them out whichever way i can...

Downloads are provided in POST #2 (below)...