boot img files - Droid X Android Development

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?

Related

help please: set up swap w/o a2sd [pretty stumped at this point]

im trying to set up a linux_swap partition, but i dont want to use apps2sd, nor do i want to use cache2sd.
can someone point me in the right direction?
kchau said:
im trying to set up a linux_swap partition, but i dont want to use apps2sd, nor do i want to use cache2sd.
can someone point me in the right direction?
Click to expand...
Click to collapse
Just create the linux-swap partition and not the ext partition.
will i have to wipe?
and what is the recommended size?
supremeteam256 said:
Just create the linux-swap partition and not the ext partition.
Click to expand...
Click to collapse
Does that work now? I know it depends on how you are doing it, but assuming a build with auto apps2sd, the script just looks at partition number and will screw up if you do that. I think cyanogen has made adjustments in his experimental line.
im running cyanogen 4.0.4. will it work?
kchau said:
im running cyanogen 4.0.4. will it work?
Click to expand...
Click to collapse
if the script does that couldnt you create a 1mb ext2/3/4?
You also need to edit the user.conf file.
linux_swap_en=1 # enable(1) or disable(0) linux swap
linux_swap_partition=/dev/block/mmcblk0p2 # swap partition device
The usual setting is mmcblk0p3 but you need to set it to mmcblk0p2 because your linus swap part is going to be 2 instead of 3
This is for swap only with no compcache
#compcache related parameters
compcache{
compcache_en=0 # enable(1) or disable(0) compcache
cc_disksize=32 # Ram swap disksize - any number between 1 to 95 should work
cc_memlimit=18 # Limite the memory usage when backing swap is used
cc_backingswap_en=0 # enable or disable backing swap
cc_backingswap=/dev/block/mmcblk0p2 # pointing to the backingswap partition device
cc_swappiness=60 # default 60
}
#Linux swap parameters
#
# linux swap can only be enabled if cc_backingswap_en is set to "0"
#
linux_swap{
linux_swap_en=1 # enable(1) or disable(0) linux swap
linux_swap_partition=/dev/block/mmcblk0p2 # swap partition device
swappiness=60 # default 60
}
will compcache improve speed while running background applications?
so do i have to create an ext3 partition to put the userconf in there?
wait, where do i put the user.conf file then?
i read around and i think im supposed to put the user.conf file into /system/sd
i also enabled compcache. let me know if that is not advised.
with a 64mb swap
#compcache related parameters
compcache{
compcache_en=1 # enable(1) or disable(0) compcache
cc_disksize=70 # Ram swap disksize - any number between 1 to 95 should work
cc_memlimit=18 # Limite the memory usage when backing swap is used
cc_backingswap_en=0 # enable or disable backing swap
cc_backingswap=/dev/block/mmcblk0p2 # pointing to the backingswap partition device
cc_swappiness=60 # default 60
}
#Linux swap parameters
#
# linux swap can only be enabled if cc_backingswap_en is set to "0"
#
linux_swap{
linux_swap_en=1 # enable(1) or disable(0) linux swap
linux_swap_partition=/dev/block/mmcblk0p2 # swap partition device
swappiness=60 # default 60
}
i have an issue with a boot loop at th eandroid screen now
ok, so, if i dont boot with the sd card inserted, it boots, but then i get to the home screen and it says none of my apps are installed.
so i go to recovery, remove the user.conf file. and same thing
so i restore, and boot with the sd card in. same thing, bootloop.
and now im restoring, but not booting with sd card.
what happened? was i not supposed to enable compcache? or keep the cc_disksize at 32?
so, ive been following this thread
http://forum.xda-developers.com/showthread.php?p=4379172
with this a2sd, it doesnt boot:
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# [email protected] (cyanogen)
#
echo "--- Welcome to Android/CyanogenMod!";
sysctl -p
# execute any postinstall script then kill it
if [ -e /data/firstboot.sh ];
then
echo "--- Executing firstboot.sh";
/system/bin/sh /data/firstboot.sh;
rm -f /data/firstboot.sh;
fi;
if [ -e /dev/block/mmcblk0p2 ];
then
echo "--- Checking ext filesystems";
# fsck the sdcard filesystem first
e2fsck -y /dev/block/mmcblk0p4;
# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $?;
# mount and set perms
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p4 /system/sd;
busybox chown 1000:1000 /system/sd;
busybox chmod 771 /system/sd;
# clean up any old symlinks, create data directories
for i in dalvik-cache data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
# don't allow /data/data on sd because of upgrade issues - move it if possible
if [ -d /system/sd/data ];
then
busybox cp -a /system/sd/data/* /data/data/;
busybox rm -rf /system/sd/data;
fi;
# move apps and dalvik cache from internal memory to sdcard
for i in app app-private dalvik-cache;
do
if [ ! -d /system/sd/$i ];
then
mkdir /system/sd/$i;
fi
busybox chown 1000:1000 /system/sd/$i;
busybox chmod 771 /system/sd/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox cp -a /data/$i/* /system/sd/$i/;
busybox rm -f /data/$i/*;
fi;
done;
# symlink app dirs - they must be on the same filesystem
for i in app app-private;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
busybox ln -s /system/sd/$i /data/$i;
fi;
done;
# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /system/sd/dalvik-cache /data/dalvik-cache;
busybox chown 1000:1000 /data/dalvik-cache;
busybox chmod 771 /data/dalvik-cache;
# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /system/sd/$i ]; then rm -f /system/sd/$i; fi
done;
# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
busybox rm -f /system/sd/app/*.odex
# call a userinit.sh script if it's present on the sdcard
# otherwise just enable compcache with no backing swap
if [ -e /system/sd/userinit.sh ];
then
echo "--- Executing userinit.sh"
busybox chmod +x /system/sd/userinit.sh
/system/bin/sh /system/sd/userinit.sh;
else
modprobe ramzswap;
/system/bin/rzscontrol /dev/block/ramzswap0 --init
swapon /dev/block/ramzswap0
fi
setprop cm.a2sd.active 1;
echo "+++ Apps-to-SD successfully enabled";
else
# replace symlinks with directories so we can boot without sd
for i in app app-private;
do
if [ -h /data/$i ];
then
rm -f /data/$i;
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
modprobe ramzswap;
/system/bin/rzscontrol /dev/block/ramzswap0 --init
swapon /dev/block/ramzswap0
setprop cm.a2sd.active 0;
fi;
sync;
setprop cm.filesystem.ready 1;
with this a2sd, no swap shows up when i go adb shell free:
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# [email protected] (cyanogen)
#
echo "--- Welcome to Android/CyanogenMod!";
sysctl -p
# execute any postinstall script then kill it
if [ -e /data/firstboot.sh ];
then
echo "--- Executing firstboot.sh";
/system/bin/sh /data/firstboot.sh;
rm -f /data/firstboot.sh;
fi;
if [ -e /dev/block/mmcblk0p2 ];
then
echo "--- Checking ext filesystems";
# fsck the sdcard filesystem first
e2fsck -y /dev/block/mmcblk0p2;
# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $?;
# mount and set perms
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sd;
busybox chown 1000:1000 /system/sd;
busybox chmod 771 /system/sd;
fi;
sync;
setprop cm.filesystem.ready 1;
and with the default a2sd, no boot.
and this is my user.conf
Code:
# General parameters
general{
apps2sd=0 # this is useless here, require a modified a2sd script
media2sd=0 # moves the medias to sd if /system/sd/media exists
}
#compcache related parameters
compcache{
compcache_en=1 # enable(1) or disable(0) compcache
cc_disksize=70 # Ram swap disksize - any number between 1 to 95 should work
cc_memlimit=18 # Limit the memory usage for backing swap (cc .5x known issue-defaults to 15% of total RAM)
cc_backingswap_en=0 # enable(1) or disable(0) backing swap
cc_backingswap=/dev/block/mmcblk0p2 # pointing to the backingswap partition device
cc_swappiness=60 # default 60
}
#Linux swap parameters
#
# linux swap can only be enabled if cc_backingswap_en is set to "0"
#
linux_swap{
linux_swap_en=1 # enable(1) or disable(0) linux swap
linux_swap_partition=/dev/block/mmcblk0p2 # swap partition device
swappiness=60 # default 60
}
partition 1 is my fat32 which is whatever 8 gigs minus 64
partition 2 is 64 megs of linux_swap
WOW,
You have completely over complicated this. remove the user.conf file from every location you put it in, remove all partitions and leave it with none, boot in recovery and wipe, then reflash cyan 4.0.4. reboot. everything should be normal with no swap and it should ask you if you want to format the sd card. when you get it working normal post back here.
my whole point is not to wipe, and i dont want a2sd.
wiping and doing what you said above will enable a2sd.
what part of my previous post would enable apps2sd?
if you don't want to wipe, then at least do everything else i posted
ok, i removed all the user.conf and repartitioned my sdcard
now what?
reflash cyan 4.0.4 and boot so it will format the card
what is the make, size, and class of your sdcard?
why no apps2sd?

Can anyone dump the init.rc?

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!

[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

Xiaomi Mi A2, auto reboot on usb power on

Hello people,
I need a xiaomi phone to boot when usb power is turned on.
Stock boot image
Android 9 PKQ1.180904.001.V10.0.8.0.PDIMIXM
What I tried so far:
#1 Battery animation file
I found some solutions for samsung smartphones modifing charger animation files.
system/bin/lpd
system/bin/lpod
--> Did not find such file. My /System/bin/ contains:
Code:
acpi dd input mknod rmdir tc-wrapper-1.0
am debuggerd insmod mkswap rmmod tee
app_process dex2oat ionice mktemp run-as telecom
app_process32 dexdiag iorenice modinfo runcon time
app_process64 dexdump ip modprobe schedtest timeout
applypatch dexlist ip-wrapper-1.0 monkey screencap tinycap
appops df ip6tables more screenrecord tinymix
appwidget diff ip6tables-restore mount secdiscard tinypcminfo
atrace dirname ip6tables-save mountpoint secilc tinyplay
awk dmesg ip6tables-wrapper-1.0 move_time_data.sh sed toolbox
base64 dos2unix iptables mv sendevent top
basename dpm iptables-restore ndc sensors_test touch
bcc du iptables-save ndc-wrapper-1.0 sensorservice toybox
blockdev dumpsys iptables-wrapper-1.0 netstat seq tr
bmgr echo iw newfs_msdos service true
bu egrep keystore_cli_v2 nice setenforce truncate
bugreport env kill nl setprop tty
bugreportz expand killall nohup setsid tzdatacheck
bunzip2 expr ld.mc oatdump settings uiautomator
bzcat fallocate linker od sh ulimit
bzip2 false linker64 paste sha1sum umount
cal fgrep linker_asan patch sha224sum uname
cat file linker_asan64 patchoat sha256sum uniq
chcon find ln perfetto sha384sum unix2dos
chgrp flock load_policy pgrep sha512sum update_engine_client
chmod fmt locksettings pidof simg2img uptime
chown free log ping sleep usleep
chroot getenforce logcat ping6 sm uudecode
chrt getevent logname pkill sort uuencode
cksum getprop logwrapper pm split vmstat
clear grep losetup pmap start vr
cmd groups ls ppd stat wc
cmp gunzip lshal printenv stop which
comm gzip lsmod printf strings whoami
content head lsof ps stty wigig_logcollector
cp hid lspci pvclicense_sample svc wigig_remoteserver
cpio host_manager_11ad lsusb pwd swapoff wigig_wiburn
crash_dump32 hostname md5sum readlink swapon wm
crash_dump64 hw media realpath sync xargs
curl hwclock microcom reboot sysctl xxd
cut id mkdir renice tac yes
dalvikvm ifconfig mkfifo requestsync tail zcat
dalvikvm32 ime mkfs.ext2 resize2fs tar
dalvikvm64 incident mkfs.ext3 restorecon taskset
date inotifyd mkfs.ext4 rm tc
#2 Ram Disk modification
I pulled the /System/bin/reboot file using adb shell and extracted the boot.img using android kitchen 3.5 from the forum.
Verified that everything works by unpacking/repacking/flasing boot image.
https://forum.xda-developers.com/showthread.php?t=2073775
- replaced the /ramdisk/sbin/charger file with the reboot file
--> battery animation is still there but nothing happens
- modified the charger file according to this discussion: https://forum.xda-developers.com/ga...-os-auto-boot-charge-connected-t3626364/page2
--> battery animation gone but stuck at google logo
- modified /ramdisk/init.rc and added:
on charger
trigger late-init
--> battery animation gone but stuck at google logo
- deleted /sbin/charger and charger service in init.rc and flashed image to both boot slots
--> changes nothing, battery animation will still show up.
- searched for battery/animation files / images in the ramdisk, but there seems to be nothing.
What else could I try?
Why isnt it working as expected?
Would flashing LineageOS or getting root access change anything?
UPDATE
--> here you can find a solution
[Q] Power on when plugged in (boot when docked)?
Many Greetings & Thanks alot,
himi

How To Guide How to trigger an action when a property is changed

How to trigger an action when a property is changed
In Android it's possible to trigger various actions by changing the value of a property.
This feature is quite handy and the implementation using Magisk is not really difficult.
As an example:
In the original Android from ASUS for the Zenfone 8 you can disable and enable the swap on a ZRAM device by changing the value for the property vendor.zram.enable:
e.g.:
To turn the swap on use
Code:
setprop vendor.zram.enable 1
and to turn the swap off use
Code:
setprop vendor.zram.enable 0
To get the current value use
Code:
getprop vendor.zram.enable
or
check the output of the OS command free.
(see How to disable or change the swap device in the Android 12 from ASUS for the Zenfone 8 for details)
This feature is not implemented in the OmniROM for the ASUS Zenfone 8 but quite useful so let's see how to implement it in the OmniROM.
The Triggers and Action for this Android feature are configured in the init.rc files in the root filesystem for the OS (see https://android.googlesource.com/platform/system/core/+/master/init/README.md for details). The root filesystem for Android is read-only mounted so without creating your own Android OS image for the phone it's not possible to add the functionality to the OS.
But we can use the Root Directory Overlay System from Magisk (see https://github.com/topjohnwu/Magisk/blob/master/docs/guides.md for the documentation) to implement it.
The detailed process for creating additional *.rc files for Android via Magisk is described here:
How to run a script at shutdown
Therefore I will not go into the details here. But please read that post before you continue
First we check how this feature is implemented in the Original Android for the Zenfone:
Enabling and disabling the swap device on ZRAM is configured in the .rc file
/vendor/etc/hw/init.asus.debugtool.rc
using these settings in the original Android OS for the Zenfone 8:
Code:
service asus_zram /system/vendor/bin/sh /vendor/bin/init.asus.zram.sh
user root
group root
disabled
seclabel u:r:vendor_qti_init_shell:s0
oneshot
on property:persist.vendor.zram.enable=1
setprop vendor.zram.enable "1"
setprop vendor.zram.disksize ${persist.vendor.zram.disksize}
on property:persist.vendor.zram.enable=0
setprop vendor.zram.enable "0"
setprop vendor.zram.disksize ${persist.vendor.zram.disksize}
on property:vendor.zram.enable=*
start asus_zram
The script used to enable or disable the swap device on ZRAM in the original Android for the Zenfone 8 is:
/vendor/bin/init.asus.zram.sh
The script is quite simple (see also below):
It uses two properties to configure the swap device:
vendor.zram.enable : if this property is set to 1 the script enables the swap device and if the property is set to 0 it disables the swap device
vendor.zram.disksize : the value of this property is the size of the ramdisk.
Now we can implement this feature for the OmniROM:
Note:
All commands must be done as user root in a shell on the phone or in an adb shell
First we check the prerequisites for the feature:
The used shell for the service exists in the OmniROM:
Code:
[email protected]_I006D:/data/adb/workdir # ls -Zl /vendor/bin/sh
-rwxr-xr-x 1 root shell u:object_r:vendor_shell_exec:s0 318216 2009-01-01 01:00 /vendor/bin/sh
[email protected]_I006D:/data/adb/workdir #
The script to toggle the ramdisk on the swap device also already exists in the OmniROM:
Code:
[email protected]_I006D:/data/adb/test # ls -l /vendor/bin/init.asus.zram.sh
-rwxr-xr-x 1 root shell 1127 2009-01-01 01:00 /vendor/bin/init.asus.zram.sh
[email protected]_I006D:/data/adb/test #
And the necessary SELinux contexts are also already defined in the OmniROM.
So, let's start:
Code:
# create a temporary directory
#
mkdir /data/adb/workdir
cd /data/adb/workdir
# create the additional .rc file
#
cat >init.asus.zram.rc <<-\EOT
#
# Note:
#
# The service definition for an OS without the script init.asus.zram.sh should be
#
# service asus_zram /system/bin/sh /system/sbin/init.asus.zram.sh
#
service asus_zram /system/vendor/bin/sh /vendor/bin/init.asus.zram.sh
user root
group root
disabled
seclabel u:r:vendor_qti_init_shell:s0
oneshot
#
# these properties can be used to define the initial state of the ramdisk on ZRAM
#
on property:persist.vendor.zram.enable=1
setprop vendor.zram.enable "1"
setprop vendor.zram.disksize ${persist.vendor.zram.disksize}
on property:persist.vendor.zram.enable=0
setprop vendor.zram.enable "0"
setprop vendor.zram.disksize ${persist.vendor.zram.disksize}
on property:vendor.zram.enable=*
start asus_zram
# The property persist.vendor.zram.enable is not defined in the OmniROM. If necessary you can add another triger in the .rc file,
# e.g to enable the swap device by default use
#
on early-init
setprop persist.vendor.zram.enable 1
EOT
# get the current active slot
#
CURRENT_SLOT=$( getprop ro.boot.slot_suffix )
echo "The current active slot is: ${CURRENT_SLOT}"
# copy the boot partition from the active slot to a file
dd if=/dev/block/by-name/boot${CURRENT_SLOT} of=./boot_root.img
# unpack the image file
/data/adb/magisk/magiskboot unpack ./boot_root.img
# add the new dir and file to the ramdisk from the boot partition
/data/adb/magisk/magiskboot cpio ramdisk.cpio \
"mkdir 0700 overlay.d" \
"add 0700 overlay.d/init.custom.rc init.asus.zram.rc"
# recreate the image file for the boot partition
/data/adb/magisk/magiskboot repack boot_root.img
# write the corrected image file to the boot partition
dd if=./new-boot.img of=/dev/block/by-name/boot${CURRENT_SLOT}
That's it.
After the next reboot switching the ramdisk on the ZRAM device via an property should be active:
Code:
[email protected]_I006D:/ # reboot
# .....
# start a new adb session
# ....
[email protected]_I006D:/ $ getprop ro.omni.version
12-20220703-zenfone8-MICROG
#
# Note: The property is only visible to the user root
#
[email protected]_I006D:/ $ su -
[email protected]_I006D:/ # id
uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0
[email protected]_I006D:/ #
[email protected]_I006D:/ # free
total used free shared buffers
Mem: 7612493824 4835229696 2777264128 14585856 14487552
-/+ buffers/cache: 4820742144 2791751680
Swap: 4294963200 0 4294963200
[email protected]_I006D:/ #
[email protected]_I006D:/ # getprop vendor.zram.enable
1
[email protected]_I006D:/ #
# -> now disable the swap on ZRAM
[email protected]_I006D:/ # setprop vendor.zram.enable 0
[email protected]_I006D:/ #
[email protected]_I006D:/ # getprop vendor.zram.enable
0
[email protected]_I006D:/ #
[email protected]_I006D:/ # free
total used free shared buffers
Mem: 7612493824 4840824832 2771668992 14524416 14483456
-/+ buffers/cache: 4826341376 2786152448
Swap: 0 0 0
[email protected]_I006D:/ #
# -> now enable the swap on ZRAM again
[email protected]_I006D:/ # setprop vendor.zram.enable 1
[email protected]_I006D:/ #
[email protected]_I006D:/ # getprop vendor.zram.enable
1
[email protected]_I006D:/ #
[email protected]_I006D:/ # free
total used free shared buffers
Mem: 7612493824 4844777472 2767716352 14524416 14512128
-/+ buffers/cache: 4830265344 2782228480
Swap: 4294963200 0 4294963200
[email protected]_I006D:/ #
Workarounds for other configuration
Find below some workarounds for OS versions without the prerequisites for implementing this feature.
1. The script to toggle the swap /vendor/bin/init.asus.zram.sh does not exist
If the script /vendor/bin/init.asus.zram.sh does not exist in your OS create a Magisk Module for the script
To create a (dummy) Magisk Module for the script do:
Code:
mkdir -p /data/adb/modules/toggle_ram/system/bin
#
# create the script to toggle the ramdisk on ZRAM
#
cat >/data/adb/modules/toggle_ram/system/bin/init.asus.zram.sh <<-\EOT
lahaina_set=`getprop vendor.asus.zram_setting`
if test "$lahaina_set" != "1"; then
echo "[asus_zram] init.kernel.post_boot-lahaina.sh not finished yet!"> /dev/kmsg
exit 0
fi
disksize=`getprop vendor.zram.disksize`
zram_enable=`getprop vendor.zram.enable`
MemTotalStr=`cat /proc/meminfo | grep MemTotal`
MemTotal=${MemTotalStr:16:8}
let RamSizeGB="( $MemTotal / 1048576 ) + 1"
if test "$disksize" = ""; then
disksize="4096M"
fi
echo "[asus_zram]RamSizeGB=${RamSizeGB}" > /dev/kmsg
if test "$zram_enable" = "1"; then
if [ $RamSizeGB -le 7 ]; then #this is for 6G; or the value will be 4G(8G,12G,16G,18G,etc)
disksize="( $RamSizeGB * 1024 ) / 2""M"
fi
swapoff /dev/block/zram0 2>/dev/kmsg
echo 1 > sys/block/zram0/reset 2>/dev/kmsg
sleep 1
echo lz4 > /sys/block/zram0/comp_algorithm
echo $disksize > /sys/block/zram0/disksize 2>/dev/kmsg
mkswap /dev/block/zram0 2>/dev/kmsg
swapon /dev/block/zram0 -p 32758 2>/dev/kmsg
echo "[asus_zram]write zram disksize=${disksize}" > /dev/kmsg
fi
if test "$zram_enable" = "0"; then
swapoff /dev/block/zram0 2>/dev/kmsg
echo "[asus_zram]turn off the zram" > /dev/kmsg
fi
EOT
chmod 755 /data/adb/modules/toggle_ram/system/bin/init.asus.zram.sh
chown root:shell /data/adb/modules/toggle_ram/system/bin/init.asus.zram.sh
chcon u:object_r:vendor_file:s0 /data/adb/modules/toggle_ram/system/bin/init.asus.zram.sh
Check the result:
Code:
[email protected]_I006D:/ # ls -lZ /data/adb/modules/toggle_ram/system/bin/init.asus.zram.sh
-rwxr-xr-x 1 root shell u:object_r:vendor_file:s0 1109 2022-10-03 21:14 /data/adb/modules/toggle_ram/system/bin/init.asus.zram.sh
[email protected]_I006D:/ #
Then change the script to execute in the service definition in the .rc file to /system/bin/init.asus.zram.sh:
Code:
service asus_zram /system/vendor/bin/sh /system/bin/init.asus.zram.sh
The rest of the instructions can be be used without changes.
2. The binary /system/vendor/bin/sh does not exist
If the shell /system/vendor/bin/sh does not exist in the OS create an Magisk Module with an approbiate shell:
Note:
The shell /system/bin/sh can not be used because it's configured with another SELinux context:
Code:
[email protected]_I006D:/ # ls -lZ /system/vendor/bin/sh
-rwxr-xr-x 1 root shell u:object_r:vendor_shell_exec:s0 318216 2009-01-01 01:00 /system/vendor/bin/sh
[email protected]_I006D:/ #
# but
[email protected]_I006D:/data/adb/workdir # ls -Zl /system/bin/sh
-rwxr-xr-x 1 root shell u:object_r:shell_exec:s0 307768 2009-01-01 01:00 /system/bin/sh
[email protected]_I006D:/data/adb/workdir #
To create a (dummy) Magisk Module for the necessary shell do:
Code:
mkdir -p /data/adb/modules/vendorshell/system/bin
cp /system/bin/sh /data/adb/modules/vendorshell/system/bin/sh
chcon u:object_r:vendor_shell_exec:s0 /data/adb/modules/vendorshell/system/bin/vendor_sh
Check the result:
Code:
[email protected]_I006D:/data/adb/workdir # ls -lZ /data/adb/modules/vendorshell/system/bin/vendor_sh
-rwxr-xr-x 1 root root u:object_r:vendor_shell_exec:s0 307768 2022-10-03 20:41 /data/adb/modules/vendorshell/system/bin/vendor_sh
[email protected]_I006D:/data/adb/workdir #
Now change the shell in the service definition in the .rc file to /system/bin/vendor_sh:
Code:
service asus_zram /system/bin/vendor_sh /vendor/bin/init.asus.zram.sh
The rest of the instructions can be be used without changes.
3. The necessary shell /system/vendor/bin/sh and the script /vendor/bin/init.asus.zram.sh do both not exist
If the necessary shell /system/vendor/bin/sh and the script /vendor/bin/init.asus.zram.sh do not exist you can also create one (dummy) Magisk module for both.
See
https://topjohnwu.github.io/Magisk/guides.html
and
Some hints for using Magisk on Android phones
for instructions and infos about how to create a real Magisk Module
4. Missing SELinux contexts
These instructions assume that all necessary SELinux contexts are already defined in the used OS.
If there are SELinux contexts missing it might not work without adding the missing SELinux contexts
(that might be difficult and I must admit that I did not test that)
5. only for the records:
The magiskboot command can also be used to add new files to the /sbin directory in the root filesystem.
This can be can be configured like this:
Code:
/data/adb/magisk/magiskboot cpio ramdisk.cpio \
"mkdir 0700 overlay.d" \
"add 0700 overlay.d/init.custom.rc init.asus.zram.rc" \
"mkdir 0700 overlay.d/sbin" \
"add 0700 overlay.d/sbin/my_new_script.sh my_script.sh"
This is useful for adding binaries or scripts for actions that should be executed while the other partitions are not yet mounted and therefor the files in these filesystems not yet available. But for the action defined in this post this is not necessary.
And be aware that the files added to the root filesystem ( /sbin/my_new_script.sh in this example) is only available while booting the phone.
6. Other problems
In case of problems please check the post
How to run a script at shutdown
again.
Also check the restrictions for this approach documented in that post
History
06.10.2022 /bs
corrected some typos

Categories

Resources