From 220674ac29ea482dcda9e9f09c9151c5283eeece Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 15 Jun 2012 02:35:15 +0300 Subject: [PATCH] updates for CyanogenMod migration init.rc merged with CM one --- AndroidBoard.mk | 11 ---- BoardConfig.mk | 13 +++-- init.rc | 131 +++++++++++++++++++++++++------------------ pandora.mk | 22 ++++++-- pnd/gingerbread.pxml | 8 +-- scripts/make_pnd.sh | 2 + system.prop | 10 ++++ 7 files changed, 118 insertions(+), 79 deletions(-) create mode 100644 system.prop diff --git a/AndroidBoard.mk b/AndroidBoard.mk index cf98d50..a36cf68 100644 --- a/AndroidBoard.mk +++ b/AndroidBoard.mk @@ -1,15 +1,5 @@ LOCAL_PATH := $(call my-dir) -ifeq ($(TARGET_PREBUILT_KERNEL),) -TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/kernel -endif - -file := $(INSTALLED_KERNEL_TARGET) -ALL_PREBUILT += $(file) -$(file): $(TARGET_PREBUILT_KERNEL) | $(ACP) - $(transform-prebuilt-to-target) - -ifeq ($(TARGET_PROVIDES_INIT_RC),true) file := $(TARGET_ROOT_OUT)/init.rc ifeq ($(strip $(DSP_PATH)),) $(file): $(LOCAL_PATH)/init.rc | $(ACP) @@ -18,7 +8,6 @@ $(file): $(LOCAL_PATH)/init.omap3.rc | $(ACP) endif $(transform-prebuilt-to-target) ALL_PREBUILT += $(file) -endif ifneq ($(strip $(DSP_PATH)),) # DSP module node permissions diff --git a/BoardConfig.mk b/BoardConfig.mk index dc30d04..8b11664 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -4,7 +4,7 @@ TARGET_NO_BOOTLOADER := true TARGET_NO_KERNEL := true TARGET_PROVIDES_INIT_RC := true TARGET_NO_RADIOIMAGE := true -#USE_CAMERA_STUB := true +USE_CAMERA_STUB := true #BOARD_USES_GENERIC_AUDIO := true BOARD_USES_ALSA_AUDIO := true BUILD_WITH_ALSA_UTILS := true @@ -17,16 +17,18 @@ BUILD_WITHOUT_PV := false BUILD_PV_OMX_ONLY := true OMAP_ENHANCEMENT := true endif -#BUILD_WITH_FULL_STAGEFRIGHT := true +#BUILD_WITH_FULL_STAGEFRIGHT := true #BUILD_PV_VIDEO_ENCODERS := 1 +#BOARD_USES_OMAP3_LIGHTS := false -BOARD_USES_OMAP3_LIGHTS := false +BOARD_NO_RGBX_8888 := true # Wifi WPA_SUPPLICANT_VERSION := VER_0_8_X #BOARD_WPA_SUPPLICANT_DRIVER := NL80211 BOARD_WPA_SUPPLICANT_DRIVER := WEXT +BOARD_WLAN_DEVICE := wlan0 WIFI_DRIVER_MODULE_PATH := "/vendor/wl1251_sdio.ko" WIFI_DRIVER_MODULE_NAME := "wl1251_sdio" @@ -35,13 +37,16 @@ BOARD_HAVE_BLUETOOTH := true # Setup some runtime system properties. TARGET_BOARD_PLATFORM := omap3 -#TARGET_BOOTLOADER_BOARD_NAME := pandora + TARGET_CPU_ABI := armeabi-v7a TARGET_CPU_ABI2 := armeabi ARCH_ARM_HAVE_NEON := true TARGET_ARCH_VARIANT := armv7-a-neon ARCH_ARM_HAVE_TLS_REGISTER := true +TARGET_GLOBAL_CFLAGS += -mtune=cortex-a8 +TARGET_GLOBAL_CPPFLAGS += -mtune=cortex-a8 + #HARDWARE_OMX := true ifdef HARDWARE_OMX diff --git a/init.rc b/init.rc index be3190b..eb172d7 100644 --- a/init.rc +++ b/init.rc @@ -9,22 +9,23 @@ sysclktz 0 loglevel 3 # setup the global environment - export PATH /sbin:/system/sbin:/system/bin:/system/xbin + export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin export LD_LIBRARY_PATH /system/lib export ANDROID_BOOTLOGO 1 + export ANDROID_CACHE /data/cache export ANDROID_ROOT /system export ANDROID_ASSETS /system/app export ANDROID_DATA /data + export DOWNLOAD_CACHE /data/cache/download export EXTERNAL_STORAGE /mnt/sdcard2 export ASEC_MOUNTPOINT /mnt/asec + export LOOP_MOUNTPOINT /mnt/obb + export SD_EXT_DIRECTORY /sd-ext export BOOTCLASSPATH /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar # Location of BT firmware files export BT_FW_PATH /vendor/firmware -# for windows adb users.. - export LS_COLORS none - # Backward compatibility symlink /system/etc /etc symlink /sys/kernel/debug /d @@ -44,7 +45,8 @@ loglevel 3 mkdir /system mkdir /data 0771 system system - mkdir /cache 0770 system cache + mkdir /data/cache 0771 system cache + symlink /data/cache /cache mkdir /config 0500 root root # Directory for putting things only root should see. @@ -61,6 +63,12 @@ loglevel 3 mkdir /mnt/asec 0700 root system mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000 + # Filesystem image public mount points. + mkdir /mnt/obb 0700 root system + mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000 + + mkdir /sd-ext 0771 system system + # write /proc/sys/kernel/panic_on_oops 1 write /proc/sys/kernel/hung_task_timeout_secs 0 write /proc/cpu/alignment 4 @@ -88,13 +96,11 @@ loglevel 3 # 5.0 % write /dev/cpuctl/bg_non_interactive/cpu.shares 52 -# Power Management Patches - chmod 0777 /sys/power/state - chmod 0777 /sys/power/wake_lock - chmod 0777 /sys/power/wake_unlock - chmod 0777 /sys/power/wait_for_fb_sleep - chmod 0777 /sys/power/wait_for_fb_wake +on post-fs + # once everything is setup, no need to modify / + mount rootfs rootfs / ro remount + # We chown/chmod /data again so because mount is run as root + defaults chown system system /data chmod 0771 /data @@ -118,8 +124,8 @@ loglevel 3 write /proc/apanic_console 1 # Same reason as /data above - chown system cache /cache - chmod 0770 /cache + chown system cache /data/cache + chmod 0771 /data/cache # This may have been created by the recovery system with odd permissions chown system cache /cache/recovery @@ -139,10 +145,7 @@ loglevel 3 chmod 0777 /dev/video1 chmod 0777 /dev/video2 chmod 0777 /dev/omap-resizer - -# change permissions for Overlay on 2.6.37 kernel - chmod 777 /dev/video7 - + chmod 777 /dev/video7 # create basic filesystem structure @@ -153,11 +156,11 @@ loglevel 3 mkdir /data/misc/vpn 0770 system system mkdir /data/misc/systemkeys 0700 system system mkdir /data/misc/vpn/profiles 0770 system system - # give system access to wpa_supplicant.conf for backup and restore mkdir /system/etc/wifi 0770 system wifi chmod 0770 /system/etc/wifi chmod 0660 /system/etc/wifi/wpa_supplicant.conf + chown system wifi /system/etc/wifi/wpa_supplicant.conf mkdir /data/misc/wifi 0770 system wifi mkdir /data/misc/wifi/sockets 0777 system wifi @@ -166,12 +169,16 @@ loglevel 3 chown wifi wifi /data/misc/wifi chown wifi wifi /data/misc/wifi/wpa_supplicant.conf - mkdir /data/local 0771 shell shell + mkdir /data/local 0751 root root mkdir /data/local/tmp 0771 shell shell + mkdir /data/local/download 0771 system cache 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 + + mkdir /data/cache/download 0771 system cache + mkdir /data/misc/dhcp 0777 dhcp dhcp mkdir /data/misc/udhcpd 0777 system wifi chown dhcp dhcp /data/misc/dhcp @@ -181,6 +188,10 @@ loglevel 3 chown system system /data/dalvik-cache chmod 0771 /data/dalvik-cache + mkdir /data/cache/dalvik-cache 0771 system system + chown system system /data/cache/dalvik-cache + chmod 0771 /data/cache/dalvik-cache + # create the lost+found directories, so as to enforce our permissions mkdir /data/lost+found 0770 mkdir /cache/lost+found 0770 @@ -191,6 +202,18 @@ loglevel 3 chown root root /cache/lost+found chmod 0770 /cache/lost+found + # allow net_raw to have access to /dev/socket directory + chown root net_raw /dev/socket + chmod 0775 /dev/socket + + # allow system to modify cpufreq control files + chown root system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + chown root system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq + chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq + chown root system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + # console changed to ttyO* from ttyS* since 2.6.37 kernel. chmod 0660 /dev/ttyO1 chown bluetooth bluetooth /dev/ttyO1 @@ -208,22 +231,9 @@ on boot # set RLIMIT_NICE to allow priorities from 19 to -20 setrlimit 13 40 40 -# No battery hardware present - setprop hw.nobattery true - setprop hw.nophone true - # Power Management Patches setprop hw.nopm true -# Enabling CPU Freq and CPU Idle -# CPU Freq - write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor performance -# CPU Idle - mkdir /debug - mount debugfs debugfs /debug -# write /debug/pm_debug/sleep_while_idle 0 -# write /debug/pm_debug/enable_off_mode 0 - # 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 @@ -245,8 +255,8 @@ on boot setprop ro.SECONDARY_SERVER_MEM 6144 setprop ro.BACKUP_APP_MEM 6144 setprop ro.HOME_APP_MEM 6144 - setprop ro.HIDDEN_APP_MEM 5120 - setprop ro.EMPTY_APP_MEM 6144 + setprop ro.HIDDEN_APP_MEM 7168 + setprop ro.EMPTY_APP_MEM 8192 # Write value must be consistent with the above properties. # Note that the driver only supports 6 slots, so we have HOME_APP at the @@ -257,8 +267,8 @@ on boot write /proc/sys/vm/min_free_order_shift 4 write /sys/module/lowmemorykiller/parameters/minfree 2048,3072,4096,6144,7168,8192 - # Set init its forked children's oom_score_adj. - write /proc/1/oom_score_adj -16 + # 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 @@ -280,12 +290,6 @@ on boot chmod 0660 /sys/power/state chmod 0660 /sys/power/wake_lock chmod 0660 /sys/power/wake_unlock -#Brightness Control patches for 2.6.37 kernel -# chmod 0777 /sys/devices/omapdss/display0/backlight/sharp-ls/brightness -# chown system system /sys/devices/omapdss/display0/backlight/sharp-ls/brightness -# chown system system /sys/class/timed_output/vibrator/enable -# chown system system /sys/class/leds/keyboard-backlight/brightness -# 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 @@ -295,10 +299,6 @@ on boot chown system system /sys/kernel/ipv4/tcp_rmem_max chown root radio /proc/cmdline chown system system /system/etc/wifi -# wl12xx_sdio, wlan module for 2.6.37 wlan release -# chown system system /system/etc/wifi/wl12xx_sdio.ko - -# chmod 0755 /wl1271bt_enable # Define TCP buffer sizes for various networks # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax, @@ -310,6 +310,12 @@ on boot setprop wifi.interface wlan0 +# Include extra init file +# import /system/etc/init.local.rc + +# Run sysinit + exec /system/bin/sysinit + class_start default ## Daemon processes to be run by init. @@ -322,6 +328,12 @@ service ueventd /sbin/ueventd #service console /system/bin/sh # console +# disabled +# user shell +# group log + +#on property:ro.secure=0 +# start console service pvr /system/bin/rc.pvr start @@ -339,6 +351,12 @@ on property:persist.service.adb.enable=1 on property:persist.service.adb.enable=0 stop adbd +on property:service.adb.tcp.port=5555 + restart adbd + +on property:service.adb.tcp.port=-1 + restart adbd + service servicemanager /system/bin/servicemanager user system critical @@ -351,6 +369,7 @@ service vold /system/bin/vold service netd /system/bin/netd socket netd stream 0660 root system + socket dnsproxyd stream 0660 root inet service debuggerd /system/bin/debuggerd @@ -358,13 +377,14 @@ 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 audio + group radio cache inet misc audio sdcard_rw net_admin net_raw qcom_oncrpc diag service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server - socket zygote stream 666 + socket zygote stream 660 root system onrestart write /sys/android_power/request_state wake onrestart write /sys/power/state on onrestart restart media + onrestart restart netd service media /system/bin/mediaserver user media @@ -385,8 +405,8 @@ service dbus /system/bin/dbus-daemon --system --nofork service bluetoothd /system/bin/bluetoothd -n 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 + # 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 @@ -414,12 +434,15 @@ service pbap /system/bin/sdptool add --channel=19 PBAP disabled oneshot +service map /system/bin/sdptool add --channel=16 MAS + user bluetooth + group bluetooth net_bt_admin + disabled + oneshot + service installd /system/bin/installd socket installd stream 600 system system -#service flash_recovery /system/etc/install-recovery.sh -# oneshot - service racoon /system/bin/racoon socket racoon stream 600 system system # racoon will setuid to vpn after getting necessary resources. @@ -467,6 +490,6 @@ service wpa_supplicant /system/bin/wpa_supplicant -Dwext -iwlan0 -c/data/misc/wi disabled oneshot -service dhcpcd /system/bin/dhcpcd -ABKL wlan0 +service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL disabled oneshot diff --git a/pandora.mk b/pandora.mk index b2eb06a..99823de 100644 --- a/pandora.mk +++ b/pandora.mk @@ -1,13 +1,20 @@ -PRODUCT_PACKAGES := \ +PRODUCT_PACKAGES += \ + librs_jni \ + dspexec \ + libbridge \ + libaudiopolicy \ + +PRODUCT_PACKAGES += \ ApiDemos \ SoundRecorder \ GeneralRunner \ BluetoothSCOApp \ - alsa.$(TARGET_PRODUCT) \ + alsa.default \ kill_android \ - AndroidTerm \ - libjackpal-androidterm3-pnd \ oi-filemanager \ + keypad.kcm \ + +# overlay.omap3 $(call inherit-product, build/target/product/generic.mk) @@ -15,7 +22,7 @@ $(call inherit-product, build/target/product/generic.mk) PRODUCT_BRAND := openpandora PRODUCT_NAME := pandora PRODUCT_DEVICE := pandora -PRODUCT_PACKAGE_OVERLAYS := device/rowboat/generic +PRODUCT_PACKAGE_OVERLAYS := device/openpandora/pandora/overlay # this make file is to extend FRAMEWORKS_BASE_SUBDIRS from pathmake.mk # and this is placed in common-open as this common between omap3 and omap4 @@ -26,4 +33,7 @@ include device/ti/common-open/OmapMMLib.mk # Install the features available on this device. PRODUCT_COPY_FILES += \ - frameworks/base/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml + frameworks/base/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \ + frameworks/base/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \ + frameworks/base/data/etc/android.hardware.touchscreen.multitouch.distinct.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.distinct.xml \ + diff --git a/pnd/gingerbread.pxml b/pnd/gingerbread.pxml index a2f8353..10c781e 100644 --- a/pnd/gingerbread.pxml +++ b/pnd/gingerbread.pxml @@ -4,7 +4,7 @@ Android Gingerbread - + @@ -14,7 +14,7 @@ Android Gingerbread - The whole Android 2.3.4 (Gingerbread) OS fitted inside a PND + The whole Android 2.3.7 (Gingerbread) OS + CyanogenMod fitted inside a PND @@ -23,13 +23,13 @@ - + - + diff --git a/scripts/make_pnd.sh b/scripts/make_pnd.sh index 944471d..9cd92aa 100755 --- a/scripts/make_pnd.sh +++ b/scripts/make_pnd.sh @@ -21,6 +21,8 @@ mkfs.ext2 -N 512 -F /tmp/pnd_android/rootfs.ext2 mount -o loop /tmp/pnd_android/rootfs.ext2 /mnt/tmp/ cd /mnt/tmp/ tar xf /tmp/pnd_android/rootfs.tar.bz2 +# CyanogenMod forgets perms? +chmod +x init sbin/* cd /tmp/ umount /mnt/tmp/ diff --git a/system.prop b/system.prop new file mode 100644 index 0000000..44fb712 --- /dev/null +++ b/system.prop @@ -0,0 +1,10 @@ +# +# system.prop +# +#ro.sf.lcd_density=240 +#keyguard.no_require_sim=true +wifi.interface=wlan0 +#alsa.mixer.playback.master=Analog +alsa.mixer.capture.master=Analog +dalvik.vm.heapsize=32m +ro.opengles.version=131072 -- 2.39.5