Can anyone dump the init.rc? - Galaxy S I9000 Q&A, Help & Troubleshooting

Hiya,
can anyone dump me his init.rc? Thanks a lot!

Here you go:
Code:
on init
sysclktz 0
loglevel 3
# setup the global environment
export PATH /sbin:/system/sbin:/system/bin:/system/xbin
export LD_LIBRARY_PATH /system/lib:/system/lib/egl
export ANDROID_BOOTLOGO 1
export ANDROID_ROOT /system
export ANDROID_ASSETS /system/app
export ANDROID_DATA /data
export EXTERNAL_STORAGE /sdcard
export BOOTCLASSPATH /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar
export TMPDIR /data/local/tmp
# Backward compatibility
symlink /system/etc /etc
# to enable wifi
setprop wifi.interface "eth0"
# end of wifi
# +++++++++++++++++++++++++++++++++++++++++++
# bootsnd
setprop audioflinger.bootsnd 1
# end of bootsnd
# Insert all modules here
mkdir /lib/modules
insmod /lib/modules/fsr.ko
insmod /lib/modules/fsr_stl.ko
insmod /lib/modules/rfs_glue.ko
insmod /lib/modules/rfs_fat.ko
insmod /lib/modules/j4fs.ko
#added by khoonk for parameter reading on 20100321
mount j4fs /dev/block/stl6 /mnt/.lfs
#added by khoonk for parameter reading on 20100321
insmod /lib/modules/param.ko
insmod /lib/modules/dpram.ko
insmod /lib/modules/multipdp.ko
# insmod /lib/modules/drop_caches.ko
# create mountpoints and mount tmpfs on sqlite_stmt_journals
mkdir /sdcard 0000 system system
chown system system /sdcard
chmod 0000 /sdcard
mkdir /system
mkdir /data 0771 system system
chown system system /data
chmod 0771 /data
mkdir /efs 0771 system system
chown system system /efs
chmod 0771 /efs
mkdir /cache 0770 system cache
chown system cache /cache
chmod 0770 /cache
mkdir /config 0500 root root
chown root root /config
chmod 0500 /config
mkdir /sqlite_stmt_journals 01777 root root
chown root root /sqlite_stmt_journals
chmod 01777 /sqlite_stmt_journals
mount tmpfs tmpfs /sqlite_stmt_journals size=4m
###################################################################
# create SEC_INTERNAL_STORAGE 1/2
mkdir /userdata 0771 system system
chown system system /userdata
chmod 0771 /userdata
###################################################################
# mount rootfs rootfs / ro remount
write /proc/sys/kernel/panic_on_oops 1
write /proc/sys/kernel/hung_task_timeout_secs 0
write /proc/cpu/alignment 4
write /proc/sys/kernel/sched_latency_ns 10000000
write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
write /proc/sys/kernel/sched_compat_yield 1
# Create cgroup mount points for process groups
mkdir /dev/cpuctl
mount cgroup none /dev/cpuctl cpu
chown sytem system /dev/cpuctl
chown system system /dev/cpuctl/tasks
chmod 0777 /dev/cpuctl/tasks
write /dev/cpuctl/cpu.shares 1024
mkdir /dev/cpuctl/fg_boost
chown system system /dev/cpuctl/fg_boost/tasks
chmod 0777 /dev/cpuctl/fg_boost/tasks
write /dev/cpuctl/fg_boost/cpu.shares 1024
mkdir /dev/cpuctl/bg_non_interactive
chown system system /dev/cpuctl/bg_non_interactive/tasks
chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
write /dev/cpuctl/bg_non_interactive/cpu.shares 52
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
## mount yaffs2 [email protected] /system
mount rfs /dev/block/stl9 /system check=no
# mount yaffs2 [email protected] /system ro remount
# We chown/chmod /data again so because mount is run as root + defaults
## mount yaffs2 [email protected] /data nosuid nodev
# mount rfs /dev/block/stl7 /data nosuid nodev check=no
# chown system system /data
# chmod 0771 /data
###################################################################
# create SEC_INTERNAL_STORAGE 2/2
## mount ext3 /dev/block/mmcblk0p1 /userdata nosuid nodev
mount rfs /dev/block/mmcblk0p2 /data nosuid nodev check=no
chown system system /data
chmod 0771 /data
###################################################################
###################################################################
# create dbdata partition
mkdir /dbdata
mount rfs /dev/block/stl10 /dbdata nosuid nodev check=no
mkdir /dbdata/databases
chown system system /dbdata
chown system system /dbdata/databases
chmod 0771 /dbdata
chmod 0777 /dbdata/databases
###################################################################
# Same reason as /data above
#mount yaffs2 [email protected] /cache nosuid nodev
mount rfs /dev/block/stl11 /cache nosuid nodev check=no
chown system cache /cache
chmod 0770 /cache
# This may have been created by the recovery system with odd permissions
chown system system /cache/recovery
chmod 0770 /cache/recovery
#change permissions on vmallocinfo so we can grab it from bugreports
chown root log /proc/vmallocinfo
chmod 0440 /proc/vmallocinfo
mount rfs /dev/block/stl3 /efs nosuid nodev check=no
#removed by khoonk for parameter reading on 20100321
#mount j4fs /dev/block/stl6 /mnt/.lfs
#removed by khoonk for parameter reading on 20100321
#chown system system /efs
chown radio radio /efs
chmod 0771 /efs
# create data/gps for GPS demon
mkdir /data/gps
chown system /data/gps
chmod 771 /data/gps
# GPS development for broadcom.
#chmod 0777 /system/bin/gpsd/glgps_samsungJupiter
#chmod 0666 /system/lib/libgps.so
chmod 600 /system/etc/secgps.conf
# create basic filesystem structure
mkdir /data/misc 01771 system misc
chown system misc /data/misc
chmod 01771 /data/misc
mkdir /data/misc/hcid 0770 bluetooth bluetooth
chown bluetooth bluetooth /data/misc/hcid
chmod 0770 /data/misc/hcid
mkdir /data/misc/bluetooth 0777 bluetooth bluetooth
chown bluetooth bluetooth /data/misc/bluetooth
chmod 0777 /data/misc/bluetooth
mkdir /data/misc/keystore 0770 keystore keystore
chown keystore keystore /data/misc/keystore
chmod 0770 /data/misc/keystore
mkdir /data/misc/vpn 0770 system system
chown system system /data/misc/vpn
chmod 0770 /data/misc/vpn
mkdir /data/misc/vpn/profiles 0770 system system
chown system system /data/misc/vpn/profiles
chmod 0770 /data/misc/vpn/profiles
mkdir /data/misc/radio 0771 radio radio
chown radio radio /data/misc/radio
chmod 0771 /data/misc/radio
# give system access to wpa_supplicant.conf for backup and restore
# to enable wifi
mkdir /data/wifi 0777 wifi wifi
chown wifi wifi /data/wifi
chmod 0771 /data/wifi
mkdir /data/misc/wifi 0771 wifi wifi
chown wifi wifi /data/misc/wifi
chmod 0771 /data/misc/wifi
mkdir /data/misc/dhcp 0777 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
chmod 0777 /data/misc/dhcp
mkdir /data/misc/wifi/sockets 0777 wifi wifi
chown wifi wifi /data/misc/wifi/sockets
chmod 0771 /data/misc/wifi/sockets
chmod 0664 /system/etc/wifi/wpa_supplicant.conf
# end of wifi
mkdir /data/local 0771 shell shell
chown shell shell /data/local
chmod 0771 /data/local
mkdir /data/local/tmp 0771 shell shell
chown shell shell /data/local/tmp
chmod 0771 /data/local/tmp
mkdir /data/data 0771 system system
chown shell shell /data/local/tmp
chmod 0771 /data/local/tmp
mkdir /data/app-private 0771 system system
chown system system /data/app-private
chmod 0771 /data/app-private
mkdir /data/app 0771 system system
chown system system /data/app
chmod 0771 /data/app
mkdir /data/property 0700 root root
chown root root /data/property
chmod 0700 /data/property
# create log system
mkdir /data/log 0777 root root
chmod 0777 /data/log
chmod 0777 /data/anr
chmod 0666 /dev/log/radio
chmod 0666 /dev/log/main
chmod 0666 /dev/log/event
# create dump camera
mkdir /data/dump 0777 root root
chmod 0777 /data/dump
# create dalvik-cache and double-check the perms
mkdir /data/dalvik-cache 0771 system system
chown system system /data/dalvik-cache
chmod 0771 /data/dalvik-cache
# create the lost+found directories, so as to enforce our permissions
mkdir /data/lost+found 0770
mkdir /cache/lost+found 0770
# double check the perms, in case lost+found already exists, and set owner
chown root root /data/lost+found
chmod 0770 /data/lost+found
chown root root /cache/lost+found
chmod 0770 /cache/lost+found
# permissions for MTP device node
chmod 0777 /dev/usb_mtp_gadget
#DRM directory creation
mkdir /system/etc/security/drm 0777
chown root root /system/etc/security/drm
chmod 0777 /system/etc/security/drm
#Permission for WMDRM sample.hds file
chmod 0777 /system/etc/security/drm/sample.hds
# Added for testing WMDRM and DIVX DRM
mkdir /data/data/.drm/ 0777
mkdir /data/data/.drm/.wmdrm 0777
#mkdir /data/data/.drm/.divxdrm 0777
mkdir /efs/.android 0777
# Permission for WMDRM sample.hds file
chmod 0777 /data/data/.drm/.wmdrm/sample.hds
# ko files for 3D
insmod /lib/modules/pvrsrvkm.ko
insmod /lib/modules/s3c_lcd.ko
insmod /lib/modules/s3c_bc.ko
#insmod /modules/bc_example.ko
# load FM Radio module
insmod /lib/modules/Si4709_driver.ko
insmod /lib/modules/vibrator.ko
insmod /lib/modules/melfas_touchkey.ko
#all operation with rootfs should be finished here, root partition will mounted read-only . d.moskvitin
mount rootfs rootfs / ro remount
on boot
# basic network init
ifup lo
hostname localhost
domainname localdomain
# set RLIMIT_NICE to allow priorities from 19 to -20
setrlimit 13 40 40
# Set timeout value for rmnet stats.
write /sys/devices/virtual/net/rmnet0/timeout_suspend 5000000
# Define the oom_adj values for the classes of processes that can be
# killed by the kernel. These are used in ActivityManagerService.
setprop ro.FOREGROUND_APP_ADJ 0
setprop ro.VISIBLE_APP_ADJ 1
setprop ro.SECONDARY_SERVER_ADJ 2
setprop ro.BACKUP_APP_ADJ 2
setprop ro.HOME_APP_ADJ 4
setprop ro.HIDDEN_APP_MIN_ADJ 7
setprop ro.CONTENT_PROVIDER_ADJ 14
setprop ro.EMPTY_APP_ADJ 15
# Define the memory thresholds at which the above process classes will
# be killed. These numbers are in pages (4k).
setprop ro.FOREGROUND_APP_MEM 1536
setprop ro.VISIBLE_APP_MEM 2048
setprop ro.SECONDARY_SERVER_MEM 4096
setprop ro.BACKUP_APP_MEM 4096
setprop ro.HOME_APP_MEM 4096
setprop ro.HIDDEN_APP_MEM 5120
setprop ro.CONTENT_PROVIDER_MEM 5632
setprop ro.EMPTY_APP_MEM 6144
# Write value must be consistent with the above properties.
# Note that the driver only supports 6 slots, so we have HOME_APP at the
# same memory level as services.
write /sys/module/lowmemorykiller/parameters/adj 0,1,2,7,14,15
write /proc/sys/vm/overcommit_memory 1
write /proc/sys/vm/min_free_order_shift 4
write /sys/module/lowmemorykiller/parameters/minfree 2048,4096,5120,5632,6144,7172
# Set init its forked children's oom_adj.
write /proc/1/oom_adj -16
# Tweak background writeout
write /proc/sys/vm/dirty_expire_centisecs 200
write /proc/sys/vm/dirty_background_ratio 5
# permissions
chmod 666 /system/usr/keychars/s3c-keypad.kcm.bin
# Permissions for System Server and daemons.
chown radio system /sys/android_power/state
chown radio system /sys/android_power/request_state
chown radio system /sys/android_power/acquire_full_wake_lock
chown radio system /sys/android_power/acquire_partial_wake_lock
chown radio system /sys/android_power/release_wake_lock
chown radio system /sys/power/state
chown radio system /sys/power/wake_lock
chown radio system /sys/power/wake_unlock
chown radio system /sys/power/dvfslock_ctrl
chmod 0660 /sys/power/state
chmod 0660 /sys/power/wake_lock
chmod 0660 /sys/power/wake_unlock
chmod 0660 /sys/power/dvfslock_ctrl
chown system system /sys/class/timed_output/vibrator/enable
chown system system /sys/class/leds/keyboard-backlight/brightness
chown system system /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/jogball-backlight/brightness
chown system system /sys/class/leds/red/brightness
chown system system /sys/class/leds/green/brightness
chown system system /sys/class/leds/blue/brightness
chown system system /sys/class/leds/red/device/grpfreq
chown system system /sys/class/leds/red/device/grppwm
chown system system /sys/class/leds/red/device/blink
chown system system /sys/class/leds/red/brightness
chown system system /sys/class/leds/green/brightness
chown system system /sys/class/leds/blue/brightness
chown system system /sys/class/leds/red/device/grpfreq
chown system system /sys/class/leds/red/device/grppwm
chown system system /sys/class/leds/red/device/blink
chown system system /sys/class/timed_output/vibrator/enable
chown system system /sys/module/sco/parameters/disable_esco
chown system system /sys/kernel/ipv4/tcp_wmem_min
chown system system /sys/kernel/ipv4/tcp_wmem_def
chown system system /sys/kernel/ipv4/tcp_wmem_max
chown system system /sys/kernel/ipv4/tcp_rmem_min
chown system system /sys/kernel/ipv4/tcp_rmem_def
chown system system /sys/kernel/ipv4/tcp_rmem_max
chown root radio /proc/cmdline
#magnetic sensor yamaha
chown compass system /dev/i2c-12
chmod 0777 /dev/i2c-12
chown compass system /dev/i2c-5
chmod 0777 /dev/yamaha_compass
chown system system /dev/light
chmod 0777 /dev/light
chown system system /dev/proximity
chmod 0777 /dev/proximity
# Define TCP buffer sizes for various networks
# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
setprop net.tcp.buffersize.default 4096,65535,196608,4096,16384,110208
setprop net.tcp.buffersize.wifi 4095,65535,196608,4096,16384,110208
setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
# +++++++++++++++++++++++++++++++++++++++++++
# for Bluetooth
chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power
chown bluetooth bluetooth /proc/bluetooth/sleep/proto
chown system system /sys/module/sco/parameters/disable_esco
chmod 0660 /sys/module/bluetooth_power/parameters/power
chmod 0660 /proc/bluetooth/sleep/proto
chown bluetooth bluetooth /dev/uinput
chmod 0666 /dev/uinput
chown bluetooth bluetooth /dev/s3c2410_serial0
chmod 0666 /dev/s3c2410_serial0
chmod 0777 /sys/class/rfkill/rfkill0/state
chmod 0777 /sys/class/rfkill/rfkill1/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill1/state
chmod 6777 /system/bin/brcm_dutMode
# +++++++++++++++++++++++++++++++++++++++++++
class_start default
## Daemon processes to be run by init.
##
service console /system/bin/sh
console
service playlogos1 /system/bin/playlogos1
user root
oneshot
# adbd is controlled by the persist.service.adb.enable system property
service adbd /sbin/adbd
disabled
# adbd on at boot in emulator
on property:ro.kernel.qemu=1
start adbd
on property:persist.service.adb.enable=1
start adbd
on property:persist.service.adb.enable=0
stop adbd
# 3D init
service pvrsrvinit /system/bin/pvrsrvinit
user root
group root
oneshot
service servicemanager /system/bin/servicemanager
user system
critical
onrestart restart zygote
onrestart restart media
#magnetic sensor yamaha
onrestart restart sensor-daemon
service vold /system/bin/vold
socket vold stream 0660 root mount
service nexus /system/bin/nexus
socket nexus stream 0660 root system
disabled
#service mountd /system/bin/mountd
# socket mountd stream 0660 root mount
service debuggerd /system/bin/debuggerd
service efs-daemon /system/bin/efsd
service ril-daemon /system/bin/rild
socket rild stream 660 root radio
socket rild-debug stream 660 radio system
user root
group radio cache inet misc
service glgps /system/bin/gpsd/glgps_samsungJupiter -c /system/etc/jupiter.xml
user root
group root
service DR-daemon /system/bin/drexe
user root
service mobex-daemon /system/bin/npsmobex
user root
service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
socket zygote stream 666
onrestart write /sys/android_power/request_state wake
onrestart write /sys/power/state on
service media /system/bin/mediaserver
user root
group system audio camera graphics inet net_bt net_bt_admin
#service bootsound /system/bin/playmp3
# user media
# group audio
# oneshot
#service bootanim /system/bin/bootanimation2nd
# user graphics
# group graphics
# disabled
# oneshot
# to enable wifi
service wpa_supplicant /system/bin/wpa_supplicant -Dwext -ieth0 -c/data/wifi/bcm_supp.conf
disabled
oneshot
service dhcpcd /system/bin/dhcpcd eth0
disabled
oneshot
service ifcfg_eth0 /system/bin/ifconfig eth0 up
disabled
oneshot
#for WiFi MFG(TestMode)
service wlservice /system/bin/wlservice
disabled
oneshot
# end of wifi
service dbus /system/bin/dbus-daemon --system --nofork
socket dbus stream 660 bluetooth bluetooth
user bluetooth
group bluetooth net_bt_admin
# +++++++++++++++++++++++++++++++++++++++++++
# for Broadcom Bluetooth
# Start BTLD -----------------------------------------
service btld /system/bin/logwrapper /system/bin/btld -hb 3000000 -hp /dev/s3c2410_serial0 -lpm 1
user root
group bluetooth net_bt_admin
disabled
oneshot
# Start DTUN OBEXD -----------------------------------------
service obexd /system/bin/logwrapper /system/bin/obexd
#socket bluetooth stream 660 bluetooth bluetooth
#socket dbus_bluetooth stream 660 bluetooth bluetooth
# init.rc does not yet support applying capabilities, so run as root and
# let obexd drop uid to bluetooth with the right linux capabilities
user root
group bluetooth net_bt_admin
disabled
oneshot
# Start BLUETOOTHD -----------------------------------------
service bluetoothd /system/bin/logwrapper /system/bin/bluetoothd -n /etc/bluez/main.conf
socket bluetooth stream 660 bluetooth bluetooth
socket dbus_bluetooth stream 660 bluetooth bluetooth
# init.rc does not yet support applying capabilities, so run as root and
# let hcid drop uid to bluetooth with the right linux capabilities
group bluetooth net_bt_admin misc
disabled
# +++++++++++++++++++++++++++++++++++++++++++
service hfag /system/bin/sdptool add --channel=10 HFAG
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service hsag /system/bin/sdptool add --channel=11 HSAG
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service opush /system/bin/sdptool add --channel=12 OPUSH
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service pbap /system/bin/sdptool add --channel=19 PBAP
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service installd /system/bin/installd
socket installd stream 600 system system
service flash_recovery /system/bin/flash_image recovery /system/recovery.img
oneshot
#magnetic sensor yamaha
service sensor-daemon /system/bin/sensorserver_yamaha
user compass
group system
service racoon /system/bin/racoon
socket racoon stream 600 system system
# racoon will setuid to vpn after getting necessary resources.
group net_admin keystore
disabled
oneshot
service mtpd /system/bin/mtpd
socket mtpd stream 600 system system
user vpn
group vpn net_admin net_raw
disabled
oneshot
service keystore /system/bin/keystore /data/misc/keystore
user keystore
group keystore
socket keystore stream 666
service immvibed /system/bin/immvibed
oneshot
service immvbsd /system/bin/immvbsd
oneshot
# to enable wifi
on property:init.svc.wpa_supplicant=stopped
stop dhcpcd
on property:init.svc.dhcpcd=stopped
# dhcpcd -k eth0
# end of wifi
# for Mobile AP
service mobileAP /system/bin/wlp2pservice
# end of Mobile AP
# for TvOut
service tvout /system/bin/tvoutserver
user system
#PC Internet Share
service udhcpd /system/bin/udhcpd /data/data/com.android.samsung.IcsService/dhcp/udhcpd.conf
disabled
oneshot
# Test command for stress test
# service dfta /system/bin/sh /sbin/dfta.sh
# oneshot
#configure the Iptables
service pcInternet_on /system/bin/sh /data/data/com.android.samsung.IcsService/conf/iptablesConfig.sh
disabled
oneshot
#flush the Iptables
service pcInternet_off /system/bin/sh /data/data/com.android.samsung.IcsService/conf/iptablesFlush.sh
disabled
oneshot
on property:service.dhcp.enable=1
chmod 777 /data/data/com.android.samsung.IcsService/dhcp/udhcpd.conf
chmod 777 /data/data/com.android.samsung.IcsService/dhcp/udhcpd.leases
chmod 777 /data/data/com.android.samsung.IcsService/dhcp/udhcpd.pid
start udhcpd
on property:service.iptables.configure=1
chmod 777 /data/data/com.android.samsung.IcsService/conf/iptablesConfig.sh
start pcInternet_on
on property:service.dhcp.enable=0
stop udhcpd
on property:service.iptables.configure=0
chmod 777 /data/data/com.android.samsung.IcsService/conf/iptablesFlush.sh
start pcInternet_off
#end of PCInternet share

Thanks a lot!

could you tell me how did you dump the file,, and btw is there a way to modify it no add the loading of some other libraries/services?
thanks!

Related

Busybox not root ?

Hello everybody,
I rooted my dream phone with :
Code:
fastboot boot boot.img
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cd system
# cd bin
# cat sh > su
# chmod 4755 su
All work fine !
I tried to install busybox like this :
Code:
adb push busybox /data/local/tmp
cat /data/local/tmp/busybox > /system/bin/busybox
chmod 4755 /system/bin/busybox
No problem with this step, but now if I type :
Code:
$su
#busybox ls /data
I have a permission denied
If I type
Code:
$su
#ls /data
all work fine
(ls is an symbolic link to toolbox)
ls -l /system/bin
Code:
-rwsr-xr-x root root 1745016 2009-07-28 11:01 busybox
-rwsr-xr-x root root 86936 2009-07-28 11:11 su
-rwxr-xr-x root shell 68472 2009-03-03 22:31 toolbox
...
I think busybox is not launch with root permission.. why?
I tried : ln -s busybox ls
but same problem !
What is wrong ?
Thanks.
Any particular reason why you setuid busybox? Try chmod 0755 busybox; chown root:shell busybox

boot img files

Could someone who's got their droid x rooted post the init*.rc files from /
hmmm I probably should have posted this in q&a..
FacePalm!
Goldfish .rc
Code:
on boot
setprop ARGH ARGH
setprop net.eth0.dns1 10.0.2.3
setprop net.gprs.local-ip 10.0.2.15
setprop ro.radio.use-ppp no
setprop ro.build.product generic
setprop ro.product.device generic
# fake some battery state
setprop status.battery.state Slow
setprop status.battery.level 5
setprop status.battery.level_raw 50
setprop status.battery.level_scale 9
# disable some daemons the emulator doesn't want
stop dund
stop akmd
setprop ro.setupwizard.mode EMULATOR
# enable Google-specific location features,
# like NetworkLocationProvider and LocationCollector
setprop ro.com.google.locationfeatures 1
# For the emulator, which bypasses Setup Wizard, you can specify
# account info for the device via these two properties. Google
# Login Service will insert these accounts into the database when
# it is created (ie, after a data wipe).
#
# setprop ro.config.hosted_account [email protected]:password
# setprop ro.config.google_account [email protected]:password
#
# You MUST have a Google account on the device, and you MAY
# additionally have a hosted account. No other configuration is
# supported, and arbitrary breakage may result if you specify
# something else.
# [MOT] qcf001: Simulator will not start without these changes. Careful for other mot changes in this file.
class_start default
class_start pre-zygote_services
class_start zygote_services
class_start post-zygote_services
service goldfish-setup /system/etc/init.goldfish.sh
class pre-zygote_services
oneshot
service qemud /system/bin/qemud
class pre-zygote_services
socket qemud stream 666
oneshot
# -Q is a special logcat option that forces the
# program to check wether it runs on the emulator
# if it does, it redirects its output to the device
# named by the androidboot.console kernel option
# if not, is simply exit immediately
service goldfish-logcat /system/bin/logcat -Q
class pre-zygote_services
oneshot
Mapphone_umts
Code:
on init
# Backward compatibility
symlink /dev /dev/netmux
# prepare generic keypad name
exec /init_prep_keypad.sh
mount yaffs2 [email protected] /system ro remount
mount ext3 [email protected] /system ro remount
mount rootfs rootfs / rw remount
mkdir /cdrom 0770 system system
mount yaffs2 [email protected] /cdrom
symlink /dev/ttyGS0 /dev/acm0
# Create mountpoints and mount tmpfs
mkdir /pds 0775 system system
mkdir /tmp 0777 system system
mount tmpfs tmpfs /tmp size=2m
# Configure kernel options
# Enable automatic power control for EHCI USB IPC
write /sys/devices/platform/ehci-omap.0/usb1/power/level auto
write /sys/devices/platform/ehci-omap.0/usb1/power/autosuspend 0
write /sys/devices/platform/ehci-omap.0/usb1/1-3/power/level auto
write /sys/devices/platform/ehci-omap.0/usb1/1-3/power/autosuspend 0
# Reset system time
write /sys/class/rtc/rtc0/unsecured_rtc on
# Set core pattern
write /proc/sys/kernel/core_pattern "|/system/bin/coredump %e %p %t"
write /proc/sys/fs/suid_dumpable 2
# Power Management
write /sys/power/sleep_while_idle 1
write /sys/power/enable_off_mode 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 250000
write /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold 86
write /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate 46875
write /sys/power/sr_vdd1_autocomp 0
write /sys/power/sr_vdd2_autocomp 0
write /sys/power/enable_abb_mode 1
# Change ownership for vibrators
chown system system /sys/class/timed_output/lvibrator/enable
chown system system /sys/class/timed_output/vibrator/enable
# Change permission of vibrators
chmod 0660 /sys/class/timed_output/lvibrator/enable
chmod 0660 /sys/class/timed_output/vibrator/enable
# Mount mtd partitions
# mount /pds as r/w
# We chown/chmod /pds again so because mount is run as root + defaults
mount yaffs2 [email protected] /pds nosuid nodev no-checkpoint
exec /system/bin/logwrapper /system/bin/mount_ext3.sh pds /pds
chown system system /pds
chmod 0775 /pds
mkdir /pds/comm_drv
chown radio radio /pds/comm_drv
chmod 0770 /pds/comm_drv
mkdir /pds/public
chown system shell /pds/public
chmod 0775 /pds/public
# Create basic filesystem structure
# create moto specific dirs for mystuff
mkdir /data/download 0775 system system
mkdir /data/download/mystuff 0775 system system
# create moto specific dirs for wifi
mkdir /data/system 0771 system system
# wifi dirs
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
mkdir /pds/wifi 0771 wifi wifi
mkdir /data/comm_drv 0770 radio radio
mkdir /data/gki 0770 radio radio
mkdir /tmp/commdrv 0770 radio radio
# bluetooth power up/down interface
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/state
# following two dirs are for storing BP Flex and PDS files. NVM Daemon is using these folders
mkdir /data/bp_nvm 0770 radio radio
mkdir /pds/bp_nvm 0770 radio radio
# create logger folder for bplogd
mkdir /data/logger 0770 radio log
chown radio log /data/logger
chmod 0770 /data/logger
mkdir /data/panicreports
chown root radio /data/panicreports
chmod 0777 /data/panicreports
# create the lost+found directories, so as to enforce our permissions
mkdir /pds/lost+found 0770
# double check the perms, in case lost+found already exists, and set owner
chown root root /pds/lost+found
chmod 0770 /pds/lost+found
#Create location directory
mkdir /data/location 0771 radio radio
#Create opprof directory and backup pds directory
mkdir /data/opprof 0770 radio shell
mkdir /pds/opprof 0770 radio shell
# Create anr directory and change permission to 777 to save trace.txt
mkdir /data/anr
chmod 0777 /data/anr
# create the necessary dirs for tpapi with proper permission
mkdir /pds/security
mkdir /data/tpapi
mkdir /data/tpapi/etc
mkdir /data/tpapi/etc/tpa
mkdir /data/tpapi/etc/tpa/persistent
chmod 2770 /pds/security
chmod 2770 /data/tpapi
chmod 2770 /data/tpapi/etc
chmod 2770 /data/tpapi/etc/tpa
chmod 2770 /data/tpapi/etc/tpa/persistent
chown mot_tpapi mot_tpapi /pds/security
chown mot_tpapi mot_tpapi /data/tpapi
chown mot_tpapi mot_tpapi /data/tpapi/etc
chown mot_tpapi mot_tpapi /data/tpapi/etc/tpa
chown mot_tpapi mot_tpapi /data/tpapi/etc/tpa/persistent
# Create wmdrm directory
mkdir /pds/wmdrm 0775 mot_drm mot_drm
# Temp workaround for HP library cleanup
symlink /dev/hp3a-omap /dev/hp3A-omap
mount rootfs rootfs / ro remount
# Install kernel modules
# Install BP related kernel modules
#Start the engine modules for netmux first for other daemons depends on it
insmod /system/lib/modules/netmux.ko
insmod /system/lib/modules/netmux_linkdriver.ko
insmod /system/lib/modules/modem_pm_driver.ko
insmod /system/lib/modules/sec.ko
# chown/chmod for FOTA
chown system system /cache/fota
chmod 0770 /cache/fota
on early-boot
# Adjust the out of memory thresholds to account for the larget
# space on sholes. These numbers are in pages (4k). Must be kept
# in sync with init.rc. This must be done before the regular init.rc
# since these properies can't change once set.
setprop ro.FOREGROUND_APP_MEM 2048
setprop ro.VISIBLE_APP_MEM 3072
setprop ro.SECONDARY_SERVER_MEM 6144
setprop ro.BACKUP_APP_MEM 6144
setprop ro.HOME_APP_MEM 6144
setprop ro.HIDDEN_APP_MEM 7168
setprop ro.CONTENT_PROVIDER_MEM 8192
setprop ro.EMPTY_APP_MEM 8192
class_start media_early_init
on boot
# Overwrite what init.rc selected for the memory killer params to match above.
write /sys/module/lowmemorykiller/parameters/minfree 2048,3072,6144,7168,8192,8192
# Define Motorola DBVC ATVC Property defaults (failsafe properties)
setprop ro.sys.atvc_allow_netmon_usb 0
setprop ro.sys.atvc_allow_netmon_ih 0
setprop ro.sys.atvc_allow_res_core 0
setprop ro.sys.atvc_allow_res_panic 0
setprop ro.sys.atvc_allow_all_adb 0
setprop ro.sys.atvc_allow_all_core 0
setprop ro.sys.atvc_allow_efem 0
setprop ro.sys.atvc_allow_bp_log 0
setprop ro.sys.atvc_allow_ap_mot_log 0
setprop ro.sys.atvc_allow_gki_log 0
# Change the ownership of led files.
chown system system /sys/class/leds/lcd-backlight/als
chown system system /sys/class/leds/lcd-backlight/pwm_mode
chown system system /sys/class/leds/lcd-backlight/brightness
chmod 0660 /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/keyboard-backlight/brightness
chmod 0660 /sys/class/leds/keyboard-backlight/brightness
chown system system /sys/class/leds/button-backlight/brightness
chmod 0660 /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/red/blink
chown system system /sys/class/leds/red/brightness
chmod 0660 /sys/class/leds/red/brightness
chown system system /sys/class/leds/green/brightness
chmod 0660 /sys/class/leds/green/brightness
chmod 0660 /sys/class/leds/torch-flash/camera_strobe
chmod 0660 /sys/class/leds/torch-flash/flash_light
chown system system /sys/class/leds/torch-flash/camera_strobe
chown system system /sys/class/leds/torch-flash/flash_light
chown system system /sys/class/leds/spotlight/brightness
# Camera related
chmod 0660 /dev/hplens-omap
chown media camera /dev/hplens-omap
# Enable panic on softlockup
write /proc/sys/kernel/softlockup_panic 1
# Start services
exec /system/bin/mot_boot_mode
# Set core max size (2G)
setrlimit 4 2147483648 2147483648
# The properties introduced by moto
on property:sys.chargeonly.mode=1
start battd
start console
exec /system/bin/charge_only_mode
# Power up to normal
on property:tcmd.suspend=0
class_start pre-zygote_services
class_start zygote_services
class_start post-zygote_services
# Power up to suspend
on property:tcmd.suspend=1
class_start pre-zygote_services
class_start post-zygote_services
# Normal to suspend
on property:tcmd.suspend=2
class_stop zygote_services
# aplogd on at boot in emulator
on property:ro.kernel.qemu=1
start aplogd
on property:persist.service.aplogd.enable=1
start aplogd
on property:persist.service.aplogd.enable=0
stop aplogd
on property:ro.sys.atvc_allow_gki_log=1
start gkilogd
on property:ro.sys.atvc_allow_gki_log=0
stop gkilogd
# Moto safe power down
on property:sys.reboot=1
stop ssmgrd
exec /system/bin/sleep 10
exec /system/bin/reboot
on property:sys.shutdown=1
stop ssmgrd
exec /system/bin/sleep 10
exec /system/bin/reboot -p
on property:init.svc.wpa_supplicant=stopped
stop dhcpcd
# The following services are added by moto
# Set property strings for ATVC logging
# This conditionally sets :
# ro.sys.atvc_allow_bp_log
# ro.sys.atvc_allow_gki_log
# ro.sys.atvc_allow_ap_mot_log
# ro.sys.atvc_allow_all_core
# ro.sys.atvc_allow_res_core
# ro.sys.atvc_allow_res_panic
# ro.sys.atvc_allow_efem
# ro.sys.atvc_allow_netmon_usb
# ro.sys.atvc_allow_netmon_ih
# ro.sys.atvc_allow_all_adb
service atvc /system/bin/dbvc_atvc_property_set
class pre-zygote_services
user system
group system
oneshot
#service watchdogd /system/bin/watchdogd
# class pre-zygote_services
service telnet /system/bin/telnetd
class pre-zygote_services
oneshot
service usbd /system/bin/usbd
class pre-zygote_services
service nvm-daemon /system/usr/bin/nvm_daemon
class pre-zygote_services
user radio
group radio
# start start_modem.sh to for development purpose
service start_modem /system/bin/sh /system/usr/bin/start_modem.sh
class pre-zygote_services
oneshot
# start commdrv pds script
service start_commdrv /system/bin/sh /system/etc/motorola/comm_drv/commdrv_fs.sh
class pre-zygote_services
oneshot
user radio
group radio
service gkisystem /system/bin/gkisystem
class pre-zygote_services
socket location_shim stream 660 radio system
socket gpshal_socket stream 660 radio system
socket opprofdaemon stream 660 radio system
socket gkilog_sock stream 660 radio radio
group radio system mot_accy mot_secclkd
onrestart exec /system/usr/bin/gki_pd_notifier
service rild_tcmd /system/bin/rild_tcmd
class pre-zygote_services
socket rild_tcmd stream 0660 radio mot_tcmd
user radio
group radio
service battd /system/bin/battd
class pre-zygote_services
socket battdsock stream 0660 mot_accy mot_accy
user root
group mot_accy mot_pwric
oneshot
service catcommands /system/bin/catcommands
class pre-zygote_services
group radio
service bplogd_daemon /system/usr/bin/bplogd_daemon
class pre-zygote_services
socket dlog_cmds stream 660 radio log
socket bp_pd_status stream 660 radio log
socket bp_aol_cmd stream 666 radio log
user radio
group radio inet log sdcard_rw
oneshot
service ssmgrd /system/xbin/ssmgrd
class post-zygote_services
group radio input mot_pwric
oneshot
service hciattach /system/bin/hciattach \
-n -t 10 /dev/ttyS1 texasalt 3000000 flow
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
service nap /system/bin/sdptool add NAP
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service del_nap /system/bin/sdptool remove NAP
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service panu /system/bin/sdptool add PANU
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service del_panu /system/bin/sdptool remove PANU
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service napics /system/bin/sh /system/bin/napics.sh
class post-zygote_services
user root
disabled
oneshot
service btdhcpd /system/xbin/dnsmasq -C /etc/btpan.conf
class post-zygote_services
user root
disabled
oneshot
service tcmd /system/bin/tcmd
class post-zygote_services
group mot_tcmd radio mot_pwric input system log camera graphics mot_accy sdcard_rw audio inet bluetooth wifi compass net_bt_admin mot_tombstone mot_tpapi
socket local_tcmd stream 0660 mot_tcmd mot_tcmd
socket batch_socket stream 0600 mot_tcmd mot_tcmd
oneshot
# turn on wifi for tcmd step one
on property:tcmd.load_wlan=1
insmod /system/lib/modules/tiwlan_drv.ko
# turn on wifi for tcmd step two
on property:tcmd.load_wlan=2
start wlan_loader
# turn on wifi for tcmd step three
on property:tcmd.load_wlan=3
exec /system/bin/ifconfig tiwlan0 up
# turn off wifi for tcmd step one
on property:tcmd.unload_wlan=1
exec /system/bin/ifconfig tiwlan0 down
# turn off wifi for tcmd step two
on property:tcmd.unload_wlan=2
exec /system/bin/rmmod tiwlan_drv
# turn on bluetooth for tcmd
on property:tcmd.bt_mod=1
insmod /system/lib/modules/wl127x-test.ko
#turn off bluetooth for tcmd
on property:tcmd.bt_mod=0
exec /system/bin/rmmod wl127x_test
service panic_daemon /system/usr/bin/panic_daemon
class post-zygote_services
user radio
group radio system graphics
socket panic_daemon stream 660 radio radio
onrestart exec /system/bin/reboot
# Ecompass daemon
service akmd2 /system/bin/akmd2
class post-zygote_services
user compass
group compass misc input
service wlan_loader /system/bin/wlan_loader \
-f /system/etc/wifi/fw_wlan1271.bin -i /system/etc/wifi/tiwlan.ini \
-e /pds/wifi/nvs_map.bin
class post-zygote_services
disabled
oneshot
service wpa_supplicant /system/bin/wpa_supplicant \
-Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf
class post-zygote_services
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
socket wpa_tiwlan0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd /system/bin/dhcpcd -ABKL tiwlan0
class post-zygote_services
disabled
oneshot
service autoip /system/bin/dhcpcd -BK tiwlan0
class post-zygote_services
disabled
oneshot
service btdhcpcd /system/bin/dhcpcd -ABKL bnep0
class post-zygote_services
disabled
oneshot
service btautoip /system/bin/dhcpcd -BK bnep0
class post-zygote_services
disabled
oneshot
service baseimage /system/bin/dspexec -v -T /system/lib/dsp/baseimage.dof
class media_early_init
user media
group media graphics
oneshot
service pvrsrv /system/bin/pvrsrvinit
class post-zygote_services
user root
oneshot
service pppd /system/xbin/pppd silent ipparam dun plugin /system/lib/libpppd_plugin.so
class post-zygote_services
user root
disabled
oneshot
service ulogd /system/xbin/ulogd
class post-zygote_services
user root
disabled
oneshot
service firewall /system/bin/firewall.sh
class post-zygote_services
user root
disabled
oneshot
service locDrv /system/usr/bin/brcm_guci_drv -config /system/etc/gpsconfig.xml
class post-zygote_services
user radio
group radio inet sdcard_rw
service pm_init /system/bin/sh /system/usr/bin/pm_init.sh
class post-zygote_services
oneshot
# aplogd is controlled by the persist.service.aplogd.enable system property
service aplogd /system/bin/aplogd
class post-zygote_services
socket ap_aol_cmd stream 666 system system
user log
group log system sdcard_rw
oneshot
service gkilogd /system/bin/gkilogd
class post-zygote_services
socket gki_aol_cmd stream 660 radio log
user radio
group radio log sdcard_rw
service fmradio /system/bin/fmradioserver
class post-zygote_services
disabled
group bluetooth
service dlnasrv /system/bin/dlnasrv
class post-zygote_services
disabled
oneshot
service dund_dialup /system/bin/dund --listen --channel=6 --nodetach --dialup
class post-zygote_services
disabled
oneshot
service smcdaemon /system/bin/startup_smc.sh
class post-zygote_services
disabled
oneshot
# ecckeyd daemon has dependency on SMC
# It needs to be root because it needs to be able to read client's /proc/<pid>/status.
# user/group as mot_tpapi/mot_tpapi does not give it enough permission
service ecckeydaemon /system/bin/ecckeyd
class post-zygote_services
socket ecckey_socket stream 660 mot_tpapi mot_tpapi
group mot_tpapi
disabled
oneshot
on property:ro.service.start.smc=1
start smcdaemon
start ecckeydaemon
service secclkd /system/bin/secclkd
class post-zygote_services
socket secclk_socket stream 660 mot_secclkd mot_secclkd
user mot_tpapi
group mot_tpapi mot_sec_rtc mot_secclkd
oneshot
init
Code:
on init
sysclktz 0
loglevel 3
# setup the global environment
export PATH /sbin:/system/sbin:/system/bin:/system/xbin
export LD_LIBRARY_PATH /system/lib
export ANDROID_BOOTLOGO 1
export ANDROID_ROOT /system
export ANDROID_ASSETS /system/app
export ANDROID_DATA /data
export EXTERNAL_STORAGE /sdcard
# Motorola IKMAP-3657 add motorola framework jar to the bootclasspath
export BOOTCLASSPATH /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/com.motorola.android.frameworks.jar
# End IKMAP-3657
# Backward compatibility
symlink /system/etc /etc
symlink /sys/kernel/debug /d
# create mountpoints and mount tmpfs on sqlite_stmt_journals
mkdir /sdcard 0000 system system
mkdir /system
mkdir /data 0771 system system
mkdir /cache 0770 system cache
mkdir /config 0500 root root
mkdir /sqlite_stmt_journals 01777 root root
mount tmpfs tmpfs /sqlite_stmt_journals size=4m
mount rootfs rootfs / ro remount
write /proc/sys/kernel/panic_on_oops 1
write /proc/sys/kernel/hung_task_timeout_secs 0
write /proc/cpu/alignment 4
write /proc/sys/kernel/sched_latency_ns 10000000
write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
write /proc/sys/kernel/sched_compat_yield 1
write /proc/sys/kernel/sched_child_runs_first 0
## Create cgroup mount points for process groups
# mkdir /dev/cpuctl
# mount cgroup none /dev/cpuctl cpu
# chown sytem system /dev/cpuctl
# chown system system /dev/cpuctl/tasks
# chmod 0777 /dev/cpuctl/tasks
# write /dev/cpuctl/cpu.shares 1024
#
# mkdir /dev/cpuctl/fg_boost
# chown system system /dev/cpuctl/fg_boost/tasks
# chmod 0777 /dev/cpuctl/fg_boost/tasks
# write /dev/cpuctl/fg_boost/cpu.shares 1024
#
# mkdir /dev/cpuctl/bg_non_interactive
# chown system system /dev/cpuctl/bg_non_interactive/tasks
# chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
# # 5.0 %
# write /dev/cpuctl/bg_non_interactive/cpu.shares 52
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount yaffs2 [email protected] /system
mount ext3 [email protected] /system
# We chown/chmod /data again so because mount is run as root + defaults
mount yaffs2 [email protected] /data nosuid nodev
exec /system/bin/logwrapper /system/bin/mount_ext3.sh userdata /data nosuid,nodev
chown system system /data
chmod 0771 /data
# Create dump dir and collect dumps.
# Do this before we mount cache so eventually we can use cache for
# storing dumps on platforms which do not have a dedicated dump partition.
mkdir /data/dontpanic
chown root log /data/dontpanic
chmod 0777 /data/dontpanic
# Collect apanic data, free resources and re-arm trigger
copy /proc/apanic_console /data/dontpanic/apanic_console
chown root log /data/dontpanic/apanic_console
chmod 0777 /data/dontpanic/apanic_console
copy /proc/apanic_threads /data/dontpanic/apanic_threads
chown root log /data/dontpanic/apanic_threads
chmod 0777 /data/dontpanic/apanic_threads
write /proc/apanic_console 1
# Same reason as /data above
mount yaffs2 [email protected] /cache nosuid nodev
exec /system/bin/logwrapper /system/bin/mount_ext3.sh cache /cache nosuid,nodev
chown system cache /cache
chmod 0770 /cache
# This may have been created by the recovery system with odd permissions
chown system system /cache/recovery
chmod 0770 /cache/recovery
# create basic filesystem structure
mkdir /data/misc 01771 system misc
mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
mkdir /data/misc/keystore 0700 keystore keystore
mkdir /data/misc/vpn 0770 system system
mkdir /data/misc/vpn/profiles 0770 system system
# give system access to wpa_supplicant.conf for backup and restore
mkdir /data/misc/wifi 0770 wifi wifi
chmod 0770 /data/misc/wifi
chmod 0660 /data/misc/wifi/wpa_supplicant.conf
mkdir /data/misc/wifi/hostapd.sockets 0770 wifi wifi
chown mot_tcmd shell /data/local
chown mot_tcmd shell /data/local/12m
chown mot_tcmd shell /data/local/12m/batch
mkdir /data/local 0771 mot_tcmd shell
mkdir /data/local/tmp 0771 mot_tcmd shell
chown mot_tcmd shell /data/local/tmp
mkdir /data/data 0771 system system
mkdir /data/app-private 0771 system system
mkdir /data/app 0771 system system
mkdir /data/property 0700 root root
# create dalvik-cache and double-check the perms
mkdir /data/dalvik-cache 0771 system system
chown system system /data/dalvik-cache
chmod 0771 /data/dalvik-cache
# create the lost+found directories, so as to enforce our permissions
mkdir /data/lost+found 0770
mkdir /cache/lost+found 0770
# double check the perms, in case lost+found already exists, and set owner
chown root root /data/lost+found
chmod 0770 /data/lost+found
chown root root /cache/lost+found
chmod 0770 /cache/lost+found
on boot
# basic network init
ifup lo
hostname localhost
domainname localdomain
# set RLIMIT_NICE to allow priorities from 19 to -20
setrlimit 13 40 40
# Define the oom_adj values for the classes of processes that can be
# killed by the kernel. These are used in ActivityManagerService.
setprop ro.FOREGROUND_APP_ADJ 0
setprop ro.VISIBLE_APP_ADJ 1
setprop ro.SECONDARY_SERVER_ADJ 2
setprop ro.BACKUP_APP_ADJ 2
setprop ro.HOME_APP_ADJ 4
setprop ro.HIDDEN_APP_MIN_ADJ 7
setprop ro.CONTENT_PROVIDER_ADJ 14
setprop ro.EMPTY_APP_ADJ 15
# Define the memory thresholds at which the above process classes will
# be killed. These numbers are in pages (4k).
setprop ro.FOREGROUND_APP_MEM 1536
setprop ro.VISIBLE_APP_MEM 2048
setprop ro.SECONDARY_SERVER_MEM 4096
setprop ro.BACKUP_APP_MEM 4096
setprop ro.HOME_APP_MEM 4096
setprop ro.HIDDEN_APP_MEM 5120
setprop ro.CONTENT_PROVIDER_MEM 5632
setprop ro.EMPTY_APP_MEM 6144
mount debugfs /sys/kernel/debug /sys/kernel/debug
# Write value must be consistent with the above properties.
# Note that the driver only supports 6 slots, so we have HOME_APP at the
# same memory level as services.
write /sys/module/lowmemorykiller/parameters/adj 0,1,2,7,14,15
write /proc/sys/vm/overcommit_memory 1
write /proc/sys/vm/min_free_order_shift 4
write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,5120,5632,6144
# Set init its forked children's oom_adj.
write /proc/1/oom_adj -16
# Tweak background writeout
write /proc/sys/vm/dirty_expire_centisecs 200
write /proc/sys/vm/dirty_background_ratio 5
# Permissions for System Server and daemons.
chown radio system /sys/android_power/state
chown radio system /sys/android_power/request_state
chown radio system /sys/android_power/acquire_full_wake_lock
chown radio system /sys/android_power/acquire_partial_wake_lock
chown radio system /sys/android_power/release_wake_lock
chown radio system /sys/power/state
chown radio system /sys/power/wake_lock
chown radio system /sys/power/wake_unlock
chmod 0660 /sys/power/state
chmod 0660 /sys/power/wake_lock
chmod 0660 /sys/power/wake_unlock
chown system system /sys/class/timed_output/vibrator/enable
chown system system /sys/class/leds/keyboard-backlight/brightness
chown system system /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/jogball-backlight/brightness
chown system system /sys/class/leds/red/brightness
chown system system /sys/class/leds/green/brightness
chown system system /sys/class/leds/blue/brightness
chown system system /sys/class/leds/red/device/grpfreq
chown system system /sys/class/leds/red/device/grppwm
chown system system /sys/class/leds/red/device/blink
chown system system /sys/class/leds/red/brightness
chown system system /sys/class/leds/green/brightness
chown system system /sys/class/leds/blue/brightness
chown media media /sys/class/leds/af-led/brightness # Motorola, rknize2, 12/05/09, IKMAP-1294
chown system system /sys/class/leds/red/device/grpfreq
chown system system /sys/class/leds/red/device/grppwm
chown system system /sys/class/leds/red/device/blink
chown system system /sys/class/timed_output/vibrator/enable
chown system system /sys/module/sco/parameters/disable_esco
chown system system /sys/kernel/ipv4/tcp_wmem_min
chown system system /sys/kernel/ipv4/tcp_wmem_def
chown system system /sys/kernel/ipv4/tcp_wmem_max
chown system system /sys/kernel/ipv4/tcp_rmem_min
chown system system /sys/kernel/ipv4/tcp_rmem_def
chown system system /sys/kernel/ipv4/tcp_rmem_max
chown root radio /proc/cmdline
# Define TCP buffer sizes for various networks
# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
setprop net.tcp.buffersize.default 65536,131072,262144,65536,131072,262144
setprop net.tcp.buffersize.wifi 65536,131072,262144,65536,131072,262144
setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
# class_start default
## Daemon processes to be run by init.
##
service console /system/bin/sh
class pre-zygote_services
console
# adbd is controlled by the persist.service.adb.enable system property
service adbd /sbin/adbd
class pre-zygote_services
disabled
# adbd on at boot in emulator
on property:ro.kernel.qemu=1
start adbd
on property:persist.service.adb.enable=1
start adbd
on property:persist.service.adb.enable=0
stop adbd
service servicemanager /system/bin/servicemanager
class pre-zygote_services
user system
critical
onrestart restart zygote
onrestart restart media
service vold /system/bin/vold
class pre-zygote_services
socket vold stream 0660 root mount
service nexus /system/bin/nexus
class pre-zygote_services
socket nexus stream 0660 root system
disabled
#service mountd /system/bin/mountd
# socket mountd stream 0660 root mount
service debuggerd /system/bin/debuggerd
class pre-zygote_services
service ril-daemon /system/bin/rild
class pre-zygote_services
socket rild stream 660 root radio
socket rild-debug stream 660 radio system
user root
group radio cache inet misc audio system mot_secclkd
service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
class zygote_services
socket zygote stream 666
onrestart write /sys/android_power/request_state wake
onrestart write /sys/power/state on
onrestart restart media
service media /system/bin/mediaserver
class zygote_services
user media
## Motorola, a21834, 11/26/09, IKMAP-2673 / add mot_drm to supplementary group
## Motorola, psheldo1, 12/16/09, IKMAP-2229 /add input to allow access to rotation events
## Motorola, e7432c, 02/11/10, IKMAP-5881 / add mot_tpapi and mot_secclkd to supplementary group
group system audio camera graphics inet net_bt net_bt_admin net_raw mot_drm input mot_tpapi mot_secclkd
## IKMAP-2229
## IKMAP-2673
## IKMAP-5881
service bootsound /system/bin/playmp3
class post-zygote_services
user media
group audio
oneshot
service bootanim /system/bin/bootanimation
class post-zygote_services
user graphics
group graphics
disabled
oneshot
service dbus /system/bin/dbus-daemon --system --nofork
class post-zygote_services
socket dbus stream 660 bluetooth bluetooth
user bluetooth
group bluetooth net_bt_admin
service bluetoothd /system/bin/bluetoothd -n
class post-zygote_services
socket bluetooth stream 660 bluetooth bluetooth
socket dbus_bluetooth stream 660 bluetooth bluetooth
# init.rc does not yet support applying capabilities, so run as root and
# let bluetoothd drop uid to bluetooth with the right linux capabilities
group bluetooth net_bt_admin misc
disabled
service hfag /system/bin/sdptool add --channel=10 HFAG
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service hsag /system/bin/sdptool add --channel=11 HSAG
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service opush /system/bin/sdptool add --channel=12 OPUSH
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service pbap /system/bin/sdptool add --channel=19 PBAP
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service map /system/bin/sdptool add --channel=20 MAP
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service installd /system/bin/installd
class post-zygote_services
socket installd stream 600 system system
service flash_recovery /system/etc/install-recovery.sh
class post-zygote_services
oneshot
service racoon /system/bin/racoon
class post-zygote_services
socket racoon stream 600 system system
# racoon will setuid to vpn after getting necessary resources.
group net_admin
disabled
oneshot
service mtpd /system/bin/mtpd
class post-zygote_services
socket mtpd stream 600 system system
user vpn
group vpn net_admin net_raw
disabled
oneshot
service keystore /system/bin/keystore /data/misc/keystore
class post-zygote_services
user keystore
group keystore
socket keystore stream 666
service dumpstate /system/bin/dumpstate -s
class post-zygote_services
socket dumpstate stream 0660 shell log
disabled
oneshot
service ap_fmloader /system/bin/logwrapper /system/bin/wlan_loader -f /system/etc/wifi/fw_tiwlan_ap.bin -i /system/etc/wifi/tiwlan_ap.ini -e /pds/wifi/nvs_map.bin
class post-zygote_services
disabled
oneshot
service hostapd /system/bin/logwrapper /system/bin/Hostapd -d /data/misc/wifi/hostapd.conf
class post-zygote_services
socket hostapd_tiwlan0 dgram 660 wifi wifi
disabled
oneshot
service dnsmasq /system/bin/logwrapper /system/xbin/dnsmasq -C/data/misc/wifi/dns.conf -k
class post-zygote_services
group wifi
disabled
oneshot
service mynet_start /system/bin/logwrapper /system/bin/sh /data/misc/wifi/forward_start.sh
class post-zygote_services
disabled
oneshot
service mynet_stop /system/bin/logwrapper /system/bin/sh /data/misc/wifi/forward_stop.sh
class post-zygote_services
disabled
oneshot
mapphone_cdma
Code:
on init
# prepare generic keypad name
exec /init_prep_keypad.sh
# Change pppd-ril permissions to setuid-root.
chown root radio /system/bin/pppd-ril
chmod 4770 /system/bin/pppd-ril
mount yaffs2 [email protected] /system ro remount
mount ext3 [email protected] /system ro remount
mount rootfs rootfs / rw remount
mkdir /cdrom 0770 system system
mount yaffs2 [email protected] /cdrom
symlink /dev/ttyGS0 /dev/acm0
# Create mountpoints and mount tmpfs
mkdir /pds 0775 system system
mkdir /tmp 0777 system system
mount tmpfs tmpfs /tmp size=2m
# Configure kernel options
# Disable automatic power control for OHCI USB IPC Temporarily
write /sys/devices/platform/ohci.0/usb1/1-3/power/level auto
# Reset system time
write /sys/class/rtc/rtc0/unsecured_rtc on
# Set core pattern
write /proc/sys/kernel/core_pattern "|/system/bin/coredump %e %p %t"
# Power Management
write /sys/power/sleep_while_idle 1
write /sys/power/enable_off_mode 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 250000
write /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold 86
write /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate 46875
write /sys/power/sr_vdd1_autocomp 1
write /sys/power/sr_vdd2_autocomp 1
write /sys/power/enable_abb_mode 1
# permission for linear vibrator
chown system system /sys/class/timed_output/lvibrator/enable
chown system system /sys/class/timed_output/vibrator/enable
chmod 660 /sys/class/timed_output/vibrator/enable
# Mount mtd partitions
# mount /pds as r/w
# We chown/chmod /pds again so because mount is run as root + defaults
mount yaffs2 [email protected] /pds nosuid nodev no-checkpoint
exec /system/bin/logwrapper /system/bin/mount_ext3.sh pds /pds nosuid,nodev
chown system system /pds
chmod 0775 /pds
mkdir /pds/public
chown system shell /pds/public
chmod 0775 /pds/public
# Mount preinstall partition
mkdir /preinstall 0770 system system
exec /system/bin/logwrapper /system/bin/mount_ext3.sh preinstall /preinstall nosuid,nodev
chmod 0770 /preinstall
chown system system /preinstall
mkdir /preinstall/app 0770 system system
exec /system/bin/logwrapper /system/bin/loadpreinstalls.sh
# Create basic filesystem structure
# create moto specific dirs for mystuff
mkdir /data/download 0775 system system
mkdir /data/download/mystuff 0775 system system
chown radio radio /dev/ttyUSB0
chmod 666 /dev/ttyUSB0
# create moto specific dirs for wifi
mkdir /data/system 0771 system system
# wifi dirs
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
mkdir /pds/wifi 0771 wifi wifi
chmod 777 /system/lib/modules/tiwlan_drv.ko
chmod 777 /system/bin/dhcpcd
chmod 777 /system/bin/wlan_loader
chmod 777 /system/etc/wifi/fw_wlan1271.bin
chmod 777 /system/etc/wifi/tiwlan.ini
chmod 777 /config/wifi/nvs_map.bin
chmod 777 /system/bin/logwrapper
chmod 777 /system/bin/wpa_supplicant
chmod 777 /system/etc/wifi/wpa_supplicant.conf
# bluetooth power up/down interface
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/state
# create logger folder
mkdir /data/logger 0770 radio log
chown radio log /data/logger
chmod 0770 /data/logger
mkdir /data/panicreports
chown root radio /data/panicreports
chmod 0777 /data/panicreports
# create the lost+found directories, so as to enforce our permissions
mkdir /pds/lost+found 0770
# double check the perms, in case lost+found already exists, and set owner
chown root root /pds/lost+found
chmod 0770 /pds/lost+found
#Create location directory
mkdir /data/location 0771 radio radio
# Create anr directory and change permission to 777 to save trace.txt
mkdir /data/anr
chmod 0777 /data/anr
# create the necessary dirs for tpapi with proper permission
mkdir /pds/security
mkdir /data/tpapi
mkdir /data/tpapi/etc
mkdir /data/tpapi/etc/tpa
mkdir /data/tpapi/etc/tpa/persistent
chmod 2770 /pds/security
chmod 2770 /data/tpapi
chmod 2770 /data/tpapi/etc
chmod 2770 /data/tpapi/etc/tpa
chmod 2770 /data/tpapi/etc/tpa/persistent
chown mot_tpapi mot_tpapi /pds/security
chown mot_tpapi mot_tpapi /data/tpapi
chown mot_tpapi mot_tpapi /data/tpapi/etc
chown mot_tpapi mot_tpapi /data/tpapi/etc/tpa
chown mot_tpapi mot_tpapi /data/tpapi/etc/tpa/persistent
# Create wmdrm directory
mkdir /pds/wmdrm 0775 mot_drm mot_drm
# Temp workaround for HP library cleanup
symlink /dev/hp3a-omap /dev/hp3A-omap
# Permissions for DspBridge
chmod 0666 /dev/DspBridge
# Permissions for video
chmod 0770 /dev/hp3a-omap
chmod 0770 /dev/video0
chmod 0770 /dev/video1
chmod 0770 /dev/video2
chown media camera /dev/hp3a-omap
chown media camera /dev/video0
chown media graphics /dev/video1
chown media graphics /dev/video2
mount rootfs rootfs / ro remount
# Install kernel modules
insmod /system/lib/modules/sec.ko
# chown/chmod for FOTA
chown system system /cache/fota
chmod 0770 /cache/fota
on early-boot
# Adjust the out of memory thresholds to account for the larget
# space on sholes. These numbers are in pages (4k). Must be kept
# in sync with init.rc. This must be done before the regular init.rc
# since these properies can't change once set.
setprop ro.FOREGROUND_APP_MEM 3072
setprop ro.VISIBLE_APP_MEM 4608
setprop ro.SECONDARY_SERVER_MEM 9216
setprop ro.BACKUP_APP_MEM 9216
setprop ro.HOME_APP_MEM 9216
setprop ro.HIDDEN_APP_MEM 10752
setprop ro.CONTENT_PROVIDER_MEM 12288
setprop ro.EMPTY_APP_MEM 12288
class_start media_early_init
on boot
# Overwrite what init.rc selected for the memory killer params to match above.
write /sys/module/lowmemorykiller/parameters/minfree 3072,4608,9216,10752,12288,12288
# Define Motorola DBVC ATVC Property defaults (failsafe properties)
setprop ro.sys.atvc_allow_netmon_usb 0
setprop ro.sys.atvc_allow_netmon_ih 0
setprop ro.sys.atvc_allow_res_core 0
setprop ro.sys.atvc_allow_res_panic 0
setprop ro.sys.atvc_allow_all_adb 0
setprop ro.sys.atvc_allow_all_core 0
setprop ro.sys.atvc_allow_efem 0
setprop ro.sys.atvc_allow_bp_log 0
setprop ro.sys.atvc_allow_ap_mot_log 0
# Change the ownership of led files.
chown system system /sys/class/leds/lcd-backlight/als
chown system system /sys/class/leds/lcd-backlight/pwm_mode
chown system system /sys/class/leds/lcd-backlight/brightness
chmod 0660 /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/keyboard-backlight/brightness
chmod 0660 /sys/class/leds/keyboard-backlight/brightness
chown system system /sys/class/leds/button-backlight/brightness
chmod 0660 /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/red/blink
chown system system /sys/class/leds/red/brightness
chmod 0660 /sys/class/leds/red/brightness
chown system system /sys/class/leds/green/brightness
chmod 0660 /sys/class/leds/green/brightness
chmod 0660 /sys/class/leds/torch-flash/camera_strobe
chmod 0660 /sys/class/leds/torch-flash/flash_light
chown system system /sys/class/leds/torch-flash/camera_strobe
chown system system /sys/class/leds/torch-flash/flash_light
chown system system /sys/class/leds/spotlight/brightness
chmod 0660 /sys/class/leds/blue/brightness
# Camera related
chmod 0660 /dev/hplens-omap
chown media camera /dev/hplens-omap
# Enable panic on softlockup
write /proc/sys/kernel/softlockup_panic 1
# Start services
exec /system/bin/mot_boot_mode
# Set core max size (2G)
setrlimit 4 2147483648 2147483648
# The properties introduced by moto
on property:sys.chargeonly.mode=1
start battd
start console
exec /system/bin/charge_only_mode
# Power up to normal
on property:tcmd.suspend=0
class_start pre-zygote_services
class_start zygote_services
class_start post-zygote_services
# Power up to suspend
on property:tcmd.suspend=1
class_start pre-zygote_services
class_start post-zygote_services
# Normal to suspend
on property:tcmd.suspend=2
class_stop zygote_services
# aplogd on at boot in emulator
#on property:ro.kernel.qemu=1
# start aplogd
#on property:persist.service.aplogd.enable=1
# start aplogd
#on property:persist.service.aplogd.enable=0
# stop aplogd
# Moto safe power down
on property:sys.reboot=1
exec /system/bin/sleep 10
exec /system/bin/reboot
on property:sys.shutdown=1
exec /system/bin/sleep 10
exec /system/bin/reboot -p
on property:init.svc.wpa_supplicant=stopped
stop dhcpcd
# The following services are added by moto
# Set property strings for ATVC logging
# This conditionally sets :
# ro.sys.atvc_allow_bp_log
# ro.sys.atvc_allow_ap_mot_log
# ro.sys.atvc_allow_all_core
# ro.sys.atvc_allow_res_core
# ro.sys.atvc_allow_res_panic
# ro.sys.atvc_allow_efem
# ro.sys.atvc_allow_netmon_usb
# ro.sys.atvc_allow_netmon_ih
# ro.sys.atvc_allow_all_adb
service atvc /system/bin/dbvc_atvc_property_set
class pre-zygote_services
user system
group system
oneshot
#service watchdogd /system/bin/watchdogd
# class pre-zygote_services
service telnet /system/bin/telnetd
class pre-zygote_services
oneshot
service usbd /system/bin/usbd
class pre-zygote_services
service battd /system/bin/battd
class pre-zygote_services
socket battdsock stream 0660 mot_accy mot_accy
user root
group mot_accy mot_pwric
oneshot
service catcommands /system/bin/catcommands
class pre-zygote_services
group radio
service hciattach /system/bin/hciattach \
-n -t 10 /dev/ttyS1 texasalt 3000000 flow
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
service nap /system/bin/sdptool add NAP
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service del_nap /system/bin/sdptool remove NAP
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service panu /system/bin/sdptool add PANU
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service del_panu /system/bin/sdptool remove PANU
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service napics /system/bin/sh /system/bin/napics.sh
class post-zygote_services
user root
disabled
oneshot
service btdhcpd /system/xbin/dnsmasq -C /etc/btpan.conf
class post-zygote_services
user root
disabled
oneshot
service tcmd /system/bin/tcmd
class post-zygote_services
group mot_tcmd radio mot_pwric input system log camera graphics mot_accy sdcard_rw audio inet bluetooth wifi compass net_bt_admin mot_tombstone mot_tpapi mount
socket local_tcmd stream 0660 mot_tcmd mot_tcmd
socket batch_socket stream 0600 mot_tcmd mot_tcmd
oneshot
service tcmdhelp /system/bin/tcmdhelp
class post-zygote_services
oneshot
disabled
# turn on wifi for tcmd step one
on property:tcmd.load_wlan=1
insmod /system/lib/modules/tiwlan_drv.ko
# turn on wifi for tcmd step two
on property:tcmd.load_wlan=2
start wlan_loader
# turn on wifi for tcmd step three
on property:tcmd.load_wlan=3
exec /system/bin/ifconfig tiwlan0 up
# turn off wifi for tcmd step one
on property:tcmd.unload_wlan=1
exec /system/bin/ifconfig tiwlan0 down
# turn off wifi for tcmd step two
on property:tcmd.unload_wlan=2
exec /system/bin/rmmod tiwlan_drv
# turn on bluetooth for tcmd
on property:tcmd.bt_mod=1
insmod /system/lib/modules/wl127x-test.ko
#turn off bluetooth for tcmd
on property:tcmd.bt_mod=0
exec /system/bin/rmmod wl127x_test
#execute tcmdhelp
on property:tcmd.start_tcmdhelp=1
start tcmdhelp
# Ecompass daemon
service akmd2 /system/bin/akmd2
class post-zygote_services
user compass
group compass misc input
service wlan_loader /system/bin/wlan_loader \
-f /system/etc/wifi/fw_wlan1271.bin -i /system/etc/wifi/tiwlan.ini \
-e /pds/wifi/nvs_map.bin
class post-zygote_services
disabled
oneshot
service wpa_supplicant /system/bin/wpa_supplicant \
-Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf
class post-zygote_services
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
socket wpa_tiwlan0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd /system/bin/dhcpcd -ABKL tiwlan0
class post-zygote_services
disabled
oneshot
service autoip /system/bin/dhcpcd -BK tiwlan0
class post-zygote_services
disabled
oneshot
service btdhcpcd /system/bin/dhcpcd -ABKL bnep0
class post-zygote_services
disabled
oneshot
service btautoip /system/bin/dhcpcd -BK bnep0
class post-zygote_services
disabled
oneshot
service baseimage /system/bin/dspexec -v -T /system/lib/dsp/baseimage.dof
class media_early_init
user media
group media graphics
oneshot
service pvrsrv /system/bin/pvrsrvinit
class post-zygote_services
user root
oneshot
service pppd-ril /system/bin/pppd-ril /dev/ttyUSB0 call pppd-ril.options plugin /system/lib/libpppd_plugin-ril.so
class post-zygote_services
user root
disabled
oneshot
service pppd /system/xbin/pppd silent ipparam dun plugin /system/lib/libpppd_plugin.so
class post-zygote_services
user root
disabled
oneshot
service ulogd /system/xbin/ulogd
class post-zygote_services
user root
disabled
oneshot
service firewall /system/bin/firewall.sh
class post-zygote_services
user root
disabled
oneshot
service locDrv /system/usr/bin/brcm_guci_drv -config /system/etc/gpsconfig.xml
class post-zygote_services
user radio
group radio inet sdcard_rw
oneshot
service setup_bt /system/bin/sh /system/usr/bin/setup_bt.sh
class post-zygote_services
oneshot
service opp /system/bin/sdptool add --channel=12 OPUSH
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service pm_init /system/bin/sh /system/usr/bin/pm_init.sh
class post-zygote_services
oneshot
service modemlog /system/bin/modemlog
class pre-zygote_services
oneshot
# aplogd is controlled by the persist.service.aplogd.enable system property
#service aplogd /system/bin/aplogd
# class post-zygote_services
# socket ap_aol_cmd stream 666 system system
# user log
# group log system sdcard_rw
# oneshot
service fmradio /system/bin/fmradioserver
class post-zygote_services
disabled
group bluetooth
service ftmipcd /system/bin/ftmipcd
class post-zygote_services
oneshot
service dlnasrv /system/bin/dlnasrv
class post-zygote_services
disabled
oneshot
service dund_dialup /system/bin/dund --listen --channel=6 --nodetach --dialup
class post-zygote_services
disabled
oneshot
# bugreport is triggered by the KEY_SHIFT and KEY_DEL keycodes
service bugreport_keypad /system/bin/dumpstate -d -v -o /sdcard/bugreports/bugreport
disabled
oneshot
keycodes 42 14
# bugreport for Shadow is triggered by the KEY_SHIFT and KEY_MENU keycodes
service bugreport /system/bin/dumpstate -d -v -o /sdcard/bugreports/bugreport
disabled
oneshot
keycodes 139 217
service mdm_panicd /system/bin/mdm_panicd
class post-zygote_services
oneshot
service logging /system/bin/sh /logging.sh
disabled
user root
oneshot
on property:EXTERNAL_STORAGE_STATE="mounted"
mkdir /sdcard/logs 0777 root root
start logging
on property:EXTERNAL_STORAGE_STATE="bad_removal"
stop logging
#get BP version and save to misc
service savebpver /system/bin/SaveBPVer
class post-zygote_services
oneshot
on property:dev.bootcomplete=1
start savebpver
service smcdaemon /system/bin/startup_smc.sh
class post-zygote_services
disabled
oneshot
# Backup/Restore Feature
on property:mot.backup_restore.status="Finished"
start zygote
service mot_backup /system/bin/logwrapper /system/xbin/run_backup /system/etc/backup_targets.csv
disabled
user root
oneshot
service mot_restore /system/bin/logwrapper /system/xbin/run_restore /system/etc/backup_targets.csv
disabled
user root
oneshot
# ecckeyd daemon has dependency on SMC
# It needs to be root because it needs to be able to read client's /proc/<pid>/status.
# user/group as mot_tpapi/mot_tpapi does not give it enough permission
service ecckeydaemon /system/bin/ecckeyd
class post-zygote_services
socket ecckey_socket stream 660 mot_tpapi mot_tpapi
group mot_tpapi
disabled
oneshot
on property:mot.backup_restore.action="run_backup"
setprop mot.backup_restore.status "Running"
stop zygote
start mot_backup
on property:mot.backup_restore.action="run_restore"
setprop mot.backup_restore.status "Running"
stop zygote
start mot_restore
on property:ro.service.start.smc=1
start smcdaemon
start ecckeydaemon
service secclkd /system/bin/secclkd
class post-zygote_services
socket secclk_socket stream 660 mot_secclkd mot_secclkd
user mot_tpapi
group mot_tpapi mot_sec_rtc mot_secclkd
oneshot
mapphone30_umts
Code:
on init
# Backward compatibility
symlink /dev /dev/netmux
# prepare generic keypad name
mount yaffs2 [email protected] /system rw remount
exec /init_prep_keypad.sh
mount yaffs2 [email protected] /system ro remount
mount rootfs rootfs / rw remount
mkdir /cdrom 0770 system system
mount yaffs2 [email protected] /cdrom
# remove chmod workaround once J-AT parser security changes are ready
chmod 666 /dev/ttyGS0
symlink /dev/ttyGS0 /dev/acm0
# Create mountpoints and mount tmpfs
mkdir /pds 0775 system system
mkdir /tmp 0777 system system
mount tmpfs tmpfs /tmp size=2m
# Configure kernel options
# Enable automatic power control for EHCI USB IPC
write /sys/devices/platform/ehci-omap.0/usb1/power/level auto
write /sys/devices/platform/ehci-omap.0/usb1/power/autosuspend 0
write /sys/devices/platform/ehci-omap.0/usb1/1-3/power/level auto
write /sys/devices/platform/ehci-omap.0/usb1/1-3/power/autosuspend 0
# Reset system time
write /sys/class/rtc/rtc0/unsecured_rtc on
# Set core pattern
write /proc/sys/kernel/core_pattern "|/system/bin/coredump %e %p %t"
write /proc/sys/fs/suid_dumpable 2
# Power Management
write /sys/power/sleep_while_idle 1
write /sys/power/enable_off_mode 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 250000
write /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold 86
write /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate 46875
chown radio radio /dev/ttyS0
chmod 640 /dev/ttyS0
# permission for linear vibrator
chown system system /sys/class/timed_output/lvibrator/enable
# Change ownership of vibrator
chmod 0660 /sys/class/timed_output/vibrator/enable
# Mount mtd partitions
# mount /pds as r/w
# We chown/chmod /pds again so because mount is run as root + defaults
mount yaffs2 [email protected] /pds nosuid nodev no-checkpoint
chown system system /pds
chmod 0775 /pds
mkdir /pds/comm_drv 0770 radio radio
mkdir /pds/public 0755 system shell
chown system shell /pds/public
# Create basic filesystem structure
# create moto specific dirs for mystuff
mkdir /data/download 0775 system system
mkdir /data/download/mystuff 0775 system system
# sensor interface
chown compass compass /dev/lis331dlh
chmod 660 /dev/lis331dlh
chown compass compass /dev/kxtf9
chmod 660 /dev/kxtf9
chown compass compass /dev/akm8973
chmod 660 /dev/akm8973
chown compass compass /dev/sfh7743
chmod 660 /dev/sfh7743
chown compass compass /dev/akm8973_dev
chmod 660 /dev/akm8973_dev
chown compass compass /dev/akm8973_aot
chmod 660 /dev/akm8973_aot
chown compass compass /dev/airc
chmod 660 /dev/airc
# create moto specific dirs for wifi
mkdir /data/system 0771 system system
# wifi dirs
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
mkdir /pds/wifi 0771 wifi wifi
mkdir /data/comm_drv 0770 radio radio
mkdir /data/gki 0770 radio radio
mkdir /tmp/commdrv 0770 radio radio
# bluetooth power up/down interface
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/state
# bluetooth uart
chown bluetooth bluetooth /dev/ttyS1
chmod 0660 /dev/ttyS1
# following two dirs are for storing BP Flex and PDS files. NVM Daemon is using these folders
mkdir /data/bp_nvm 0770 radio radio
mkdir /pds/bp_nvm 0770 radio radio
# create logger folder for bplogd
mkdir /data/logger 0770 radio log
chown radio log /data/logger
chmod 0770 /data/logger
mkdir /data/panicreports
chown root radio /data/panicreports
chmod 0777 /data/panicreports
# create the lost+found directories, so as to enforce our permissions
mkdir /pds/lost+found 0770
# double check the perms, in case lost+found already exists, and set owner
chown root root /pds/lost+found
chmod 0770 /pds/lost+found
#Create location directory
mkdir /data/location 0771 radio radio
#Create opprof directory and backup pds directory
mkdir /data/opprof 0770 radio shell
mkdir /pds/opprof 0770 radio shell
# Create anr directory and change permission to 777 to save trace.txt
mkdir /data/anr
chmod 0777 /data/anr
# create the necessary dirs for tpapi with proper permission
mkdir /pds/security
mkdir /data/tpapi
mkdir /data/tpapi/etc
mkdir /data/tpapi/etc/tpa
mkdir /data/tpapi/etc/tpa/persistent
chmod 2770 /pds/security
chmod 2770 /data/tpapi
chmod 2770 /data/tpapi/etc
chmod 2770 /data/tpapi/etc/tpa
chmod 2770 /data/tpapi/etc/tpa/persistent
chown mot_tpapi mot_tpapi /pds/security
chown mot_tpapi mot_tpapi /data/tpapi
chown mot_tpapi mot_tpapi /data/tpapi/etc
chown mot_tpapi mot_tpapi /data/tpapi/etc/tpa
chown mot_tpapi mot_tpapi /data/tpapi/etc/tpa/persistent
# Create wmdrm directory
mkdir /pds/wmdrm 0775 mot_drm mot_drm
# Temp workaround for HP library cleanup
symlink /dev/hp3a-omap /dev/hp3A-omap
mount rootfs rootfs / ro remount
# Install kernel modules
# Install BP related kernel modules
#Start the engine modules for netmux first for other daemons depends on it
insmod /system/lib/modules/netmux.ko
insmod /system/lib/modules/netmux_linkdriver.ko
insmod /system/lib/modules/sim.ko
insmod /system/lib/modules/modem_pm_driver.ko
insmod /system/lib/modules/sec.ko
# chown/chmod for FOTA
chown system system /cache/fota
chmod 0770 /cache/fota
on early-boot
# Adjust the out of memory thresholds to account for the larget
# space on sholes. These numbers are in pages (4k). Must be kept
# in sync with init.rc. This must be done before the regular init.rc
# since these properies can't change once set.
setprop ro.FOREGROUND_APP_MEM 3072
setprop ro.VISIBLE_APP_MEM 4608
setprop ro.SECONDARY_SERVER_MEM 9216
setprop ro.BACKUP_APP_MEM 9216
setprop ro.HOME_APP_MEM 9216
setprop ro.HIDDEN_APP_MEM 10752
setprop ro.CONTENT_PROVIDER_MEM 12288
setprop ro.EMPTY_APP_MEM 12288
class_start media_early_init
on boot
# Overwrite what init.rc selected for the memory killer params to match above.
write /sys/module/lowmemorykiller/parameters/minfree 3072,4608,9216,10752,12288,12288
# Define Motorola DBVC ATVC Property defaults (failsafe properties)
setprop ro.sys.atvc_allow_netmon_usb 0
setprop ro.sys.atvc_allow_netmon_ih 0
setprop ro.sys.atvc_allow_res_core 0
setprop ro.sys.atvc_allow_res_panic 0
setprop ro.sys.atvc_allow_all_adb 0
setprop ro.sys.atvc_allow_all_core 0
setprop ro.sys.atvc_allow_efem 0
setprop ro.sys.atvc_allow_bp_log 0
setprop ro.sys.atvc_allow_ap_mot_log 0
setprop ro.sys.atvc_allow_gki_log 0
# Change the ownership of led files.
chown system system /sys/class/leds/lcd-backlight/als
chown system system /sys/class/leds/lcd-backlight/pwm_mode
chown system system /sys/class/leds/lcd-backlight/brightness
chmod 0660 /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/keyboard-backlight/brightness
chmod 0660 /sys/class/leds/keyboard-backlight/brightness
chown system system /sys/class/leds/button-backlight/brightness
chmod 0660 /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/red/blink
chown system system /sys/class/leds/red/brightness
chmod 0660 /sys/class/leds/red/brightness
chown system system /sys/class/leds/green/brightness
chmod 0660 /sys/class/leds/green/brightness
chmod 0660 /sys/class/leds/torch-flash/camera_strobe
chmod 0660 /sys/class/leds/torch-flash/flash_light
chown system system /sys/class/leds/torch-flash/camera_strobe
chown system system /sys/class/leds/torch-flash/flash_light
chown system system /sys/class/leds/spotlight/brightness
chown system system /sys/class/leds/blue/brightness
chmod 0660 /sys/class/leds/blue/brightness
# Camera related
chmod 0660 /dev/hplens-omap
chown media camera /dev/hplens-omap
# Enable panic on softlockup
write /proc/sys/kernel/softlockup_panic 1
# Start services
exec /system/bin/mot_boot_mode
# Set core max size (2G)
setrlimit 4 2147483648 2147483648
# The properties introduced by moto
on property:sys.chargeonly.mode=1
start battd
start console
exec /system/bin/charge_only_mode
# Power up to normal
on property:tcmd.suspend=0
class_start pre-zygote_services
class_start zygote_services
class_start post-zygote_services
# Power up to suspend
on property:tcmd.suspend=1
class_start pre-zygote_services
class_start post-zygote_services
# Normal to suspend
on property:tcmd.suspend=2
class_stop zygote_services
# Normal to suspend
on property:tcmd.suspend=2
class_stop zygote_services
# aplogd on at boot in emulator
on property:ro.kernel.qemu=1
start aplogd
on property:persist.service.aplogd.enable=1
start aplogd
on property:persist.service.aplogd.enable=0
stop aplogd
on property:ro.sys.atvc_allow_gki_log=1
start gkilogd
on property:ro.sys.atvc_allow_gki_log=0
stop gkilogd
# Moto safe power down
on property:sys.reboot=1
stop ssmgrd
exec /system/bin/sleep 10
exec /system/bin/reboot
on property:sys.shutdown=1
stop ssmgrd
exec /system/bin/sleep 10
exec /system/bin/reboot -p
on property:init.svc.wpa_supplicant=stopped
stop dhcpcd
# The following services are added by moto
# Set property strings for ATVC logging
# This conditionally sets :
# ro.sys.atvc_allow_bp_log
# ro.sys.atvc_allow_gki_log
# ro.sys.atvc_allow_ap_mot_log
# ro.sys.atvc_allow_all_core
# ro.sys.atvc_allow_res_core
# ro.sys.atvc_allow_res_panic
# ro.sys.atvc_allow_efem
# ro.sys.atvc_allow_netmon_usb
# ro.sys.atvc_allow_netmon_ih
# ro.sys.atvc_allow_all_adb
service atvc /system/bin/dbvc_atvc_property_set
class pre-zygote_services
user system
group system
oneshot
#service watchdogd /system/bin/watchdogd
# class pre-zygote_services
service telnet /system/bin/telnetd
class pre-zygote_services
oneshot
service usbd /system/bin/usbd
class pre-zygote_services
service nvm-daemon /system/usr/bin/nvm_daemon
class pre-zygote_services
user radio
group radio
# start start_modem.sh to for development purpose
service start_modem /system/bin/sh /system/usr/bin/start_modem.sh
class pre-zygote_services
oneshot
# start commdrv pds script
service start_commdrv /system/bin/sh /system/etc/motorola/comm_drv/commdrv_fs.sh
class pre-zygote_services
oneshot
user radio
group radio
service gkisystem /system/bin/gkisystem
class pre-zygote_services
socket location_shim stream 660 radio system
socket gpshal_socket stream 660 radio system
socket opprofdaemon stream 660 radio system
socket gkilog_sock stream 660 radio radio
group radio system mot_accy mot_secclkd
onrestart exec /system/usr/bin/gki_pd_notifier
service rild_tcmd /system/bin/rild_tcmd
class pre-zygote_services
socket rild_tcmd stream 0660 radio mot_tcmd
user radio
group radio
service battd /system/bin/battd
class pre-zygote_services
socket battdsock stream 0660 mot_accy mot_accy
user root
group mot_accy mot_pwric
oneshot
service catcommands /system/bin/catcommands
class pre-zygote_services
group radio
service bplogd_daemon /system/usr/bin/bplogd_daemon
class pre-zygote_services
socket dlog_cmds stream 660 radio log
socket bp_pd_status stream 660 radio log
socket bp_aol_cmd stream 666 radio log
user radio
group radio inet log sdcard_rw
oneshot
service modemlog /system/bin/modemlog
class pre-zygote_services
oneshot
service ssmgrd /system/xbin/ssmgrd
class post-zygote_services
group radio input mot_pwric
oneshot
service hciattach /system/bin/hciattach \
-n -t 10 /dev/ttyS1 texasalt 3000000 flow
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
service nap /system/bin/sdptool add NAP
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service del_nap /system/bin/sdptool remove NAP
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service panu /system/bin/sdptool add PANU
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service del_panu /system/bin/sdptool remove PANU
class post-zygote_services
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service napics /system/bin/sh /system/bin/napics.sh
class post-zygote_services
user root
disabled
oneshot
service btdhcpd /system/xbin/dnsmasq -C /etc/btpan.conf
class post-zygote_services
user root
disabled
oneshot
service tcmd /system/bin/tcmd
class post-zygote_services
group mot_tcmd radio mot_pwric input system log camera graphics mot_accy sdcard_rw audio inet bluetooth wifi compass net_bt_admin mot_tombstone mot_tpapi mount
socket local_tcmd stream 0660 mot_tcmd mot_tcmd
socket batch_socket stream 0600 mot_tcmd mot_tcmd
oneshot
service tcmdhelp /system/bin/tcmdhelp
class post-zygote_services
oneshot
disabled
# turn on wifi for tcmd step one
on property:tcmd.load_wlan=1
insmod /system/lib/modules/tiwlan_drv.ko
# turn on wifi for tcmd step two
on property:tcmd.load_wlan=2
start wlan_loader
# turn on wifi for tcmd step three
on property:tcmd.load_wlan=3
exec /system/bin/ifconfig tiwlan0 up
# turn off wifi for tcmd step one
on property:tcmd.unload_wlan=1
exec /system/bin/ifconfig tiwlan0 down
# turn off wifi for tcmd step two
on property:tcmd.unload_wlan=2
exec /system/bin/rmmod tiwlan_drv
# turn on bluetooth for tcmd
on property:tcmd.bt_mod=1
insmod /system/lib/modules/wl127x-test.ko
#turn off bluetooth for tcmd
on property:tcmd.bt_mod=0
exec /system/bin/rmmod wl127x_test
#execute tcmdhelp
on property:tcmd.start_tcmdhelp=1
start tcmdhelp
service panic_daemon /system/usr/bin/panic_daemon
class post-zygote_services
user radio
group radio system graphics sdcard_rw
socket panic_daemon stream 660 radio radio
onrestart exec /system/bin/reboot
# Ecompass daemon
service akmd2 /system/bin/akmd2
class post-zygote_services
user compass
group compass misc input
service wlan_loader /system/bin/wlan_loader \
-f /system/etc/wifi/fw_wlan1271.bin -i /system/etc/wifi/tiwlan.ini \
-e /pds/wifi/nvs_map.bin
class post-zygote_services
disabled
oneshot
service wpa_supplicant /system/bin/wpa_supplicant \
-Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf
class post-zygote_services
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
socket wpa_tiwlan0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd /system/bin/dhcpcd -ABKL tiwlan0
class post-zygote_services
disabled
oneshot
service autoip /system/bin/dhcpcd -BK tiwlan0
class post-zygote_services
disabled
oneshot
service btdhcpcd /system/bin/dhcpcd -ABKL bnep0
class post-zygote_services
disabled
oneshot
service btautoip /system/bin/dhcpcd -BK bnep0
class post-zygote_services
disabled
oneshot
service baseimage /system/bin/dspexec -v -T /system/lib/dsp/baseimage.dof
class media_early_init
user media
group media graphics
oneshot
service pvrsrv /system/bin/pvrsrvinit
class post-zygote_services
user root
oneshot
service pppd /system/xbin/pppd silent ipparam dun plugin /system/lib/libpppd_plugin.so
class post-zygote_services
user root
disabled
oneshot
service ulogd /system/xbin/ulogd
class post-zygote_services
user root
disabled
oneshot
service firewall /system/bin/firewall.sh
class post-zygote_services
user root
disabled
oneshot
service locDrv /system/usr/bin/brcm_guci_drv -config /system/etc/gpsconfig.xml
class post-zygote_services
user radio
group radio inet sdcard_rw
service pm_init /system/bin/sh /system/usr/bin/pm_init.sh
class post-zygote_services
oneshot
# aplogd is controlled by the persist.service.aplogd.enable system property
service aplogd /system/bin/aplogd
class post-zygote_services
socket ap_aol_cmd stream 666 system system
user log
group log system sdcard_rw
oneshot
service gkilogd /system/bin/gkilogd
class post-zygote_services
socket gki_aol_cmd stream 660 radio log
user radio
group radio log sdcard_rw
service fmradio /system/bin/fmradioserver
class post-zygote_services
disabled
group bluetooth
service secclkd /system/bin/secclkd
class post-zygote_services
socket secclk_socket stream 660 mot_secclkd mot_secclkd
user mot_tpapi
group mot_tpapi mot_sec_rtc mot_secclkd
oneshot
service dlnasrv /system/bin/dlnasrv
class post-zygote_services
disabled
oneshot
service dund_dialup /system/bin/dund --listen --channel=6 --nodetach --dialup
class post-zygote_services
disabled
oneshot
Is that what you're looking for?
Looks like HTC has learned but Motorola hasn't yet. I count at least 3 exploitable operations just in init.rc. Fun stuff.
mrozzeh said:
Looks like HTC has learned but Motorola hasn't yet. I count at least 3 exploitable operations just in init.rc. Fun stuff.
Click to expand...
Click to collapse
shoooooosh, we need them to leave them in for froyo, 2.1 is already rooted!
and do all android phones run dnsmasq? or is that for hotspot?

[Q] mount in init.d script

hello, i have that script:
Code:
#!/system/bin/sh
rm -R /cache/download /sd-ext/download
mkdir /cache/download /sd-ext/download
chmod 0771 /cache/download /sd-ext/download
chown 1000:2001 /cache/download /sd-ext/download
mount -o bind /sd-ext/download /cache/download
And i don't know why in mount i have:
Code:
/dev/block/mmbblk0p2 on /cache/download\040(deleted) type ext3 ...
What is this "\040(deleted)"? This same i have in /proc/mounts
http://bytes.com/topic/c/answers/712378-why-backslash-space-combo-escape-sequence-040-a
In a string or character literal, the sequence \040 denotes the octal
value of the character (your C textbook should explain this). 040
octal is 32 decimal, which happens to be the ASCII code for the space
character (though C doesn't require ASCII).
Click to expand...
Click to collapse
It's a space? Idk though for sure
Emmm, no

[Q] rooted but superuser permission denied everything in samsung pocket gt-s5300

I FINALY FOUND MY PROBLEM
I have two binaries one in /system/xbin/su and the other in /system/bin/su
#ls -l /system/*/su gives me this:
-rwxrwxr- system sdcard_rw 380532 2013-05-22 17:13 su
-rwsr-xr-x root root 22236 2013-05-22 17:13 su
#chmod 06775 /system/bin/su gives me this:
unable to chmod /system/bin/su: readonly filesystem
#echo $PATH gives me this
/system/bin/su: /system/Xbin/su
so what should i do next?
is it possible to swap the path variables
i mean to make "echo $path give /system/Xbin/su:/system/bin/su"
10Q
GAEENG said:
I FINALY FOUND MY PROBLEM
I have two binaries one in /system/xbin/su and the other in /system/bin/su
#ls -l /system/*/su gives me this:
-rwxrwxr- system sdcard_rw 380532 2013-05-22 17:13 su
-rwsr-xr-x root root 22236 2013-05-22 17:13 su
#chmod 06775 /system/bin/su gives me this:
unable to chmod /system/bin/su: readonly filesystem
#echo $PATH gives me this
/system/bin/su: /system/Xbin/su
so what should i do next?
is it possible to swap the path variables
i mean to make "echo $path give /system/Xbin/su:/system/bin/su"
10Q
Click to expand...
Click to collapse
Switch to SuperSU!

Manual root mounted system.img

Hello.
I have system.img 5.0.2 for Lenovo S60. Bootloader is secured.
system.img: Linux rev 1.0 ext4 filesystem data, UUID=57f8f4bc-abf4-655f-bf67-946fc0f9f25b (extents) (large files)
I'm trying to install manually su binary in mounted system image and then flash it with QPST.
SELinux is enabled. I prepared script like this:
#!/bin/sh
SYSPAT=sys
#
echo "Placing files"
#
mkdir $SYSPAT/bin/.ext
chown 0:0 $SYSPAT/bin/.ext
chmod 0777 $SYSPAT/bin/.ext
cp su $SYSPAT/bin/.ext/.su
chown 0:0 $SYSPAT/bin/.ext/.su
chmod 0755 $SYSPAT/bin/.ext/.su
cp su $SYSPAT/xbin/su
chown 0:0 $SYSPAT/xbin/su
chmod 0755 $SYSPAT/xbin/su
cp su $SYSPAT/xbin/daemonsu
chown 0:0 $SYSPAT/xbin/daemonsu
chmod 0755 $SYSPAT/xbin/daemonsu
cp su $SYSPAT/xbin/sugote
chown 0:0 $SYSPAT/xbin/sugote
chmod 0755 $SYSPAT/xbin/sugote
cp $SYSPAT/bin/sh $SYSPAT/xbin/sugote-mksh
chown 0:0 $SYSPAT/xbin/sugote-mksh
chmod 0755 $SYSPAT/xbin/sugote-mksh
cp supolicy $SYSPAT/xbin/supolicy
chown 0:0 $SYSPAT/xbin/supolicy
chmod 0755 $SYSPAT/xbin/supolicy
SYSTEMLIB=$SYSPAT/lib64
cp libsupol.so $SYSTEMLIB
chown 0:0 $SYSTEMLIB/libsupol.so
chmod 0755 $SYSTEMLIB/libsupol.so
#mkdir $SYSPAT/app/SuperSU
#chown 0:0 $SYSPAT/app/SuperSU
#chmod 0755 $SYSPAT/app/SuperSU
rm -rf $SYSPAT/app/SuperSU
#install it manually
cp -f $SYSPAT/bin/app_process64 $SYSPAT/bin/app_process64_original
cat su > $SYSPAT/bin/app_process64
cp -f $SYSPAT/bin/app_process64_original $SYSPAT/bin/app_process_init
chown 0:2000 $SYSPAT/bin/app_process_init
chmod 0755 $SYSPAT/bin/app_process_init
cat $SYSPAT/bin/app_process64_original > $SYSPAT/bin/app_process64
cp -f 99SuperSUDaemon $SYSPAT/etc/init.d/99SuperSUDaemon
chown 0:0 $SYSPAT/etc/init.d/99SuperSUDaemon
chmod 0755 $SYSPAT/etc/init.d/99SuperSUDaemon
cat init.qcom.post_boot.sh > $SYSPAT/etc/init.qcom.post_boot.sh
echo 1 > $SYSPAT/etc/.installed_su_daemon
chown 0:0 $SYSPAT/etc/.installed_su_daemon
chmod 0644 $SYSPAT/etc/.installed_su_daemon
#
echo "Done!"
#
#
#because ping has root permissions and correct sleinux context
#
cat su > $SYSPAT/bin/ping
When i'm creating new file the SeLinuxContext is ?:
Code:
-rwxr-xr-x. 1 root 2000 u:object_r:system_file:s0 9696 lip 16 11:55 antradio_app
-rwxr-xr-x. 1 root 2000 u:object_r:system_file:s0 89632 lip 16 11:55 btconfig
-rwxr-xr-x. 1 root 2000 u:object_r:system_file:s0 34352 lip 16 11:55 bttool
-rwxr-xr-x 1 root root ? 100272 wrz 2 14:38 daemonsu
-rwxr-xr-x. 1 root 2000 u:object_r:system_file:s0 59748 lip 16 11:55 dexdump
-rwxr-xr-x 1 root root ? 100272 wrz 2 14:38 su
-rwxr-xr-x 1 root root ? 100272 wrz 2 14:38 sugote
-rwxr-xr-x 1 root root ? 285016 wrz 2 14:38 sugote-mksh
-rwxr-xr-x 1 root root ? 30168 wrz 2 14:38 supolicy
-rwxr-xr-x. 1 root root u:object_r:system_file:s0 1223776 lip 16 11:55 tcpdump
But when i do like that:
Code:
cat su > $SYSPAT/bin/ping
cat init.qcom.post_boot.sh > $SYSPAT/etc/init.qcom.post_boot.sh
permissions left untouched for example:
-rwxr-xr-x. 1 root root ubject_r:system_file:s0 42824 lip 16 11:54 sys/bin/ping
But hen i try to run it:
Code:
sh ping
ping: syntax error: 'go~!
I've tried to add:
/system/xbin/daemonsu --auto-daemon
on the end of:
/etc/init.qcom.post_boot.sh
HiJacking of the bin/app_process64 cause that phone won't play bootanimation and does not start launcher but i can see internal memory MTP Device.
SuperSU apk still warn: There is no SU binary installed and SuperSu cannot install it.
i have same problem with a cheap chinese **** (MTK based 4.4.2) I'v been readed the raw system.img with spt. Mounted it under linux copy the files like this (and of course checked in the supersu install script) and after rewrite the system, every files in the right place but i get the error: "You need manual reinstall the su" or something like that
Any idea?
---------- Post added at 09:52 PM ---------- Previous post was at 09:47 PM ----------
ok, my fault sorry
here is the tutorial
http://su.chainfire.eu/#embed

Categories

Resources