[XPERIA X10 Android Development] DooMLoRD:
hi anders260... v0.2 is ready and is being tested by me... will release it soon for public testing...

will provide 3 custom kernels (Z's FreeKernel, J's FreeXperia Kernel k006, T's modified kernel) for this phase of testing...

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...

will be including FreeXperia recovery into the kernelmanager package so as to not disturb current recovery...

backup of current chargemon will be taken which can be restored later...

option to take backup of current ROMs stock modules...

a little glimpse of wht to expect...

#
# DooMLoRD: Kernel Manager for X10 (v0.2)
# FILE: activate_kernel.sh
#

echo
echo "---[START PROGRAM]---"

# defining VARS
KERNELNAME="FK_A1_Z"
PROGNAME="activate_kernel"
LOGFILENAME="km_log_$PROGNAME_$KERNELNAME.txt"
LOGFILEPATH="/data/local/tmp/$LOGFILENAME"
KMPATH="/system/kernelmanager"
KERNELPATH="$KMPATH/kernel_files/$KERNELNAME"

# removing log file
if [ -e $LOGFILEPATH ]
then
rm $LOGFILEPATH
fi

echo
echo "PROGRAM NAME: $PROGNAME"

echo "-----[START LOG]-----" >> $LOGFILEPATH 2>> $LOGFILEPATH

echo >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "PROGRAM NAME: $PROGNAME" >> $LOGFILEPATH 2>> $LOGFILEPATH

echo >> $LOGFILEPATH 2>> $LOGFILEPATH
date >> $LOGFILEPATH 2>> $LOGFILEPATH

# mount/remount commands
echo
echo >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "<< MOUNT / REMOUNT >>"
echo "<< MOUNT / REMOUNT >>" >> $LOGFILEPATH 2>> $LOGFILEPATH
echo
echo >> $LOGFILEPATH 2>> $LOGFILEPATH

CURMNT=`mount | busybox grep /system | busybox awk '{print $4}'`

# Checking current system mount mode and remounting as RW if required
echo "Checking current system mount mode and remounting as RW if required" >> $LOGFILEPATH 2>> $LOGFILEPATH
case $CURMNT in
rw*)
echo "System mounted as RW" >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "Checking System mount state" >> $LOGFILEPATH 2>> $LOGFILEPATH
mount | busybox grep /system | busybox awk '{print $4}' >> $LOGFILEPATH 2>> $LOGFILEPATH
;;
ro*)
echo "System mounted as RO" >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "Checking System mount state" >> $LOGFILEPATH 2>> $LOGFILEPATH
mount | busybox grep /system | busybox awk '{print $4}' >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "then system will be remounted as RW" >> $LOGFILEPATH 2>> $LOGFILEPATH
mount -o remount,rw -t yaffs2 `mount | busybox grep /system | busybox awk '{print $1}'` /system >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "Checking System mount state" >> $LOGFILEPATH 2>> $LOGFILEPATH
mount | busybox grep /system | busybox awk '{print $4}' >> $LOGFILEPATH 2>> $LOGFILEPATH
;;
esac

echo >> $LOGFILEPATH 2>> $LOGFILEPATH
# DOING SOME WORK
echo
echo >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "<< ACTIVATING CUSTOM KERNEL: $KERNELNAME >>"
echo "<< ACTIVATING CUSTOM KERNEL: $KERNELNAME >>" >> $LOGFILEPATH 2>> $LOGFILEPATH
echo
echo >> $LOGFILEPATH 2>> $LOGFILEPATH

echo "COPYING FILES TO SYSTEM"
echo "COPYING FILES TO SYSTEM" >> $LOGFILEPATH 2>> $LOGFILEPATH
#echo "COPYING ALL FILES" >> $LOGFILEPATH 2>> $LOGFILEPATH
#cp -r -p $KERNELPATH/system/* /system/. >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "COPYING boot.img" >> $LOGFILEPATH 2>> $LOGFILEPATH
cp -p $KERNELPATH/system/kernel/boot.img /system/kernel/boot.img >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "COPYING wifi.ko" >> $LOGFILEPATH 2>> $LOGFILEPATH
cp -p $KERNELPATH/system/lib/modules/wifi.ko /system/lib/modules/wifi.ko >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "Fixing permissions" >> $LOGFILEPATH 2>> $LOGFILEPATH
busybox chmod 644 /system/lib/modules/wifi.ko >> $LOGFILEPATH 2>> $LOGFILEPATH
busybox chmod 644 /system/kernel/boot.img >> $LOGFILEPATH 2>> $LOGFILEPATH

echo "COPYING IDENTIFIER"
echo "COPYING IDENTIFIER" >> $LOGFILEPATH 2>> $LOGFILEPATH
cp -p $KERNELPATH/identifier /system/kernel/identifier >> $LOGFILEPATH 2>> $LOGFILEPATH

echo
echo >> $LOGFILEPATH 2>> $LOGFILEPATH

# mount/remount commands
echo
echo >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "<< MOUNT / REMOUNT >>"
echo "<< MOUNT / REMOUNT >>" >> $LOGFILEPATH 2>> $LOGFILEPATH
echo
echo >> $LOGFILEPATH 2>> $LOGFILEPATH

# remounting system to ORIGINAL mount mode
echo "remounting system to ORIGINAL mount mode" >> $LOGFILEPATH 2>> $LOGFILEPATH
case $CURMNT in
rw*)
echo "System was already mounted as RW... Nothing to do..." >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "Checking System mount state" >> $LOGFILEPATH 2>> $LOGFILEPATH
mount | busybox grep /system | busybox awk '{print $4}' >> $LOGFILEPATH 2>> $LOGFILEPATH
;;
ro*)
echo "Remounting system as RO" >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "Checking System mount state" >> $LOGFILEPATH 2>> $LOGFILEPATH
mount | busybox grep /system | busybox awk '{print $4}' >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "Remounting System" >> $LOGFILEPATH 2>> $LOGFILEPATH
mount -o remount,ro -t yaffs2 `mount | busybox grep /system | busybox awk '{print $1}'` /system >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "Checking System mount state" >> $LOGFILEPATH 2>> $LOGFILEPATH
mount | busybox grep /system | busybox awk '{print $4}' >> $LOGFILEPATH 2>> $LOGFILEPATH
;;
esac

echo >> $LOGFILEPATH 2>> $LOGFILEPATH
echo "-----[DONE LOG]-----" >> $LOGFILEPATH 2>> $LOGFILEPATH

echo "---[DONE PROGRAM]---"
echo
echo "LOG file at: $LOGFILEPATH"
echo
echo
echo "DISPLAYING LOG"
echo
cat $LOGFILEPATH
echo

thank you rdannar!