Hello!
As some of you know, pvyParts and I have been working on a custom stock-based ROM, T.E.A.M., which was initially released as a themed ROM to offer transparency and replace the Theme Chooser that we haven't been able to port properly, giving endless options on custom backgrounds (since your wallpaper is the system background).
As the ROM evolved and custom kernels became available, I wanted to tweak it using init.d scripts.
As all good developers here do, I searched the Android Software and Hacking General section,
browsed other devices' forums and came up with some tweaks that were really good -on paper.
To my disappointment, most of these did not work.
And I am not saying this because I didn't "feel" a difference
or because I could not spread my X10's smoothness on a cracker.
There is actually a way to test if a script runs with no errors, a.k.a actually works.
Without further adieu, here is how:
1. Place the script you want to test (let's say test.sh)
in /system and give it all permissions,
either with Root Explorer or via adb:
Code:
adb shell chmod 777 /system/test.sh
NOTE: Sometimes scripts don't have an extension (sh).
It's OK, you can still test it with this method.
2. Now install an app like Script Manager and run the script.
Or, do it via adb:
Code:
adb shell sh /system/test.sh
3. Now there are 3 things you might face:
- If you get an error in return, it means the script doesn't work,
so no point in placing it in init.d and running it at every boot, right?
- Some scripts include debug, so you may get a message saying Done, Success, or whatever, which means you are good to go.
- You might not get any output at all, but still that means the script ran fine.
For the latter two cases, you can safely run the script at boot by placing it in init.d folder.
The reason this thread is in development, is because I feel that since the X10 is getting old and many developers have left,
(but luckily new ones still appear, which is plainly AWESOME ), quality of ROMs is very important.
We have fewer choices, so let's make them worthwhile!
Doing it right now.
BTW- I'm first! Again!
Prodigy said:
Doing it right now.
BTW- I'm first! Again!
Click to expand...
Click to collapse
Let us know how it went!
its good to see dev sharing their dev knowledge and skills. this will make more dev for x10. more dev, more improvement we can do on our phone. Thanks My Immortal / iridaki. you're awsome
Thank
cause script stress me well
Now i can see if work or not
X10-tripmiui,iris,00
so if my rom has a init.d folder, does it means it supports or run script (on init.d folder) at boot? is there a way to check if my rom has init.d support??
draiyan said:
so if my rom has a init.d folder, does it means it supports or run script (on init.d folder) at boot? is there a way to check if my rom has init.d support??
Click to expand...
Click to collapse
Yes, support at boot.
To my less knowledge, just look if there is a init. d folder in system/etc/
When you make an own rom check if the kernel you wanna use,has init. d support.
Hope I didn't talk crap and this is right
Sent from my X10i using Tapatalk
but im really confuse here, i found this script,
Code:
/etc/init.d/03sdcardspeedfix
at some line of this script, it reads;
READ_AHEAD_KB="2048"
Click to expand...
Click to collapse
i know some c++ programming, and from what i know the value 2048 is assigned to read_ahead_kb, so i assume its the same in android. BUT, after reboot, i jumped to
Code:
/sys/devices/virtual/bdi/179:0/read_ahead_kb
to found out that its still 128, then i started thinking that the script didnt run, but the dev says the rom is init.d supported.
is there a way to test if init.d is reallty working? like at terminal emulator?
sure man !
you have two way for run tweak
in install-recovery.sh
or ini.d folder
but for be sure
create a file in system/etc
name it "install-recovery.sh"
copy this in and give all permission.
#!/system/bin/sh
#Mount Points
busybox mount -o remount,rw,noatime,nodiratime / -t rootfs
busybox mount -o remount,rw,noatime,nodiratime /sys -t sysfs
busybox mount -o remount,rw,noatime,nodiratime /system
busybox mount -o remount,rw,noatime,nodiratime /data
busybox mount -o remount,rw,noatime,nodiratime /cache
#init.d support
busybox run-parts /system/etc/init.d
run-parts /system/etc/init.d >> /data/local/tmp/runparts.log 2>&1
now put your tweak in ini.d folder and reboot
be carefull !
if you have zipalign tweak
this tweak kill all tweak at boot because it unmount partition
and make it r/o instead of r/w
well,
tweak cannot access system or data like VM or sdcard tweak like read-ahead kb 2048.
now go in data/local/tmp
and check the log
to see if all it ok
but if ini.d does not run,
you could
insert tweak in install-recovery.sh
like this
#!/system/bin/sh
#give system permissions
busybox mount -o remount,rw /system
chmod 777 /system
#init.d support
busybox run-parts /system/etc/init.d
run-parts /system/etc/init.d >> /data/local/tmp/runparts.log 2>&1
#uncap fps
mount -t debugfs debugfs /sys/kernel/debug
echo '0' > /sys/kernel/debug/msm_fb/0/vsync_enable
#th config
echo '0' > /sys/kernel/debug/msm_fb/0/hw_vsync_mode
echo '0' > /sys/kernel/debug/msm_fb/0/sw_refreshing_enable
echo '2' > /sys/kernel/debug/msm_fb/0/ref_cnt
echo '8' > /sys/kernel/debug/msm_fb/0/backbuff
echo '6000' > /sys/kernel/debug/msm_fb/0/refx100
#echo '1' > /sys/power/wake_lock *dangerous
#echo '1' > /sys/kernel/debug/kgsl/cache_enable *dangerous
echo '8192' > /sys/block/mmcblk0/queue/read_ahead_kb
echo '128' > /sys/block/mmcblk0/queue/max_sectors_kb
echo '8192' > /sys/block/mmcblk1/queue/read_ahead_kb
echo '128' > /sys/block/mmcblk1/queue/max_sectors_kb
#rm -f -rf /data/idd
#rm -f -rf /data/semc-checkin
umount /sys/kernel/debug
echo 0 > /sys/kernel/logger/log_main/enable
echo 0 > /sys/kernel/logger/log_event/enable
echo 0 > /sys/kernel/logger/log_radio/enable
echo 1024 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo 1024 > /sys/devices/virtual/bdi/default/read_ahead_kb
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo 30 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential
echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load
# Delay the Media Scanner to help boot times
pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver &
sleep 80 && pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver &
#I/O Scheduler Tweaks
mount -o remount,noatime / -t rootfs
mount -o remount,noatime /dev -t devpts
mount -o remount,noatime /proc -t proc
mount -o remount,noatime /sys -t sysfs
mount -o remount,noatime /mnt/asec -t tmpfs
mount -o remount,noatime /system -t yaffs2
mount -o remount,noatime /data -t yaffs2
mount -o remount,noatime /cache -t yaffs2
mount -o remount,noatime /mnt/sdcard -t vfat
mount -o remount,noatime /mnt/secure/asec -t vfat
mount -o remount,noatime /mnt/sdcard/.android_secure -t tmpfs
i=`ls -d /sys/block/mtdblock3/queue/scheduler`;
STL=`ls -d /sys/block/stl*`;
BML=`ls -d /sys/block/bml*`;
MMC=`ls -d /sys/block/mmc*`;
TFSR=`ls -d /sys/block/tfsr*`;
DM=`ls -d /sys/block/dm*`;
MTD=`ls -d /sys/block/mtd*`;
LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
SYSDEV=`mount | grep '/system' | cut -d '/' -f 4`;
IO_SCHEDULER=`echo "noop" > /sys/block/mtdblock3/queue/scheduler/queue/rotational`;
for i in `busybox ls -1 /sys/block/mtdblock*`; do
echo "deadline" > $i/queue/scheduler;
done;
for k in $(busybox mount | cut -d " " -f3)
do
sync;
busybox mount -o remount,noatime,nodiratime $k;
done;
echo "deadline" > /sys/block/mmcblk0/queue/scheduler
echo "deadline" > /sys/block/dm-0/queue/scheduler
echo "deadline" > /sys/block/dm-1/queue/scheduler
for i in $MMC $MTD $LOOP; do
echo 0 > $i/queue/rotational;
done;
for i in $MMC $MTD; do
echo "deadline" > $i/queue/scheduler;
done;
for i in $MMC; do
echo 4096 > $i/queue/read_ahead_kb;
echo 0 > $i/queue/rotational;
echo 1 > $i/queue/iosched/low_latency;
echo 16 > $i/queue/iosched/quantum;
echo 8192 > $i/queue/nr_requests;
echo 1000000000 > $i/queue/iosched/back_seek_max;
for i in $STL $BML $MMC;
do
echo $IO_SCHEDULER > $i/queue/scheduler;
case $IO_SCHEDULER in
"deadline")
echo 1 > $i/queue/iosched/fifo_batch;;
"cfq")
echo 1 > $i/queue/iosched/back_seek_penalty;
echo 3 > $i/queue/iosched/slice_idle;;
"bfq")
echo 1 > $i/queue/iosched/back_seek_penalty;
echo 3 > $i/queue/iosched/slice_idle;;
"noop")
echo 1 > $i/queue/iosched/back_seek_penalty;
echo 3 > $i/queue/iosched/slice_idle;;
esac;
done;
#Dalvik Cache
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi
#Dalvik Cache
busybox chown 1000:1000 /cache/dalvik-cache
busybox chmod 0771 /cache/dalvik-cache
#bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache
busybox chown 1000:1000 /data/dalvik-cache
busybox chmod 0771 /data/dalvik-cache
#Remove
busybox rm -rf /data/tombstones/*
#Zipalign
mount -o remount,rw -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system
cd /system/app
for z in *.apk; do
zipalign -c 4 $z
if [ "$?" -ne "0" ]; then
echo zipalign $z !
zipalign -f 4 $z /tmp/$z
cp /tmp/$z $z
rm /tmp/$z
fi
done
mount -o remount,ro -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system
mount -o remount,rw -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /data
cd /data/app
for z in *.apk; do
zipalign -c 4 $z
if [ "$?" -ne "0" ]; then
echo zipalign $z !
zipalign -f 4 $z /tmp/$z
cp /tmp/$z $z
rm /tmp/$z
fi
done
mount -o remount,ro -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /data
#Phone Lag Tweaks
MAX_PHONE() {
pidphone=`pidof com.android.phone`;
if [ $pidphone ]; then
echo -17 > /proc/$pidphone/oom_adj;
renice -20 $pidphone;
exit;
else
sleep 5;
MAX_PHONE;
fi;
}
(while [ 1 ]; do
sleep 10;
MAX_PHONE;
done &);
if [ $ENABLE_MAXPHONE -eq 1 ];
then
PROC_ADJUST "com.android.phone" "-20" &
fi;
for j in $DM $MTD $LOOP $RAM; do
echo 0 > $j/queue/rotational;
done;
strace -p $(pidof yourapp) # for all your running applications
ps aux | awk '{print$10,$11}' | sort -n # will list all running softs sorted by used cpu time
#CPUTweak's Variables
last_source="unknown";
charging_source=$(cat /sys/class/power_supply/battery/charging_source);
capacity=$(cat /sys/class/power_supply/battery/capacity);
if [ $ENABLE_SWITCH -eq 1 ];
then
ALLFREQS=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies`;
(while [ 1 ];
do
cat /sys/power/wait_for_fb_wake;
AWAKE_MODE;
cat /sys/power/wait_for_fb_sleep;
SLEEP_MODE;
done &)
fi;
BAT_SLEEP_GOV="powersave"
USB_SLEEP_GOV="powersave"
POW_SLEEP_GOV="powersave"
#CPUTweak's Functions
Battery() {
(while [ 1 ]; do
if [ $AWAKE = "awake" ]; then
echo $BAT_AWAKE_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo 100000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo 100 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
AWAKE=
fi;
if [ $SLEEPING = "sleeping" ]; then
echo $BAT_SLEEP_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/up_threshold
echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/sampling_rate
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/powersave_bias
SLEEPING=
fi;
done &)
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3
}
USB() {
(while [ 1 ]; do
if [ $AWAKE = "awake" ]; then
echo $USB_AWAKE_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
AWAKE=
fi;
if [ $SLEEPING = "sleeping" ]; then
echo $USB_SLEEP_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/up_threshold
echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/sampling_rate
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/powersave_bias
SLEEPING=
fi;
done &)
}
Power() {
(while [ 1 ]; do
if [ $AWAKE = "awake" ]; then
echo $POW_AWAKE_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
AWAKE=
fi;
if [ $SLEEPING = "sleeping" ]; then
echo $POW_SLEEP_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/up_threshold
echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/sampling_rate
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/powersave_bias
SLEEPING=
fi;
done &)
}
#
# Loopy Smoothness Tweak for X10
#
for n in 1 2
do
USER_LAUNCHER="com.sonyericsson.home" # Change this to your launcher app
NUMBER_OF_CHECKS=35 # Total number of rechecks before ending 1st loop
SLEEP_TIME=3 # Number of seconds between rechecking processes
PROCESSES_TOTAL=4 # Must be edited to match the number of processes to be checked
DEBUG_ECHO=0 # Debug on/off
CHECK_COUNT=0 # Don't edit
P_CHECK=0 # Don't edit
CHECK_OK=0 # Unused
PROCESS_1=0; PROCESS_2=0; PROCESS_3=0; PROCESS_4=0; PROCESS_5=0; PROCESS_6=0;
PROCESS_7=0; PROCESS_8=0; PROCESS_9=0; PROCESS_10=0; PROCESS_11=0; PROCESS_12=0;
PROCESS_13=0; PROCESS_14=0; PROCESS_15=0; PROCESS_16=0; PROCESS_17=0; PROCESS_18=0;
PROCESS_19=0; PROCESS_20=0; PROCESS_21=0; PROCESS_22=0; PROCESS_23=0; PROCESS_24=0;
if [ $n -eq "1" ]; then
if [ $DEBUG_ECHO -eq "1" ]; then
echo ""
echo "LST Debug: $(date)"
echo "LST Debug: Initiate"
fi;
# Pause and then loop until kswapd0 is found, which should be instant anyway
sleep 1
SWAP_SLEEP_TIME=3; SWAP_NUMBER_OF_CHECKS=30; SWAP_CHECK_COUNT=0; SWAP_CHECK_COUNT_OK=0; while [ $SWAP_CHECK_COUNT -lt $SWAP_NUMBER_OF_CHECKS ]; do if [ `pidof kswapd0` ]; then renice 19 `pidof kswapd0`; SWAP_CHECK_COUNT=$SWAP_NUMBER_OF_CHECKS; SWAP_CHECK_COUNT_OK=1; else sleep $SWAP_SLEEP_TIME; fi; SWAP_CHECK_COUNT=`expr $SWAP_CHECK_COUNT + 1`; done; if [ $SWAP_CHECK_COUNT_OK -lt 1 ]; then echo "LST Debug: 'kswapd0' expired after `expr $SWAP_CHECK_COUNT \* $SWAP_SLEEP_TIME` seconds"; fi;
if [ $DEBUG_ECHO -eq "1" ]; then
echo "LST Debug: $(date)";
echo "LST Debug: kswapd0 found";
fi;
fi;
# Check briefly one more time
if [ $n -eq "2" ]; then
if [ $DEBUG_ECHO -eq "1" ]; then
echo "LST Debug: 2nd loop"
fi;
NUMBER_OF_CHECKS=6 # Editing not recommended
SLEEP_TIME=5 # Editing not recommended
fi;
while [ $CHECK_COUNT -lt $NUMBER_OF_CHECKS ];
do
# Resident system apps
if [ $PROCESS_1 -eq "0" ]; then PNAME="com.android.phone"; NICELEVEL=-20; if [ `pidof $PNAME` ]; then renice $NICELEVEL `pidof $PNAME`; PROCESS_1=1; P_CHECK=`expr $P_CHECK + 1`; fi; fi;
if [ $PROCESS_2 -eq "0" ]; then PNAME="$USER_LAUNCHER"; NICELEVEL=-19; if [ `pidof $PNAME` ]; then renice $NICELEVEL `pidof $PNAME`; PROCESS_2=1; P_CHECK=`expr $P_CHECK + 1`; fi; fi;
if [ $PROCESS_3 -eq "0" ]; then PNAME="com.sonyericsson.conversations"; NICELEVEL=-19; if [ `pidof $PNAME` ]; then renice $NICELEVEL `pidof $PNAME`; PROCESS_3=1; P_CHECK=`expr $P_CHECK + 1`; fi; fi;
if [ $PROCESS_4 -eq "0" ]; then PNAME="com.sonyericsson.music"; NICELEVEL=-19; if [ `pidof $PNAME` ]; then renice $NICELEVEL `pidof $PNAME`; PROCESS_4=1; P_CHECK=`expr $P_CHECK + 1`; fi; fi;
# If all processes are done, loop can finish early
if [ $P_CHECK -ge $PROCESSES_TOTAL ]; then CHECK_COUNT=$NUMBER_OF_CHECKS; else sleep $SLEEP_TIME; fi;
CHECK_COUNT=`expr $CHECK_COUNT + 1`;
done
if [ $DEBUG_ECHO -eq "1" ]; then
echo "LST Debug: $(date)"
if [ $PROCESS_1 -eq "0" ]; then echo "LST Debug: PROCESS_1 expired after `expr $CHECK_COUNT \* $SLEEP_TIME` seconds"; fi;
if [ $PROCESS_2 -eq "0" ]; then echo "LST Debug: PROCESS_2 expired after `expr $CHECK_COUNT \* $SLEEP_TIME` seconds"; fi;
if [ $PROCESS_3 -eq "0" ]; then echo "LST Debug: PROCESS_3 expired after `expr $CHECK_COUNT \* $SLEEP_TIME` seconds"; fi;
if [ $PROCESS_3 -eq "0" ]; then echo "LST Debug: PROCESS_3 expired after `expr $CHECK_COUNT \* $SLEEP_TIME` seconds"; fi;
echo "LST Debug: Checking complete"
fi;
done
if [ $DEBUG_ECHO -eq "1" ]; then
echo "LST Debug: Done"
echo ""
fi;
this is an exemple!
but you could use it !
it improve speed of your phone hahaha !!!
bip
i tried install-recovery but i got no file at local/temp??? there should be a log file in it rigth?
Another tip - add this command to the top of the script:
Code:
set -xv
This will give full command echoing when you run the script so you can see where the error is. The android shell doesn't report lines accurately, I think it's because it doesn't count comments as lines. It will also make easily visible syntax errors that dont error but cause a conditional to report incorrect, e.g. if you accidentally use == instead of = or forget double-quotes when comparing strings.
some kernel app can download and flash boot.img, restarts, how can I do that in terminal? (without the need of adb or Recovery... save hell lots of time)
I'm afraid thats impossible.
kurotsugi said:
I'm afraid thats impossible.
Click to expand...
Click to collapse
so this are dark magic?
Code:
#!/sbin/bb/busybox ash
# lkflash - flash latest leanKernel
#
# author - [email protected]
#
BB="/sbin/bb/busybox"
STABLE="http://imoseyon.host4droid.com/latest"
EXP180="http://imoseyon.host4droid.com/exp/latest180"
EXP230="http://imoseyon.host4droid.com/exp/latest230"
CUR=`$BB uname -a | $BB awk -F'-' '{ print \$3 }'`
while [ 1 ]; do
echo
echo "leanKernel flasher"
echo "------------------"
echo "1) latest stable (recommended)"
echo "2) latest experimental 180mhz-1.65ghz (notrim)"
echo "3) latest experimental 230mhz-1.65ghz (notrim)"
echo "4) check/display versions"
echo "9) latest stable franco (warning: no md5 check)"
echo
echo "FLASH AT YOUR OWN RISK. I'm not responsible for my mistakes or yours. ;)"
echo
echo -n "Please enter a number between 1 and 4 (or press enter to exit): "
read option
case $option in
1)
$BB wget -q -O /sdcard/lk $STABLE
echo; echo -n "Downloading stable "
break
;;
2)
$BB wget -q -O /sdcard/lk $EXP180
echo; echo -n "Downloading experimental 180mhz (notrim) "
break
;;
3)
$BB wget -q -O /sdcard/lk $EXP230
echo; echo -n "Downloading experimental 230mhz (notrim) "
break
;;
4)
echo "Please wait..."
vstable=`$BB wget -q -O - $STABLE | $BB awk '{ print \$3 }'`
v180=`$BB wget -q -O - $EXP180 | $BB awk '{ print \$3 }'`
v230=`$BB wget -q -O - $EXP230 | $BB awk '{ print \$3 }'`
echo; echo ">>> Current version: $CUR, Latest stable: $vstable, Exp: $v180 $v230"
sleep 2
;;
9)
$BB wget -q -O /sdcard/fboot.img http://minooch.com/franciscofranco/Galaxy%20Nexus/nightlies/appfiles/boot.img
$BB dd if=/sdcard/fboot.img of=/dev/block/platform/omap/omap_hsmmc.0/by-name/boot 2> /dev/null
echo "Latest Franco Kernel flashed. Reboot when you're ready."
exit
;;
*)
echo "BYE"
exit
;;
esac
done
[ ! -s "/sdcard/lk" ] && exit
MD5=`$BB awk '{ print \$2 }' /sdcard/lk`
VER=`$BB awk '{ print \$3 }' /sdcard/lk`
if [ "$CUR" == "$VER" ]; then
echo
echo "Aborted. You're already running $CUR."
exit
fi
echo "v$VER. Please wait..."
$BB wget -q -O /sdcard/lkboot.img `$BB awk '{ print \$1 }' /sdcard/lk`
[ ! -s "/sdcard/lkboot.img" ] && exit
SUM=`$BB md5sum /sdcard/lkboot.img | $BB awk '{ print \$1 }'`
echo
if [ "$MD5" == "$SUM" ]; then
echo "Download finished. Checksum verified. Flashing kernel to boot partition..."
$BB dd if=/sdcard/lkboot.img of=/dev/block/platform/omap/omap_hsmmc.0/by-name/boot 2> /dev/null
echo; echo "leanKernel $VER flashed! Reboot when you're ready to run new kernel."
else
echo "md5sum check failed - please try again."
fi
Re: [MOD] Full Linux (Debian) inside WebTop! v0.2.7
I managed to unlock, root and install WebTopMOD on my new2me searet Atrix 4g. Great feeling for an android n00b! I can run iceweasel, gimp and whatever I like just like any linux distro on the webtop as long as I start a new shell to launch linux apps. I had wanted to continue on to using the instructions in post #865 by jissee44 to get the xfce4 window manager running. No luck! I can launch (I think) xfce4 manually and the entire view changes - new wallpaper, new toolbar, but no access to the linux filesystem - everything connects to the android filesystem.
Here is what I think is needed to see what went wrong. There are only two files to edit when following post #865. I am including the entire file as the posting I was following does not include diffs.
/osh/usr/sbin/linux
Code:
#!/bin/bash
CHROOTDIR="/osh/opt/WebTopMOD/root"
LOOPDEVICE="/dev/block/loop50"
function enablex {
xhost +
}
function mountlinuxdisk {
loopdevice
sudo mount -t ext3 -o loop=$LOOPDEVICE $FILENAME $CHROOTDIR
touch /tmp/linuxdiskactive
}
function umountlinuxdisk {
sudo umount $CHROOTDIR
sudo umount $LOOPDEVICE
rm /tmp/linuxdiskactive
}
function startfulllinuxchroot {
mountlinuxdisk
sudo mount -o bind /proc $CHROOTDIR/proc
sudo mount -o bind /dev $CHROOTDIR/dev
sudo mount -o bind /dev/pts $CHROOTDIR/dev/pts
sudo mount -o bind /dev/shm $CHROOTDIR/dev/shm
#sudo mount -o bind /proc/bus/usb $CHROOTDIR/proc/bus/usb
sudo mount -o bind /sys $CHROOTDIR/sys
sudo mount -o bind /tmp $CHROOTDIR/tmp
sudo mount -o bind /var/tmp $CHROOTDIR/var/tmp
sudo mount -o bind /var/run/dbus/ $CHROOTDIR/var/run/dbus
sudo mount -t vfat /dev/block/vold/179:18 $CHROOTDIR/sdcard
sudo mount -t vfat /dev/block/vold/179:33 $CHROOTDIR/sdcard-ext
sudo mount -o bind /etc $CHROOTDIR/mnt/DEVICE/etc
sudo mount -o bind /usr $CHROOTDIR/mnt/DEVICE/usr
touch /tmp/fulllinuxchrootactive
}
function startxterm {
# sudo chroot $CHROOTDIR /usr/bin/xterm pdmenu
sudo chroot $CHROOTDIR /usr/bin/xterm
}
function startxfce {
kill $(ps -ef | grep 5000 | grep webtop-wallpaper | cut -c10-15)
kill $(ps -ef | grep 5000 | grep xscreensaver | cut -c10-15
sudo chroot $CHROOTDIR /usr/bin/xfce4-session
}
function stopfullchroot {
CHECKS=0
until [ "$CHECKS" -eq "15" ]
do
TOUMOUNT=`sudo mount | grep "$CHROOTDIR" | awk '{ print $3 }'`
if [ "$TOUMOUNT" = "" ]; then break; fi
for i in $TOUMOUNT
do
sudo umount $i
done
CHECKS=$(( $CHECKS + 1 ))
done
rm /tmp/fulllinuxchrootactive
mountlinuxdisk
}
function checkwhereislinux {
if [ -e /sdcard/WebTopMOD/linuxdisk ]; then
FILENAME="/sdcard/WebTopMOD/linuxdisk"
if [ "$1" -eq 1 ]; then
/usr/bin/xmessage "Found image in /sdcard/WebTopMOD/linu
xdisk!"
checklinuxdisk
fi
else
if [ -e /sdcard-ext/WebTopMOD/linuxdisk ]; then
FILENAME="/sdcard-ext/WebTopMOD/linuxdisk"
if [ "$1" -eq 1 ]; then
/usr/bin/xmessage "Found image in /sdcard-ext/We
bTopMOD/linuxdisk!"
checklinuxdisk
fi
else
if [ "$1" -eq 1 ]; then
/usr/bin/xmessage "Sorry, no image available...
put linuxdisk in /sdcard/WebTopMOD/ OR /sdcard-ext/WebTopMOD/linuxdisk"
exit 1
fi
fi
fi
}
function checklinuxdisk {
if [ ! -s $FILENAME ]; then
/usr/bin/xmessage "But... Wait... Your disk looks damaged, maybe
you tried to copy an image larger then 4gB? This is a FAT32 limit."
exit 1
fi
if [ -d $FILENAME ]; then
/usr/bin/xmessage "Damn! linuxdisk is a file and it MUST be plac
ed in /sdcard/WebTopMOD/ OR /sdcard-ext/WebTopMOD/ folder. Otherwise this mod CA
N'T work' "
exit 1
fi
}
function loopdevice {
if [ -e $LOOPDEVICE ]; then
echo "Device exist"
else
sudo mknod -m600 $LOOPDEVICE b 7 50
fi
}
enablex
if [ -e /tmp/linuxdiskactive ]; then
if [ -e /tmp/fulllinuxchrootactive ]; then
startxterm
else
checkwhereislinux 0
startfulllinuxchroot
startxterm
fi
else
checkwhereislinux 1
mountlinuxdisk
startfulllinuxchroot
startxfce
# startxterm
fi
#RUNNINGXTERM=`ps -C xterm h | wc -l`
#if [ "$RUNNINGXTERM" -eq 0 ]
#then
# stopfullchroot
# umountlinuxdisk
#fi
exit 0
/osh/usr/local/bin/start-oshwt-2.sh
Code:
#! /bin/sh
### BEGIN INIT INFO
# Provides: start_lxde2.sh
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: started by adas user at login
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
. /lib/lsb/init-functions
log_action_msg "Will now start OSHWT 2 scripts"
# start OSHWT 2 scripts
sfalv -i "lxpanel"
#sfalv -i "awn-autostart"
sfalv -i "webtop-panel"
sfalv -i "webtop-wallpaper"
sfalv -i "evbridge"
sfalv -i "window_switcher"
sr-test avahi_start &
Can someone give me some clues as to what has gone wrong? I'm not sure if something is missing or if I broke something in my edits, and there are no follow up questions on the post. There are 13 thanks.
ruarri
making progress?
Okay, I'm just hearing the crickets.
> startxfce4
provides some of the results I want, but leaves AWN in control. Now that the new ICS ROMs are coming out I'll have to see if I can just make webtopMOD usable until something better comes along. It would be good to see better documentation for n00bs. The forums are a little rambling. There is a lot of good info, its just scattered.
ruarri
ruarri said:
no access to the linux filesystem - everything connects to the android filesystem.
Click to expand...
Click to collapse
Hi,
What do you mean ?
The Debian is a Chroot
Good'nough
jisse44 said:
The Debian is a Chroot
Click to expand...
Click to collapse
Thanks for the terse explanation, jisse44. It took me a while to get around to reading the docs on chroot. It makes sense that webtop isrunning in a sandbox. That is inherently limiting.
I still love webtop and my lapdock. It will be interesting to see what happens with webtop and the ICS ROMs on the Atrix 4G.
ruarri said:
It will be interesting to see what happens with webtop and the ICS ROMs on the Atrix 4G.
Click to expand...
Click to collapse
Or not....
By now you can only run last new "webtop" on ICS Roms, and this is not THE webtop, it's a tablet mode: no Ubuntu or debian, only Android....
I want to make app symlinks to sd-ext on booting.
I made a short init.d script, And It correctly worked on JB based rom.
But after I downgraded to GB, It doesn't work anymore.
I founded that pure bone shell doesn't support arrays.
The script uses string array to declare apk list I want to symlink.
So is there a way to use string array or make similar effect?
Here is my script.
Code:
#!/system/bin/sh
if [ -z "$SD_EXT_DIRECTORY" ]; then SD_EXT_DIRECTORY=/sd-ext; fi
SYSBLOCK=`mount | grep system | cut -f 1 -d ' '`
sysapp2sd=("BackupRestoreConfirmation.apk" "BasicDreams.apk" "Bluetooth.apk" "CertInstaller.apk" "Calculator.apk" "CMFileManager.apk" "CMScreenshot.apk" "DSPManager.apk" "DrmProvider.apk" "Email.apk" "Email2.apk" "Exchange.apk" "Exchange2.apk" "Gmail.apk" "GoogleBackupTransport.apk" "InputDevices.apk" "Music.apk" "OneTimeInitializer.apk" "PhotoTable.apk" "PicoTts.apk" "SamsungTTS.apk" "SharedStorageBackup.apk" "SoundRecorder.apk" "Talk.apk" "ThemeChooser.apk" "ThemeManager.apk" "Torch.apk" "VpnDialogs.apk" "WAPPushManager.apk")
app2sd_exception=("com.UCMobile" "com.adobe.flashplayer" "com.android.lmt" "com.fiberthemax.OpQ2keyboard" "com.fiberthemax.OpQ2keyboard.dict.ko" "com.google.android.gms" "com.google.android.googlequicksearchbox" "com.jungsup.thecall" "com.mobint.hololauncher" "com.mobint.hololauncherplus" "com.mobitobi.android.gentlealarm" "com.myhome.mytheme" "com.rs.autorun" "com.teslacoilsw.launcher" "com.vladlee.callconfirm.free" "eu.chainfire.supersu" "kz.mek.DialerOne" "me.dennis.weather.naver" "net.dinglisch.android.taskerm" "net.everythingandroid.smspopup" )
# make sure $SD_EXT_DIRECTORY is actually mounted
if ! awk -vDIR="$SD_EXT_DIRECTORY" '$2 == DIR { exit 1; }' /proc/mounts ; then
mount -rw -o remount SYSBLOCK /system
mkdir -p /sd-ext/symlink/system/app
# /system/app/ -> /sd-ext/symlink/system/app/
FILES=`find /system/app -maxdepth 1 -type f`
for file in $FILES; do
filename=`basename $file`
for pattern in ${sysapp2sd[@]}; do
if [[ $filename == $pattern ]]; then
cp /system/app/$filename /sd-ext/symlink/system/app/
rm -f /system/app/$filename
ln -s /sd-ext/symlink/system/app/$filename /system/app/$filename
fi
done
done
# /data/app/ -> /sd-ext/symlink/data/app/
FILES=`find /data/app -maxdepth 1 -type f`
for file in $FILES; do
filename=`basename $file`
match=false
for pattern in ${app2sd_exception[@]}; do
if [[ $filename == $pattern* ]]; then
match=true
fi
done
if ! $match; then
cp /data/app/$filename /sd-ext/symlink/data/app/
rm -f /data/app/$filename
ln -s /sd-ext/symlink/data/app/$filename /data/app/$filename
fi
done
mount -r -o remount SYSBLOCK /system
fi
You can use echo or cat command to wrap list and grab it with awk.
and add another for loop over for loop for getting the counted numbers to be used on awk...
Hello XDA Community!
Someone can rewrite this ramdisk hijack to work with CM12.1 and 13 on Xperia Z1 Compact? Because I'm a noob. Thanks the answers in advance.
#!/temp/sh*
set +x*
_PATH="$PATH"*
export PATH="/temp:/system/xbin:/system/bin:/sb
in"*
LED_RED="/sys/class/leds/lm3533-red/brig
htness"*
LED_BLUE="/sys/class/leds/lm3533-blue/br
ightness"*
LED_GREEN="/sys/class/leds/lm3533-green/
brightness"*
boot_recovery (){*
mount -o remount,rw /*
cd /*
export TZ="$(getprop persist.sys.timezone)"*
/system/bin/time_daemon*
sleep 5*
kill -9 $(ps | grep time_daemon | grep -v grep | awk -F' ' '{print $1}')*
for SVCRUNNING in $(getprop | grep -E '^\[init\.svc\..*\]: \[running\]' | grep -v ueventd)*
do*
SVCNAME=$(expr ${SVCRUNNING} : '\[init\.svc\.\(.*\)\]:.*')*
stop ${SVCNAME}*
done*
for RUNNINGPRC in $(ps | grep /system/bin | grep -v grep | grep -v chargemon | awk '{print $1}' )*
do*
kill -9 $RUNNINGPRC*
done*
for RUNNINGPRC in $(ps | grep /sbin/ | grep -v grep | awk '{print $1}' )*
do*
kill -9 $RUNNINGPRC*
done*
rm -r /sbin*
rm sdcard etc init* uevent* default**
echo on init > /tz.conf*
echo export TZ "$(getprop persist.sys.timezone)" >> /tz.conf*
chmod 750 /tz.conf*
tar cf /zoneinfo.tar /system/usr/share/zoneinfo*
}*
boot_rom () {*
mount -o remount,rw rootfs /*
cd /*
# Stop services*
ps a > /temp/log/pre_ps.txt*
#ps a > /dev/kmsg*
#mount > /dev/kmsg*
#ls -laR /temp > /dev/kmsg*
for SVCNAME in $(getprop | grep -E '^\[init\.svc\..*\]: \[running\]' | sed 's/\[init\.svc\.\(.*\)\]:.*/\1/g;')*
do*
stop $SVCNAME*
done*
for RUNNINGPRC in $(ps | grep /system/bin | grep -v grep | grep -v chargemon | awk '{print $1}' )*
do*
kill -9 $RUNNINGPRC*
done*
for RUNNINGPRC in $(ps | grep /sbin | grep -v grep | awk '{print $1}' )*
do*
kill -9 $RUNNINGPRC*
done*
sync*
kill -9 $(ps | grep suntrold | grep -v "grep" | awk -F' ' '{print $1}')*
kill -9 $(ps | grep iddd | grep -v "grep" | awk -F' ' '{print $1}')*
ps a > /temp/log/post_ps.txt*
#ps a > /dev/kmsg*
# umount*
mount > /temp/log/pre_umount.txt*
umount -l /system/odex*
umount -l /system/odex.app.sqsh*
umount -l /system/odex.priv-app.sqsh*
umount -l /system/odex.app*
umount -l /dev/block/loop0*
umount -l /system/odex.priv-app*
umount -l /dev/block/loop1*
## /boot/modem_fs1*
umount -l /dev/block/platform/msm_sdcc.1/by-name/m
odemst1*
umount -l /dev/block/mmcblk0p18*
umount -l /dev/block/platform/msm_sdcc.1/by-name/m
9kefs1*
## /boot/modem_fs2*
umount -l /dev/block/platform/msm_sdcc.1/by-name/m
odemst2*
umount -l /dev/block/mmcblk0p19*
umount -l /dev/block/platform/msm_sdcc.1/by-name/m
9kefs2*
## /boot/modem_fsg*
umount -l /dev/block/mmcblk0p20*
umount -l /dev/block/platform/msm_sdcc.1/by-name/m
9kefs3*
## /system*
umount -l /dev/block/mmcblk0p24*
umount -l /dev/block/platform/msm_sdcc.1/by-name/s
ystem*
## /data*
umount -l /dev/block/mmcblk0p26*
umount -l /dev/block/platform/msm_sdcc.1/by-name/u
serdata*
## /mnt/idd*
#umount -l /dev/block/mmcblk0p10*
## /cache*
umount -l /dev/block/mmcblk0p25*
umount -l /dev/block/platform/msm_sdcc.1/by-name/c
ache*
## /lta-label*
umount -l /dev/block/mmcblk0p16*
## /sdcard (External)*
#umount -l /dev/block/mmcblk1p15*
#umount -l /dev/block/platform/msm_sdcc.1/by-name/S
DCard*
umount -l /dev/block/mmcblk0p22*
sync*
umount -l /mnt/idd*
umount -l /dev/block/platform/msm_sdcc.1/by-name/a
pps_log*
umount -l /data/idd*
umount -l /cache*
umount -l /lta-label*
umount -l /persist*
umount -l /etc*
umount -l /data/tombstones*
umount -l /tombstones*
umount -l /vendor*
umount -l /system*
umount -l /data*
## SDcard*
# Internal SDcard umountpoint*
umount -l /sdcard*
umount -l /mnt/sdcard*
umount -l /mnt/int_storage*
umount -l /storage/sdcard0*
# External SDcard umountpoint*
umount -l /sdcard1*
umount -l /ext_card*
umount -l /storage/sdcard1*
umount -l /devices/platform/msm_sdcc.3/mmc_host*
# External USB umountpoint*
umount -l /mnt/usbdisk*
umount -l /usbdisk*
umount -l /storage/usbdisk*
umount -l /devices/platform/msm_hsusb_host*
# legacy folders*
umount -l /storage/emulated/legacy/Android/obb*
umount -l /storage/emulated/legacy*
umount -l /storage/emulated/0/Android/obb*
umount -l /storage/emulated/0*
umount -l /storage/emulated*
umount -l /storage/removable/sdcard1*
umount -l /storage/removable/usbdisk*
umount -l /storage/removable*
umount -l /storage*
umount -l /mnt/shell/emulated/0*
umount -l /mnt/shell/emulated*
umount -l /mnt/shell*
## misc*
umount -l /mnt/obb*
umount -l /mnt/asec*
umount -l /mnt/qcks*
umount -l /mnt/secure/staging*
umount -l /mnt/secure*
umount -l /mnt*
umount -l /acct*
umount -l /dev/cpuctl*
umount -l /dev/pts*
umount -l /dev/socket*
umount -l /dev/fuse*
umount -l /tmp*
umount -l /dev*
umount -l /sys/fs/cgroup*
umount -l /sys/fs/selinux*
umount -l /sys/kernel/debug*
umount -l /d*
umount -l /sys*
umount -l /proc*
sync*
mount > /temp/log/post_umount.txt*
#/temp/busybox mount > /dev/kmsg*
# clean /*
cd /*
rm -r /sbin*
rm -r /storage*
rm -r /mnt*
rm -f sdcard sdcard1 ext_card init**
/temp/busybox echo "====== Hijack: ls ======" > /dev/kmsg*
ls -laR > /temp/log/post_clean_ls.txt*
#/temp/busybox ls -laR > /dev/kmsg*
}*
for EVENTDEV in $(ls /dev/input/event*)*
do*
SUFFIX="$(expr ${EVENTDEV} : '/dev/input/event\(.*\)')"*
cat ${EVENTDEV} > /temp/keyevent${SUFFIX} &*
done*
sleep 3*
for CATPROC in $(ps | grep cat | grep -v grep | awk '{print $2;}')*
do*
kill -9 ${CATPROC}*
done*
sleep 1*
hexdump /temp/keyevent* | grep -e '^.* 0001 0073 .... ....$' > /temp/keycheck_up*
hexdump /temp/keyevent* | grep -e '^.* 0001 0072 .... ....$' > /temp/keycheck_down*
# vol-, boot recovery*
if [ -s /temp/keycheck_down -o -e /cache/recovery/boot ]*
then*
# Show red led*
echo '0' > $LED_BLUE*
echo '0' > $LED_GREEN*
echo '255' > $LED_RED*
sleep 1*
# turn off leds*
echo '0' > $LED_BLUE*
echo '0' > $LED_GREEN*
echo '0' > $LED_RED*
echo "====== Hijack: boot recovery ======" > /dev/kmsg*
# Return path variable to default*
export PATH="${_PATH}"*
sleep 1*
exec /system/bin/chargemon*
elif [ -e /temp/hijacked ]*
then*
rm /temp/hijacked*
# Return path variable to default*
export PATH="${_PATH}"*
sleep 1*
exec /system/bin/taimport.orig*
else*
echo "====== Hijack: boot ramdisk ======" > /dev/kmsg*
# Show blue led*
echo '255' > $LED_BLUE*
echo '0' > $LED_GREEN*
echo '0' > $LED_RED*
sleep 1*
# turn off leds*
echo '0' > $LED_BLUE*
echo '0' > $LED_GREEN*
echo '0' > $LED_RED*
touch /temp/hijacked*
boot_rom*
cd /*
cpio -idu < /temp/ramdisk.cpio*
sync*
sleep 2*
cp /temp/ramdisk/* /*
cp /temp/ramdisk/sbin/* /sbin*
#dmesg > /temp/log/post_hijack_dmesg.txt*
ls -laR > /temp/log/post_hijack_ls.txt*
chroot / /init*
sleep 3*
fi
ThePS4Gamer