
on init
    write /sys/power/sleep_while_idle 1
    write /sys/power/clocks_off_while_idle 1
    write /sys/power/enable_off_mode 1
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand
    write /sys/devices/platform/serial8250.0/sleep_timeout 2

on boot
    chown system system /sys/devices/platform/omapfb/panel/backlight_level
    chown system system /sys/class/leds/cover/brightness
    chown system system /sys/class/leds/keyboard/brightness
    chown system system /sys/class/graphics/fb0/blank
    chmod 0660 /sys/devices/platform/omapfb/panel/backlight_level
    chmod 0660 /sys/class/leds/cover/brightness
    chmod 0660 /sys/class/leds/keyboard/brightness
    chmod 0660 /sys/class/graphics/fb0/blank

    chown system system /data/app
    chmod 0771 /data/app

    mkdir /data/misc/wifi 0770 wifi wifi
    mkdir /data/misc/wifi/sockets 0770 wifi wifi
    mkdir /data/misc/dhcp 0770 dhcp dhcp
    chown dhcp dhcp /data/misc/dhcp

    chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
    chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
    chmod 0660                /sys/class/rfkill/rfkill0/state

service nokia-setup /system/bin/logwrapper /system/etc/init.nokia.sh
    oneshot

service batt_mon /system/bin/logwrapper /system/bin/batt_mon
    oneshot

service wlan_loader /system/bin/logwrapper /system/bin/wlan_loader
    disabled
    oneshot

on property:init.svc.wpa_supplicant=stopped
    stop dhcpcd

service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant \
    -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf
    group wifi inet
    disabled
    oneshot

service dhcpcd /system/bin/logwrapper /system/bin/dhcpcd -d wlan0
    disabled
    oneshot
