Permalink
Browse files

mogami: Refactor to common init

  • Loading branch information...
1 parent fafe061 commit c58708dc129aee9c508fa79968af4c6a5112b8a9 @mechmetal committed Sep 22, 2013
Showing with 89 additions and 225 deletions.
  1. +1 −1 mogami.mk
  2. +88 −0 rootdir/init.board.rc
  3. +0 −224 rootdir/init.semc.rc
View
@@ -24,7 +24,7 @@ PRODUCT_COPY_FILES += \
# Init file
PRODUCT_COPY_FILES += \
- $(COMMON_PATH)/rootdir/init.semc.rc:root/init.semc.rc
+ $(COMMON_PATH)/rootdir/init.board.rc:root/init.board.rc
# WiFi config & related files
PRODUCT_COPY_FILES += \
View
@@ -0,0 +1,88 @@
+import init.device.rc
+
+on boot
+ # Bluetooth power up/down interface
+ mkdir /data/misc/bluetooth 0770 bluetooth bluetooth
+ chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
+ chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
+ chmod 0660 /sys/class/rfkill/rfkill0/state
+ chown system system /sys/module/sco/parameters/disable_esco
+
+ # Owner for the proximity sensor
+ chown system system /sys/devices/i2c-0/0-0054/threshold
+ chown system system /sys/devices/i2c-0/0-0054/nburst
+ chmod 0666 /sys/devices/i2c-0/0-0054/nburst
+
+ # Load wl1271 modules
+ exec /modules/wifiload
+
+on post-fs-data
+ mkdir /data/misc/wifi 0770 wifi wifi
+ mkdir /data/misc/wifi/sockets 0770 wifi wifi
+ mkdir /data/misc/wifi/hostapd 0770 wifi wifi
+ mkdir /data/misc/dhcp 0770 dhcp dhcp
+ chown dhcp dhcp /data/misc/dhcp
+ chown wifi wifi /system/etc/firmware/ti-connectivity
+ chown wifi wifi /system/etc/wifi/wpa_supplicant.conf
+ chown wifi wifi /data/misc/wifi/wpa_supplicant.conf
+ chown wifi wifi /data/misc/wifi/p2p_supplicant.conf
+ chown wifi wifi /data/misc/wifi/p2p_supplicant_manual.conf
+
+ setprop vold.post_fs_data_done 1
+
+service hciattach /system/bin/hciattach -n /dev/ttyHS0 texas 3000000
+ class main
+ user bluetooth
+ group qcom_oncrpc bluetooth net_bt_admin
+ disabled
+ oneshot
+
+service wpa_supplicant /system/bin/wpa_supplicant -Dnl80211 -iwlan0 \
+ -puse_p2p_group_interface=1 -c/data/misc/wifi/wpa_supplicant.conf \
+ -e/data/misc/wifi/entropy.bin
+ class main
+ socket wpa_wlan0 dgram 660 wifi wifi
+ disabled
+ oneshot
+
+service hostapd_bin /system/bin/hostapd -d /data/misc/wifi/hostapd.conf
+ class main
+ socket wpa_wlan0 dgram 660 wifi wifi
+ disabled
+ oneshot
+
+service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
+ class main
+ disabled
+ oneshot
+
+service dhcpcd_p2p /system/bin/dhcpcd -aABKL
+ class main
+ disabled
+ oneshot
+
+service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL
+ class main
+ disabled
+ oneshot
+
+service iprenew_wlan0 /system/bin/dhcpcd -n
+ class main
+ disabled
+ oneshot
+
+service iprenew_p2p /system/bin/dhcpcd -n
+ class main
+ disabled
+ oneshot
+
+service iprenew_bnep0 /system/bin/dhcpcd -n
+ class main
+ disabled
+ oneshot
+
+on property:dhcp.wlan0.result=ok
+ exec /system/bin/iw phy phy0 wowlan enable any
+
+on property:init.svc.hostapd_bin=stopped
+ exec /system/bin/iw dev mon.wlan0 del
View
@@ -1,224 +0,0 @@
-import init.device.rc
-import init.semc.usb.rc
-
-on early-init
- mount debugfs debugfs /sys/kernel/debug
- chmod 666 /proc/cmdline
-
-on init
- export EXTERNAL_STORAGE /storage/sdcard0
-
- mkdir /storage 0050 system sdcard_r
- mkdir /storage/sdcard0 0000 system system
- mkdir /storage/usbdisk0 0000 system system
-
- # for backwards compatibility
- symlink /storage/sdcard0 /sdcard
- symlink /storage/sdcard0 /mnt/sdcard
- symlink /storage/usbdisk0 /usbdisk
- symlink /storage/usbdisk0 /mnt/usbdisk
-
-on early-boot
- # Offline charging
- exec /system/bin/chargemon
-
- # set RLIMIT_MEMLOCK to 64MB
- setrlimit 8 67108864 67108864
-
-on boot
- # Disable idle power collapse during boot.
- # These features will be enabled at the end of boot
- write /sys/module/pm2/parameters/idle_sleep_mode 3
-
- # Radio fix
- mkdir /data/radio 0775 radio radio
- mkdir /data/radio/log 0775 radio radio
-
- # Bluetooth power up/down interface
- mkdir /data/misc/bluetooth 0770 bluetooth bluetooth
- chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
- chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
- chmod 0660 /sys/class/rfkill/rfkill0/state
- chown system system /sys/module/sco/parameters/disable_esco
- # To prevent out of order acknowledgements from making
- # connection tracking to treat them as not belonging to
- # the connection they belong to.
- # Otherwise, a weird issue happens in which some long
- # connections on high-throughput links get dropped when
- # an ack packet comes out of order
- write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 1
-
- chown root system /proc/net/ip_conntrack
-
- # Panel backlight
- chown system system /sys/class/leds/lcd-backlight/brightness
- chmod 660 /sys/class/leds/lcd-backlight/brightness
-
- # LED
- chown system system /sys/class/leds/red/brightness
- chmod 660 /sys/class/leds/red/brightness
- chown system system /sys/class/leds/red/use_pattern
- chmod 660 /sys/class/leds/red/use_pattern
- chown system system /sys/class/leds/green/brightness
- chmod 660 /sys/class/leds/green/brightness
- chown system system /sys/class/leds/green/use_pattern
- chmod 660 /sys/class/leds/green/use_pattern
- chown system system /sys/class/leds/blue/brightness
- chmod 660 /sys/class/leds/blue/brightness
- chown system system /sys/class/leds/blue/use_pattern
- chmod 660 /sys/class/leds/blue/use_pattern
- chown system system /sys/devices/i2c-0/0-0040/pattern_data
- chmod 660 /sys/devices/i2c-0/0-0040/pattern_data
- chown system system /sys/devices/i2c-0/0-0040/pattern_delay
- chmod 660 /sys/devices/i2c-0/0-0040/pattern_delay
- chown system system /sys/devices/i2c-0/0-0040/pattern_duration_secs
- chmod 660 /sys/devices/i2c-0/0-0040/pattern_duration_secs
- chown system system /sys/devices/i2c-0/0-0040/pattern_use_softdim
- chmod 660 /sys/devices/i2c-0/0-0040/pattern_use_softdim
- chown system system /sys/devices/i2c-0/0-0040/dim_time
- chmod 660 /sys/devices/i2c-0/0-0040/dim_time
-
- # Vibrator intensity tuning
- chown system system /sys/class/timed_output/vibrator/voltage_level
-
- # Owner for the proximity sensor
- chown system system /sys/devices/i2c-0/0-0054/threshold
- chown system system /sys/devices/i2c-0/0-0054/nburst
- chmod 0666 /sys/devices/i2c-0/0-0054/nburst
-
- # Fix permissions for bma150 (accelerometer). Can be at different adresses.
- chown system system /sys/devices/i2c-0/0-0038/rate
- chown system system /sys/devices/i2c-4/4-0038/rate
-
- class_start default
-
- # Load wl1271 modules
- exec /modules/wifiload
-
- # USB host support
- mkdir /dev/bus 0771 system system
- mkdir /dev/bus/usb 0771 system system
-
- chmod 0660 /sys/devices/platform/msm_hsusb/gadget/lun1/file
- chown usb usb /sys/devices/platform/msm_hsusb/gadget/lun1/file
- chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state
- chown system system /sys/devices/platform/msm_hsusb/gadget/wakeup
-
- # power-management
- write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 122880
- write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1401600
-
- # Don't disable dmesg access for apps
- write /proc/sys/kernel/dmesg_restrict 0
-
- # Flash storage isn't a good entropy source, and only causes locking
- # overhead in the kernel. Turn it off.
- write /sys/block/mmcblk0/queue/add_random 0
-
-on fs
- mount_all /fstab.semc
-
-on post-fs-data
- mkdir /data/misc/wifi 0770 wifi wifi
- mkdir /data/misc/wifi/sockets 0770 wifi wifi
- mkdir /data/misc/wifi/hostapd 0770 wifi wifi
- mkdir /data/misc/dhcp 0770 dhcp dhcp
- chown dhcp dhcp /data/misc/dhcp
- chown wifi wifi /system/etc/firmware/ti-connectivity
- chown wifi wifi /system/etc/wifi/wpa_supplicant.conf
- chown wifi wifi /data/misc/wifi/wpa_supplicant.conf
- chown wifi wifi /data/misc/wifi/p2p_supplicant.conf
- chown wifi wifi /data/misc/wifi/p2p_supplicant_manual.conf
-
- setprop vold.post_fs_data_done 1
-
-on property:init.svc.bluetoothd=running
- write /sys/devices/virtual/bluetooth/hci0/link_supervision_timeout 6400
-
-service hciattach /system/bin/hciattach -n /dev/ttyHS0 texas 3000000
- class main
- user bluetooth
- group qcom_oncrpc bluetooth net_bt_admin
- disabled
- oneshot
-
-service wpa_supplicant /system/bin/wpa_supplicant -Dnl80211 -iwlan0 \
- -puse_p2p_group_interface=1 -c/data/misc/wifi/wpa_supplicant.conf \
- -e/data/misc/wifi/entropy.bin
- class main
- socket wpa_wlan0 dgram 660 wifi wifi
- disabled
- oneshot
-
-service hostapd_bin /system/bin/hostapd -d /data/misc/wifi/hostapd.conf
- class main
- socket wpa_wlan0 dgram 660 wifi wifi
- disabled
- oneshot
-
-service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
- class main
- disabled
- oneshot
-
-service dhcpcd_p2p /system/bin/dhcpcd -aABKL
- class main
- disabled
- oneshot
-
-service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL
- class main
- disabled
- oneshot
-
-service iprenew_wlan0 /system/bin/dhcpcd -n
- class main
- disabled
- oneshot
-
-service iprenew_p2p /system/bin/dhcpcd -n
- class main
- disabled
- oneshot
-
-service iprenew_bnep0 /system/bin/dhcpcd -n
- class main
- disabled
- oneshot
-
-on property:init.svc.wpa_supplicant=stopped
- stop dhcpcd
-
-service port-bridge /system/bin/port-bridge /dev/smd0 /dev/ttyGS0 &
- class main
- disabled
- oneshot
-
-service qmuxd /system/bin/qmuxd
- class core
- user radio
- group radio audio bluetooth gps
-
-service netmgrd /system/bin/netmgrd -E
- class core
-
-on property:ro.use_data_netmgrd=false
- # netmgr not supported on specific target
- stop netmgrd
-
-service akmd8975 /system/bin/akmd8975
- class main
-
-service hw_config /system/bin/sh /system/etc/hw_config.sh
- class main
- user root
- oneshot
-
-on property:dhcp.wlan0.result=ok
- exec /system/bin/iw phy phy0 wowlan enable any
-
-on property:init.svc.hostapd_bin=stopped
- exec /system/bin/iw dev mon.wlan0 del
-
-on property:sys.boot_completed=1
- write /sys/module/pm2/parameters/idle_sleep_mode 1

0 comments on commit c58708d

Please sign in to comment.