Skip to content

Commit

Permalink
Updated all new updated from CM10 INIT. + new boot INIT.
Browse files Browse the repository at this point in the history
TNX to haramizuki@xda
  • Loading branch information
dorimanx committed Oct 7, 2012
1 parent 091d949 commit ce08dd2
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 82 deletions.
Binary file modified res/misc/JellyB-CM-AOKP/boot
Binary file not shown.
86 changes: 38 additions & 48 deletions res/misc/JellyB-CM-AOKP/init.rc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

# THIS INIT.RC is FOR CM10/AOKP JB ROMS!

import init.smdk4210.rc
import init.usb.rc
import init.trace.rc
import init.smdk4210.dm_kernel.rc
import /init.smdk4210.rc
import /init.usb.rc
import /init.trace.rc
import /init.smdk4210.dm_kernel.rc

on early-init
# Set init and its forked children's oom_adj.
Expand Down Expand Up @@ -37,6 +37,8 @@ loglevel 3
export ASEC_MOUNTPOINT /mnt/asec
export LOOP_MOUNTPOINT /mnt/obb
export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar
export TERMINFO /system/etc/terminfo
export TERM linux

# Backward compatibility
symlink /system/etc /etc
Expand All @@ -53,7 +55,7 @@ loglevel 3

mkdir /system
mkdir /data 0771 system system
mkdir /cache 0777 system cache
mkdir /cache 0771 system cache
mkdir /config 0500 root root
mkdir /preload 0771 system system

Expand All @@ -75,15 +77,14 @@ loglevel 3
mkdir /mnt/obb 0700 root system
mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000

mkdir /mnt/.lfs 0755 root root

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_compat_yield 1
write /proc/sys/kernel/sched_child_runs_first 0
write /proc/sys/kernel/randomize_va_space 2
write /proc/sys/kernel/kptr_restrict 0
write /proc/sys/kernel/dmesg_restrict 0
write /proc/sys/kernel/dmesg_restrict 1
write /proc/sys/vm/mmap_min_addr 32768
write /proc/sys/kernel/sched_rt_runtime_us 950000
write /proc/sys/kernel/sched_rt_period_us 1000000
Expand All @@ -93,22 +94,22 @@ loglevel 3
mount cgroup none /dev/cpuctl cpu
chown system system /dev/cpuctl
chown system system /dev/cpuctl/tasks
chmod 0777 /dev/cpuctl/tasks
chmod 0660 /dev/cpuctl/tasks
write /dev/cpuctl/cpu.shares 1024
write /dev/cpuctl/cpu.rt_runtime_us 950000
write /dev/cpuctl/cpu.rt_period_us 1000000

mkdir /dev/cpuctl/apps
chown system system /dev/cpuctl/apps/tasks
chmod 0777 /dev/cpuctl/apps/tasks
chmod 0666 /dev/cpuctl/apps/tasks
write /dev/cpuctl/apps/cpu.shares 1024
write /dev/cpuctl/apps/cpu.rt_runtime_us 800000
write /dev/cpuctl/apps/cpu.rt_period_us 1000000

mkdir /dev/cpuctl/apps/bg_non_interactive
chown system system /dev/cpuctl/apps/bg_non_interactive/tasks
chmod 0777 /dev/cpuctl/apps/bg_non_interactive/tasks
# 5.0 %
chmod 0666 /dev/cpuctl/apps/bg_non_interactive/tasks
# 5.0 %
write /dev/cpuctl/apps/bg_non_interactive/cpu.shares 52
write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_runtime_us 700000
write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_period_us 1000000
Expand All @@ -125,7 +126,7 @@ on post-fs

# We chown/chmod /cache again so because mount is run as root + defaults
chown system cache /cache
chmod 0777 /cache
chmod 0771 /cache

# This may have been created by the recovery system with odd permissions
mkdir /cache/recovery 0770
Expand All @@ -143,19 +144,12 @@ on post-fs
chmod 0220 /proc/sysrq-trigger

# create the lost+found directories, so as to enforce our permissions
mkdir /cache/lost+found 0777 root cache

# double check the perms, in case lost+found already exists, and set owner
chown root root /cache/lost+found
chmod 0777 /cache/lost+found
mkdir /cache/lost+found 0770 root root

on post-fs-data
# We chown/chmod /data again so because mount is run as root + defaults
chown system system /data
chmod 0771 /data
mkdir /data/system
chown system system /data/system
chmod 0771 /data/system

# Create dump dir and collect dumps.
# Do this before we mount cache so eventually we can use cache for
Expand All @@ -182,13 +176,10 @@ on post-fs-data
mkdir /data/misc/keychain 0771 system system
mkdir /data/misc/vpn 0770 system vpn
mkdir /data/misc/systemkeys 0700 system system
mkdir /data/misc/vpn/profiles 0770 system system
mkdir /data/misc/radio 0775 radio system
# give system access to wpa_supplicant.conf for backup and restore
# give system access to wpa_supplicant.conf for backup and restore
mkdir /data/misc/wifi 0770 wifi wifi
chmod 0777 /data/misc/wifi
chmod 0660 /data/misc/wifi/wpa_supplicant.conf
mkdir /data/local 0771 root shell
mkdir /data/local 0751 root root

# For security reasons, /data/local/tmp should always be empty.
# Do not place files or directories in /data/local/tmp
Expand All @@ -200,7 +191,7 @@ on post-fs-data
mkdir /data/property 0700 root root
mkdir /data/ssh 0750 root shell
mkdir /data/ssh/empty 0700 root root
mkdir /data/radio 0777 radio radio
mkdir /data/radio 0770 radio radio
mkdir /cache/download 0777 system cache

# create dalvik-cache and double-check the perms, so as to enforce our permissions
Expand All @@ -218,15 +209,11 @@ on post-fs-data
chmod 0771 /data/resource-cache

# create the lost+found directories, so as to enforce our permissions
mkdir /data/lost+found 0770

# double check the perms, in case lost+found already exists, and set owner
chown root system /data/lost+found
chmod 0770 /data/lost+found
mkdir /data/lost+found 0770 root root

# create directory for DRM plug-ins - give drm the read/write access to
# the following directory.
mkdir /data/drm 0774 drm drm
mkdir /data/drm 0770 drm drm

# IMEI
mkdir /efs/imei 0775
Expand Down Expand Up @@ -271,7 +258,7 @@ on boot
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 system system /sys/power/state
chown system system /sys/power/wakeup_count
chown radio system /sys/power/wake_lock
chown radio system /sys/power/wake_unlock
Expand Down Expand Up @@ -300,8 +287,15 @@ on boot
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost

# Assume SMP uses shared cpufreq policy for all CPUs
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

chown system system /sys/block/mmcblk0/queue/scheduler
chmod 0664 /sys/block/mmcblk0/queue/scheduler

chown system system /sys/class/timed_output/vibrator/enable
chown system system /sys/class/leds/keyboard-backlight/brightness
Expand Down Expand Up @@ -332,23 +326,19 @@ on boot
chown system system /sys/class/power_supply/battery/temp
chown root radio /proc/cmdline

# 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

# Define TCP buffer sizes for various networks
# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
setprop net.tcp.buffersize.default 4096,87380,704512,4096,16384,110208
setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
setprop net.tcp.buffersize.wifi 524288,1048576,2097152,262144,524288,1048576
setprop net.tcp.buffersize.lte 524288,1048576,2097152,262144,524288,1048576
setprop net.tcp.buffersize.umts 4094,87380,563200,4096,16384,110208
setprop net.tcp.buffersize.hspa 4094,87380,704512,4096,16384,262144
setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
setprop net.tcp.buffersize.hspa 4094,87380,262144,4096,16384,262144
setprop net.tcp.buffersize.hsupa 4094,87380,262144,4096,16384,262144
setprop net.tcp.buffersize.hsdpa 4094,87380,262144,4096,16384,262144
setprop net.tcp.buffersize.hspap 4094,87380,1220608,4096,16384,1220608
setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
setprop net.tcp.buffersize.evdo 4094,87380,262144,4096,16384,262144

# allow system to modify ksm control files
chown root system /sys/kernel/mm/ksm/pages_to_scan
Expand Down Expand Up @@ -448,7 +438,7 @@ service ril-daemon /system/bin/rild
socket rild stream 0660 root radio
socket rild-debug stream 0660 radio system
user root
group radio cache inet misc audio sdcard_r sdcard_rw qcom_oncrpc qcom_diag diag log
group radio cache inet misc audio sdcard_r sdcard_rw qcom_oncrpc qcom_diag log

service surfaceflinger /system/bin/surfaceflinger
class main
Expand All @@ -467,7 +457,7 @@ service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-sys
service drm /system/bin/drmserver
class main
user drm
group drm system inet drmrpc sdcard_rw media_rw radio sdcard_r
group drm system inet drmrpc sdcard_r

service media /system/bin/mediaserver
class main
Expand Down
34 changes: 18 additions & 16 deletions res/misc/JellyB-CM-AOKP/init.smdk4210.rc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ on early-init
symlink /storage/sdcard0 /mnt/sdcard
symlink /storage/sdcard1 /extSdCard
symlink /storage/sdcard1 /mnt/extSdCard
symlink /storage/sdcard1 /mnt/emmc
symlink /storage/sdcard1 /emmc
symlink /storage/usbdisk0 /usbdisk0
symlink /storage/usbdisk0 /mnt/usbdisk0
symlink /storage/usbdisk /mnt/usbdisk
Expand Down Expand Up @@ -82,10 +80,10 @@ on post-fs-data
chown system system /data/gps

# give system access to wpa_supplicant.conf for backup and restore
mkdir /data/misc/wifi 0774 wifi wifi
mkdir /data/misc/wifi 0770 wifi wifi
chmod 0770 /data/misc/wifi
chmod 0660 /data/misc/wifi/wpa_supplicant.conf
mkdir /data/misc/wifi/sockets 0774 wifi wifi
mkdir /data/misc/wifi/sockets 0770 wifi wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp

Expand Down Expand Up @@ -149,10 +147,6 @@ on post-fs-data
chmod 0775 /data/log
chmod 0775 /data/anr

chmod 0662 /dev/log/radio
chmod 0662 /dev/log/main
chmod 0662 /dev/log/event

#panorama directory creation
mkdir /data/pxtmpdir 0775
chown system system /data/pxtmpdir
Expand Down Expand Up @@ -340,6 +334,14 @@ on boot
setprop status.battery.level_raw 50
setprop status.battery.level_scale 9

service mdnsd /system/bin/mdnsd
class main
user mdnsr
group inet net_raw
socket mdnsd stream 0660 mdnsr inet
disabled
oneshot

service p2p_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
# we will start as root and wpa_supplicant will switch to user wifi
Expand All @@ -352,15 +354,15 @@ service p2p_supplicant /system/bin/wpa_supplicant \
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
-Dnl80211 -iwlan0 -puse_p2p_group_interface=1 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
# 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
class main
socket wpa_wlan0 dgram 0660 wifi wifi
disabled
oneshot
class main
socket wpa_wlan0 dgram 0660 wifi wifi
disabled
oneshot

service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
class main
Expand Down Expand Up @@ -401,6 +403,6 @@ service bdaddr /system/bin/bdaddr_read

# TVout
service TvoutService_C /system/bin/bintvoutservice
class main
user system
group graphics
class main
user system
group graphics
30 changes: 12 additions & 18 deletions res/misc/JellyB-CM-AOKP/init.smdk4210.rc.2
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ on early-init
symlink /storage/sdcard0 /mnt/sdcard
symlink /storage/sdcard1 /extSdCard
symlink /storage/sdcard1 /mnt/extSdCard
symlink /storage/sdcard1 /mnt/emmc
symlink /storage/sdcard1 /emmc
symlink /storage/usbdisk0 /usbdisk0
symlink /storage/usbdisk0 /mnt/usbdisk0
symlink /storage/usbdisk /mnt/usbdisk
Expand All @@ -46,11 +44,11 @@ on fs
mount vfat /dev/block/mmcblk0p11 /mnt/.secondrom wait utf8

# Check and mount /cache
# exec sfsck /res/dev/cache ext4
exec sfsck /res/dev/cache ext4
mount ext4 loop@/res/dev/cache /cache nosuid nodev noatime wait rw

# Check and mount /data
# exec sfsck /res/dev/data ext4
exec sfsck /res/dev/data ext4
mount ext4 loop@/res/dev/data /data nosuid nodev noatime wait noauto_da_alloc
mount ext4 /dev/block/mmcblk0p12 /preload nosuid nodev noatime wait

Expand Down Expand Up @@ -87,10 +85,10 @@ on post-fs-data
chown system system /data/gps

# give system access to wpa_supplicant.conf for backup and restore
mkdir /data/misc/wifi 0774 wifi wifi
mkdir /data/misc/wifi 0770 wifi wifi
chmod 0770 /data/misc/wifi
chmod 0660 /data/misc/wifi/wpa_supplicant.conf
mkdir /data/misc/wifi/sockets 0774 wifi wifi
mkdir /data/misc/wifi/sockets 0770 wifi wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp

Expand Down Expand Up @@ -154,10 +152,6 @@ on post-fs-data
chmod 0775 /data/log
chmod 0775 /data/anr

chmod 0662 /dev/log/radio
chmod 0662 /dev/log/main
chmod 0662 /dev/log/event

#panorama directory creation
mkdir /data/pxtmpdir 0775
chown system system /data/pxtmpdir
Expand Down Expand Up @@ -365,15 +359,15 @@ service p2p_supplicant /system/bin/wpa_supplicant \
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
-Dnl80211 -iwlan0 -puse_p2p_group_interface=1 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
# 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
class main
socket wpa_wlan0 dgram 0660 wifi wifi
disabled
oneshot
class main
socket wpa_wlan0 dgram 0660 wifi wifi
disabled
oneshot

service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
class main
Expand Down Expand Up @@ -414,6 +408,6 @@ service bdaddr /system/bin/bdaddr_read

# TVout
service TvoutService_C /system/bin/bintvoutservice
class main
user system
group graphics
class main
user system
group graphics

4 comments on commit ce08dd2

@voku
Copy link
Collaborator

@voku voku commented on ce08dd2 Oct 7, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am testing the newest kernel with last CM10 but I can't boot (reboot all the time) maybe I have break it with this commit voku@4877880 or this "updated from CM10 INIT" isn't working ... can you boot CM10?

@dorimanx
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

booting fine for me with that commit.

so something with your new change, maybe some small " is lost of not added, try to revert that commit, and boot.
if OK then you know what to do, fix your commit :)

@dorimanx
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i hope you compiled the master-jelly-bean branch with the new CONFIG.?
you didnt mention that, so i am asking.

@voku
Copy link
Collaborator

@voku voku commented on ce08dd2 Oct 7, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cherry-picked commits from branch "master-jelly-bean" :) so I have to take a look at my commit, thx for answer ...

Please sign in to comment.