Advertisement
josimarkc

INIT SH audio ok

Feb 16th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.43 KB | None | 0 0
  1. #
  2. # Copyright (C) 2013-2015 The Android-x86 Open Source Project
  3. # Copyright (C) 2018 Woltrex AOSP Developer AndroTechTeam Co.
  4. # License: GNU Public License v2 or later
  5. #
  6.  
  7. function set_property()
  8. {
  9. setprop "$1" "$2"
  10. [ -n "$DEBUG" ] && echo "$1"="$2" >> /dev/x86.prop
  11. }
  12.  
  13. function set_prop_if_empty()
  14. {
  15. [ -z "$(getprop $1)" ] && set_property "$1" "$2"
  16. }
  17.  
  18.  
  19. function init_misc()
  20. {
  21. # device information
  22. setprop ro.product.manufacturer "$(cat $DMIPATH/sys_vendor)"
  23. setprop ro.product.model "$PRODUCT"
  24.  
  25. # a hack for USB modem
  26. lsusb | grep 1a8d:1000 && eject
  27.  
  28. # in case no cpu governor driver autoloads
  29. [ -d /sys/devices/system/cpu/cpu0/cpufreq ] || modprobe acpi-cpufreq
  30. }
  31.  
  32. function init_hal_audio()
  33. {
  34. case "$PRODUCT" in
  35. VirtualBox*|Bochs*)
  36. [ -d /proc/asound/card0 ] || modprobe snd-sb16 isapnp=0 irq=5
  37. ;;
  38. *)
  39. ;;
  40. esac
  41.  
  42. if grep -qi "IntelHDMI" /proc/asound/card0/id; then
  43. [ -d /proc/asound/card1 ] || set_property ro.hardware.audio.primary hdmi
  44. fi
  45. }
  46.  
  47. function init_hal_wifi()
  48. {
  49. # BCM WiFi driver conflict start.
  50. # Broadcom BCM4311 (PCI IDs 14e4:4311, 14e4:4312)
  51. # Broadcom BCM4312 (PCI ID 14e4:4315)
  52. # Broadcom BCM4313 (PCI ID 14e4:4727)
  53. # Broadcom BCM4321 (PCI IDs 14e4:4328, 14e4:4329, 14e4:432a)
  54. # Broadcom BCM4322 (PCI IDs 14e4:432b, 14e4:432c, 14e4:432d)
  55. # Broadcom BCM43224 (PCI IDs 14e4:0576, 14e4:4353)
  56. # Broadcom BCM43225 (PCI ID 14e4:4357)
  57. # Broadcom BCM43227 (PCI ID 14e4:4358)
  58. # Broadcom BCM43228 (PCI ID 14e4:4359)
  59. # Broadcom BCM43142 (PCI ID 14e4:4365)
  60. # Broadcom BCM4331 (PCI ID 14e4:4331)
  61. # Broadcom BCM4352 (PCI ID 14e4:43b1)
  62. # Broadcom BCM4360 (PCI IDs 14e4:43a0, 14e4:4360)
  63.  
  64. BCMAID=`lspci | grep "14e4" | awk '{print $4}'`
  65.  
  66. case "${BCMAID##*:}" in
  67. 4311 | 4312 | \
  68. 4315 | \
  69. 4727 | \
  70. 4328 | 4329 | 432a | \
  71. 432b | 432c | 432d | \
  72. 0576 | 4353 | \
  73. 4357 | 4358 | 4359 | \
  74. 4365 | \
  75. 4331 | \
  76. 43b1 | \
  77. 43a0 | 4360 )
  78.  
  79. rmmod b43
  80. rmmod b44
  81. rmmod b43legacy
  82. rmmod ssb
  83. rmmod bcma
  84. rmmod brcm80211
  85. rmmod wl
  86. modprobe brcmfmac
  87. modprobe brcmsmac
  88. netcfg wlan0 up
  89.  
  90. modprobe wl
  91. ;;
  92. *)
  93. ;;
  94. esac
  95. # BCM WiFi driver conflict end.
  96.  
  97. # BCM SDIO WiFi driver config file start.
  98. BCMSDIO=`dmesg | grep brcmfmac | grep txt`
  99. if [ "$BCMSDIO" != "" ]; then
  100. BCMNAME=`echo $BCMSDIO | awk '{print $9}'`
  101. mount -t efivarfs none /sys/firmware/efi/efivars
  102. cp /sys/firmware/efi/efivars/nvram-74b00bd9-805a-4d61-b51f-43268123d113 /lib/firmware/$BCMNAME
  103. set_property phoenixos.brcmfmac 1
  104. fi
  105. # BCM SDIO WiFi driver config file end.
  106. }
  107.  
  108. function init_hal_bluetooth()
  109. {
  110. for r in /sys/class/rfkill/*; do
  111. type=$(cat $r/type)
  112. [ "$type" = "wlan" -o "$type" = "bluetooth" ] && echo 1 > $r/state
  113. done
  114.  
  115. case "$PRODUCT" in
  116. T10*TA|HP*Omni*)
  117. BTUART_PORT=/dev/ttyS1
  118. set_property hal.bluetooth.uart.proto bcm
  119. ;;
  120. MacBookPro8*)
  121. rmmod b43
  122. modprobe b43 btcoex=0
  123. modprobe btusb
  124. ;;
  125. *)
  126. for bt in $(busybox lsusb -v | awk ' /Class:.E0/ { print $9 } '); do
  127. chown 1002.1002 $bt && chmod 660 $bt
  128. done
  129. ;;
  130. esac
  131.  
  132. if [ -n "$BTUART_PORT" ]; then
  133. set_property hal.bluetooth.uart $BTUART_PORT
  134. chown bluetooth.bluetooth $BTUART_PORT
  135. start btattach
  136. fi
  137.  
  138. # rtl8723bs bluetooth
  139. if dmesg -t | grep -qE '8723bs.*BT'; then
  140. TTYSTRING=`dmesg -t | grep -E 'tty.*MMIO' | awk '{print $2}' | head -1`
  141. if [ -n "$TTYSTRING" ]; then
  142. echo "RTL8723BS BT uses $TTYSTRING for Bluetooth."
  143. ln -sf $TTYSTRING /dev/rtk_h5
  144. start rtk_hciattach
  145. fi
  146. fi
  147. }
  148.  
  149. function init_hal_camera()
  150. {
  151. return
  152. }
  153.  
  154. function init_hal_gps()
  155. {
  156. # TODO
  157. return
  158. }
  159.  
  160. function set_drm_mode()
  161. {
  162. case "$PRODUCT" in
  163. ET1602*)
  164. drm_mode=1366x768
  165. ;;
  166. VMware*)
  167. [ -n "$video" ] && drm_mode=$video
  168. ;;
  169. *)
  170. ;;
  171. esac
  172.  
  173. [ -n "$drm_mode" ] && set_property debug.drm.mode.force $drm_mode
  174. }
  175.  
  176. function init_uvesafb()
  177. {
  178. case "$PRODUCT" in
  179. ET2002*)
  180. UVESA_MODE=${UVESA_MODE:-1600x900}
  181. ;;
  182. *)
  183. ;;
  184. esac
  185.  
  186. modprobe uvesafb mode_option=${UVESA_MODE:-1024x768}-32 ${UVESA_OPTION:-mtrr=3 scroll=redraw}
  187. }
  188.  
  189. function init_hal_gralloc()
  190. {
  191. case "$(cat /proc/fb | head -1)" in
  192. *virtiodrmfb)
  193. if [ "$HWACCEL" != "0" ]; then
  194. set_property ro.hardware.hwcomposer drm
  195. set_property ro.hardware.gralloc gbm
  196. fi
  197. set_prop_if_empty sleep.state none
  198. ;;
  199. 0*inteldrmfb|0*radeondrmfb|0*nouveaufb|0*svgadrmfb|0*amdgpudrmfb)
  200. if [ "$HWACCEL" != "0" ]; then
  201. set_property ro.hardware.gralloc drm
  202. set_drm_mode
  203. fi
  204. ;;
  205. "")
  206. init_uvesafb
  207. ;&
  208. 0*)
  209. ;;
  210. esac
  211.  
  212. [ -n "$DEBUG" ] && set_property debug.egl.trace error
  213. }
  214.  
  215. function init_hal_hwcomposer()
  216. {
  217. # TODO
  218. return
  219. }
  220.  
  221. function init_hal_lights()
  222. {
  223. chown 1000.1000 /sys/class/backlight/*/brightness
  224. }
  225.  
  226. function init_hal_power()
  227. {
  228. for p in /sys/class/rtc/*; do
  229. echo disabled > $p/device/power/wakeup
  230. done
  231.  
  232. # TODO
  233. case "$PRODUCT" in
  234. HP*Omni*|OEMB|Surface*3|T10*TA)
  235. set_prop_if_empty sleep.state none
  236. ;;
  237. *)
  238. ;;
  239. esac
  240. }
  241.  
  242. function init_hal_sensors()
  243. {
  244. # if we have sensor module for our hardware, use it
  245. ro_hardware=$(getprop ro.hardware)
  246. [ -f /system/lib/hw/sensors.${ro_hardware}.so ] && return 0
  247.  
  248. local hal_sensors=kbd
  249. local has_sensors=true
  250. case "$(cat $DMIPATH/uevent)" in
  251. *Lucid-MWE*)
  252. set_property ro.ignore_atkbd 1
  253. hal_sensors=hdaps
  254. ;;
  255. *ICONIA*W5*)
  256. hal_sensors=w500
  257. ;;
  258. *S10-3t*)
  259. hal_sensors=s103t
  260. ;;
  261. *Inagua*)
  262. #setkeycodes 0x62 29
  263. #setkeycodes 0x74 56
  264. set_property ro.ignore_atkbd 1
  265. set_property hal.sensors.kbd.type 2
  266. ;;
  267. *TEGA*|*2010:svnIntel:*)
  268. set_property ro.ignore_atkbd 1
  269. set_property hal.sensors.kbd.type 1
  270. io_switch 0x0 0x1
  271. setkeycodes 0x6d 125
  272. ;;
  273. *DLI*)
  274. set_property ro.ignore_atkbd 1
  275. set_property hal.sensors.kbd.type 1
  276. setkeycodes 0x64 1
  277. setkeycodes 0x65 172
  278. setkeycodes 0x66 120
  279. setkeycodes 0x67 116
  280. setkeycodes 0x68 114
  281. setkeycodes 0x69 115
  282. setkeycodes 0x6c 114
  283. setkeycodes 0x6d 115
  284. ;;
  285. *tx2*)
  286. setkeycodes 0xb1 138
  287. setkeycodes 0x8a 152
  288. set_property hal.sensors.kbd.type 6
  289. set_property poweroff.doubleclick 0
  290. set_property qemu.hw.mainkeys 1
  291. ;;
  292. *MS-N0E1*)
  293. set_property ro.ignore_atkbd 1
  294. set_property poweroff.doubleclick 0
  295. setkeycodes 0xa5 125
  296. setkeycodes 0xa7 1
  297. setkeycodes 0xe3 142
  298. ;;
  299. *Aspire1*25*)
  300. modprobe lis3lv02d_i2c
  301. echo -n "enabled" > /sys/class/thermal/thermal_zone0/mode
  302. ;;
  303. *ThinkPad*Tablet*)
  304. modprobe hdaps
  305. hal_sensors=hdaps
  306. ;;
  307. *i7Stylus*|*S10T*)
  308. set_property hal.sensors.iio.accel.matrix 1,0,0,0,-1,0,0,0,-1
  309. [ -z "$(getprop sleep.state)" ] && set_property sleep.state none
  310. ;;
  311. *ST70416-6*)
  312. set_property hal.sensors.iio.accel.matrix 0,-1,0,-1,0,0,0,0,-1
  313. ;;
  314. *ONDATablet*)
  315. set_property hal.sensors.iio.accel.matrix 0,1,0,1,0,0,0,0,-1
  316. ;;
  317. *)
  318. has_sensors=false
  319. ;;
  320. esac
  321.  
  322. # has iio sensor-hub?
  323. if [ -n "`ls /sys/bus/iio/devices/iio:device* 2> /dev/null`" ]; then
  324. busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device*/
  325. lsmod | grep -q hid_sensor_accel_3d && hal_sensors=hsb || hal_sensors=iio
  326. elif lsmod | grep -q lis3lv02d_i2c; then
  327. hal_sensors=hdaps
  328. fi
  329.  
  330. # TODO close Surface Pro 4 sensor until bugfix
  331. case "$(cat $DMIPATH/uevent)" in
  332. *SurfacePro4*)
  333. hal_sensors=kbd
  334. ;;
  335. *)
  336. ;;
  337. esac
  338.  
  339. set_property ro.hardware.sensors $hal_sensors
  340. [ "$hal_sensors" != "kbd" ] && has_sensors=true
  341. set_property config.override_forced_orient $has_sensors
  342. }
  343.  
  344. function create_pointercal()
  345. {
  346. if [ ! -e /data/misc/tscal/pointercal ]; then
  347. mkdir -p /data/misc/tscal
  348. touch /data/misc/tscal/pointercal
  349. chown 1000.1000 /data/misc/tscal /data/misc/tscal/*
  350. chmod 775 /data/misc/tscal
  351. chmod 664 /data/misc/tscal/pointercal
  352. fi
  353. }
  354.  
  355. function init_tscal()
  356. {
  357. case "$PRODUCT" in
  358. ST70416-6*)
  359. modprobe gslx680_ts_acpi
  360. ;&
  361. T91|T101|ET2002|74499FU|945GSE-ITE8712|CF-19[CDYFGKLP]*)
  362. create_pointercal
  363. return
  364. ;;
  365. *)
  366. ;;
  367. esac
  368.  
  369. for usbts in $(lsusb | awk '{ print $6 }'); do
  370. case "$usbts" in
  371. 0596:0001|0eef:0001)
  372. create_pointercal
  373. return
  374. ;;
  375. *)
  376. ;;
  377. esac
  378. done
  379. }
  380.  
  381. function init_ril()
  382. {
  383. case "$(cat $DMIPATH/uevent)" in
  384. *TEGA*|*2010:svnIntel:*|*Lucid-MWE*)
  385. set_property rild.libpath /system/lib/libhuaweigeneric-ril.so
  386. set_property rild.libargs "-d /dev/ttyUSB2 -v /dev/ttyUSB1"
  387. set_property ro.radio.noril no
  388. ;;
  389. *)
  390. set_property ro.radio.noril yes
  391. ;;
  392. esac
  393. }
  394.  
  395. function init_cpu_governor()
  396. {
  397. governor=$(getprop cpu.governor)
  398.  
  399. [ $governor ] && {
  400. for cpu in $(ls -d /sys/devices/system/cpu/cpu?); do
  401. echo $governor > $cpu/cpufreq/scaling_governor || return 1
  402. done
  403. }
  404. }
  405.  
  406. function phoenixos_compat()
  407. {
  408. PHOENIX_LOG=/data/system/phoenixos.log
  409. PHOENIX_LOG1=/data/system/phoenixos1.log
  410. PHOENIX_TEMP=/data/system/tmp
  411. PHOENIX_DISK=`cat /data/system/phoenixlog.addr`
  412. PHOENIX_COMPAT_BIN=/system/xbin/phoenix_compat
  413.  
  414. if [ -f /data/system/phoenixlog.dir ]; then
  415. PHOENIX_DIR=`cat /data/system/phoenixlog.dir`
  416. else
  417. PHOENIX_DIR=PhoenixOS-ROC
  418. fi
  419.  
  420. if [ $1 = "cmdline" ]; then
  421. sed -i '5s/^.*$/boot: cmdline/' $PHOENIX_LOG
  422. else
  423. if [ $1 = "android" ]; then
  424. sed -i '5s/^.*$/boot: android/' $PHOENIX_LOG
  425. else
  426. sed -i '5s/^.*$/boot: phoenixos/' $PHOENIX_LOG
  427. fi
  428.  
  429. $PHOENIX_COMPAT_BIN $1
  430. cp -f $PHOENIX_LOG1 $PHOENIX_LOG
  431. fi
  432.  
  433. mount $PHOENIX_DISK $PHOENIX_TEMP
  434. cp -f $PHOENIX_LOG $PHOENIX_TEMP/$PHOENIX_DIR
  435. umount $PHOENIX_TEMP
  436. }
  437.  
  438. function do_init()
  439. {
  440. phoenixos_compat cmdline
  441.  
  442. init_misc
  443. init_hal_audio
  444. init_hal_wifi
  445. init_hal_bluetooth
  446. init_hal_camera
  447. init_hal_gps
  448. init_hal_gralloc
  449. init_hal_hwcomposer
  450. init_hal_lights
  451. init_hal_power
  452. init_hal_sensors
  453. init_tscal
  454. init_ril
  455. post_init
  456. }
  457.  
  458. function do_netconsole()
  459. {
  460. modprobe netconsole netconsole="@/,@$(getprop dhcp.eth0.gateway)/"
  461. }
  462.  
  463. function do_bootanim()
  464. {
  465. phoenixos_compat android
  466.  
  467. [ -n "$(getprop phoenixos.brcmfmac)" ] && rmmod brcmfmac && modprobe brcmfmac
  468. }
  469.  
  470. function do_bootcomplete()
  471. {
  472. phoenixos_compat phoenixos
  473.  
  474. init_cpu_governor
  475.  
  476. [ -z "$(getprop persist.sys.root_access)" ] && setprop persist.sys.root_access 3
  477.  
  478. # FIXME: autosleep works better on i965?
  479. [ "$(getprop debug.mesa.driver)" = "i965" ] && setprop debug.autosleep 1
  480.  
  481. lsmod | grep -e brcmfmac && setprop wlan.no-unload-driver 1
  482.  
  483. case "$PRODUCT" in
  484. 1866???|1867???|1869???) # ThinkPad X41 Tablet
  485. start tablet-mode
  486. start wacom-input
  487. setkeycodes 0x6d 115
  488. setkeycodes 0x6e 114
  489. setkeycodes 0x69 28
  490. setkeycodes 0x6b 158
  491. setkeycodes 0x68 172
  492. setkeycodes 0x6c 127
  493. setkeycodes 0x67 217
  494. ;;
  495. 6363???|6364???|6366???) # ThinkPad X60 Tablet
  496. ;&
  497. 7762???|7763???|7767???) # ThinkPad X61 Tablet
  498. start tablet-mode
  499. start wacom-input
  500. setkeycodes 0x6d 115
  501. setkeycodes 0x6e 114
  502. setkeycodes 0x69 28
  503. setkeycodes 0x6b 158
  504. setkeycodes 0x68 172
  505. setkeycodes 0x6c 127
  506. setkeycodes 0x67 217
  507. ;;
  508. 7448???|7449???|7450???|7453???) # ThinkPad X200 Tablet
  509. start tablet-mode
  510. start wacom-input
  511. setkeycodes 0xe012 158
  512. setkeycodes 0x66 172
  513. setkeycodes 0x6b 127
  514. ;;
  515. *)
  516. ;;
  517. esac
  518.  
  519. # [ -d /proc/asound/card0 ] || modprobe snd-dummy
  520. for c in $(grep '\[.*\]' /proc/asound/cards | awk '{print $1}'); do
  521. f=/system/etc/alsa/$(cat /proc/asound/card$c/id).state
  522. if [ -e $f ]; then
  523. alsa_ctl -f $f restore $c
  524. alsa_amixer -c $c set Speaker 50%
  525. else
  526. alsa_ctl init $c
  527. alsa_amixer -c $c set Master on
  528. alsa_amixer -c $c set Master 400%
  529. alsa_amixer -c $c set Headphone on
  530. alsa_amixer -c $c set Headphone 400%
  531. alsa_amixer -c $c set Speaker 400%
  532. alsa_amixer -c $c set Capture 400%
  533. alsa_amixer -c $c set Capture cap
  534. alsa_amixer -c $c set PCM 100 unmute
  535. alsa_amixer -c $c set SPO unmute
  536. alsa_amixer -c $c set IEC958 on
  537. alsa_amixer -c $c set 'Mic Boost' 0
  538. alsa_amixer -c $c set 'Internal Mic Boost' 0
  539. alsa_amixer -c $c set Line on
  540. alsa_amixer -c $c set Line 400%
  541. alsa_amixer -c $c set 'Line Boost' 0
  542. alsa_amixer -c $c set 'Front Mic' on
  543. alsa_amixer -c $c set 'Front Mic' 100
  544. alsa_amixer -c $c set 'Front Mic Boost' 0
  545. alsa_amixer -c $c set 'Rear Mic' on
  546. alsa_amixer -c $c set 'Rear Mic' 400%
  547. alsa_amixer -c $c set 'Rear Mic Boost' 0
  548. alsa_amixer -c $c set 'Input Source',0 'Rear Mic'
  549. alsa_amixer -c0 set Mic on
  550. alsa_amixer -c0 set Mic 400%
  551. alsa_amixer -c0 set 'Mic Boost' 0
  552. alsa_amixer -c0 set 'Internal Mic' on
  553. alsa_amixer -c0 set 'Internal Mic' 400%
  554. alsa_amixer -c0 set 'Internal Mic Boost' 0
  555. alsa_amixer -c0 set Capture 300
  556. alsa_amixer -c0 set Capture cap
  557. alsa_amixer -c0 set 'Front Mic' on
  558. alsa_amixer -c0 set 'Front Mic' 100
  559. alsa_amixer -c0 set 'Front Mic Boost' 1
  560. alsa_amixer -c0 set 'Rear Mic' on
  561. alsa_amixer -c0 set 'Rear Mic' 400%
  562. alsa_amixer -c0 set 'Rear Mic Boost' 1
  563. alsa_amixer -c0 set Line on
  564. alsa_amixer -c0 set Line 400%
  565. alsa_amixer -c0 set 'Line Boost' 1
  566. alsa_amixer -c0 set 'Input Source',1 'Rear Mic'
  567. alsa_amixer -c0 set 'Inverted Internal Mic' on
  568. alsa_amixer -c0 set 'Inverted Internal Mic' 400%
  569. alsa_amixer -c0 set 'Inverted Internal Mic Boost' 1
  570. alsa_amixer -c1 set Mic on
  571. alsa_amixer -c1 set Mic 400%
  572. alsa_amixer -c1 set 'Mic Boost' 1
  573. alsa_amixer -c1 set 'Internal Mic' on
  574. alsa_amixer -c1 set 'Internal Mic' 400%
  575. alsa_amixer -c1 set 'Internal Mic Boost' 1
  576. alsa_amixer -c1 set Capture 300
  577. alsa_amixer -c1 set Capture cap
  578. alsa_amixer -c1 set 'Front Mic' on
  579. alsa_amixer -c1 set 'Front Mic' 100
  580. alsa_amixer -c1 set 'Front Mic Boost' 1
  581. alsa_amixer -c1 set 'Rear Mic' on
  582. alsa_amixer -c1 set 'Rear Mic' 400%
  583. alsa_amixer -c1 set 'Rear Mic Boost' 1
  584. alsa_amixer -c1 set Line on
  585. alsa_amixer -c1 set Line 400%
  586. alsa_amixer -c1 set 'Line Boost' 1
  587. alsa_amixer -c1 set 'Input Source',1 'Rear Mic'
  588. alsa_amixer -c1 set 'Inverted Internal Mic' on
  589. alsa_amixer -c1 set 'Inverted Internal Mic' 400%
  590. alsa_amixer -c1 set 'Inverted Internal Mic Boost' 1
  591. alsa_amixer -c1 sset Mic on
  592. alsa_amixer -c1 sset Mic 400%
  593. alsa_amixer -c1 sset 'Mic Boost' 1
  594. alsa_amixer -c1 sset 'Internal Mic' on
  595. alsa_amixer -c1 sset 'Internal Mic' 400%
  596. alsa_amixer -c1 sset 'Internal Mic Boost' 1
  597. alsa_amixer -c1 sset Capture 100
  598. alsa_amixer -c1 sset Capture cap
  599. alsa_amixer -c1 sset 'Front Mic' on
  600. alsa_amixer -c1 sset 'Front Mic' 100
  601. alsa_amixer -c1 sset 'Front Mic Boost' 1
  602. alsa_amixer -c1 sset 'Rear Mic' on
  603. alsa_amixer -c1 sset 'Rear Mic' 400%
  604. alsa_amixer -c1 sset 'Rear Mic Boost' 1
  605. alsa_amixer -c1 sset Line on
  606. alsa_amixer -c1 sset Line 400%
  607. alsa_amixer -c1 sset 'Line Boost' 1
  608. alsa_amixer -c1 sset 'Input Source',1 'Rear Mic'
  609. alsa_amixer -c1 sset 'Inverted Internal Mic' on
  610. alsa_amixer -c1 sset 'Inverted Internal Mic' 400%
  611. alsa_amixer -c1 sset 'Inverted Internal Mic Boost' 1
  612. alsa_amixer -c1 cset name='Mic Capture Switch' on
  613. alsa_amixer -c1 cset name='Internal Mic Capture Switch' on
  614. alsa_amixer -c1 cset name='Inverted Internal Mic Capture Switch' on
  615. fi
  616. done
  617.  
  618. case "$(cat $DMIPATH/uevent)" in
  619. *S10T*)
  620. alsa_amixer -c 0 set Speaker 400%
  621. ;;
  622. *)
  623. ;;
  624. esac
  625.  
  626. post_bootcomplete
  627. }
  628.  
  629. function do_hci()
  630. {
  631. local hci=`hciconfig | grep ^hci | cut -d: -f1`
  632. local btd="`getprop init.svc.bluetoothd`"
  633. log -t bluetoothd -p i "$btd ($hci)"
  634. if [ -n "`getprop hal.bluetooth.uart`" ]; then
  635. [ "`getprop init.svc.bluetoothd`" = "running" ] && hciconfig $hci up
  636. fi
  637. }
  638.  
  639. PATH=/sbin:/system/bin:/system/xbin
  640.  
  641. DMIPATH=/sys/class/dmi/id
  642. BOARD=$(cat $DMIPATH/board_name)
  643. PRODUCT=$(cat $DMIPATH/product_name)
  644.  
  645. # import cmdline variables
  646. for c in `cat /proc/cmdline`; do
  647. case $c in
  648. BOOT_IMAGE=*|iso-scan/*|*.*=*)
  649. ;;
  650. *=*)
  651. eval $c
  652. if [ -z "$1" ]; then
  653. case $c in
  654. DEBUG=*)
  655. [ -n "$DEBUG" ] && set_property debug.logcat 1
  656. ;;
  657. esac
  658. fi
  659. ;;
  660. esac
  661. done
  662.  
  663. [ -n "$DEBUG" ] && set -x || exec &> /dev/null
  664.  
  665. # import the vendor specific script
  666. hw_sh=/vendor/etc/init.sh
  667. [ -e $hw_sh ] && source $hw_sh
  668.  
  669. case "$1" in
  670. netconsole)
  671. [ -n "$DEBUG" ] && do_netconsole
  672. phoenixos_compat
  673. ;;
  674. bootcomplete)
  675. do_bootcomplete
  676. ;;
  677. bootanim)
  678. do_bootanim
  679. ;;
  680. init|"")
  681. do_init
  682. ;;
  683. esac
  684.  
  685. return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement