Link Search Menu Expand Document

Cyanogenmod

fastboot Volume Down + Power install Recovery 6.0.1.0_r1

recovery Volume Up + Power install cyanogenmod 9-20121102-NIGHTLY

battery

HB5K1H 3.7V 1400mAh (5.2Wh) 18287-2000

Configs

mount -o remount,rw /system

# move tmp to /sdcard
rm -rf /data/local/tmp
ln -s /sdcard/tmp /data/local/tmp


# enable adb over wifi
setprop persist.adb.tcp.port 5555


# original sysinit
cat << EOF > /system/bin/sysinit
#!/system/bin/sh

export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
/system/bin/logwrapper /system/xbin/run-parts /system/etc/init.d 
EOF
chmod 777 /system/bin/sysinit


# replace sysinit, we need background task support '&'
cat << 'EOF' > /system/bin/sysinit
#!/system/bin/sh

export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
for I in /system/etc/init.d/*; do
 $I
done
EOF
chmod 777 /system/bin/sysinit

Dalvik cache

# move dalvik cache all apps to sdcard except framework
cd /data/dalvik-cache && find . -name 'data*' -o -name 'mnt*' -o -name 'system@app*' -type f | while read dex; do cp "$dex" "/sdcard/dalvik-cache/$dex" && rm -f "/data/dalvik-cache/$dex" && ln -s "/sdcard/dalvik-cache/$dex" "/data/dalvik-cache/$dex"; done

# move dalvik cache to /sdcard for apps only
cd /data/dalvik-cache && find . -name 'system@app*' -type f | while read dex; do cp "$dex" "/cache/dalvik-cache/$dex" && rm -f "/data/dalvik-cache/$dex" && ln -s "/cache/dalvik-cache/$dex" "/data/dalvik-cache/$dex"; done

cd /data/dalvik-cache && find . -name 'data*' -o -name 'mnt*' -type f | while read dex; do cp "$dex" "/cache/dalvik-cache/$dex" && rm -f "/data/dalvik-cache/$dex" && ln -s "/cache/dalvik-cache/$dex" "/data/dalvik-cache/$dex"; done

cd /data/dalvik-cache && find data* -type f | while read dex; do cp "$dex" "/cache/dalvik-cache/$dex" && rm -f "/data/dalvik-cache/$dex" && ln -s "/cache/dalvik-cache/$dex" "/data/dalvik-cache/$dex"; done

Syncthing

# install syncthing
mkdir -p /data/local/axet/bin/

cat << 'EOF' > /data/local/axet/bin/syncthing-daemon.sh
#!/system/bin/sh
export HOME=/data/local/axet
export PATH=$PATH:$HOME/bin
while true; do
  syncthing
  sleep 1
done
EOF
chmod 777 /data/local/axet/bin/syncthing-daemon.sh


mkdir -p /system/etc/init.d/
cat << 'EOF' > /system/etc/init.d/90syncthing
#!/system/bin/sh
/data/local/axet/bin/syncthing-daemon.sh &
EOF
chmod 777 /system/etc/init.d/90syncthing

Autoboot

# ??? not working: allow auto boot on charger connected
cat << EOF > /system/bin/battery_charging
#!/system/bin/sh
/system/bin/reboot
EOF
chmod 777 /system/bin/battery_charging