Skip to content

Commit

Permalink
INIT cleanups, fix to exfat modules, scripts fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dorimanx committed Aug 14, 2013
1 parent 8074fcb commit 4f4576d
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 60 deletions.
2 changes: 0 additions & 2 deletions init.rc
Expand Up @@ -114,7 +114,6 @@ loglevel 3
on fs
# mount ext4 partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
exec sfsck /res/dev/cache ext4
mount ext4 /res/dev/cache /cache nosuid nodev noatime wait

mkdir /efs
Expand All @@ -132,7 +131,6 @@ on fs
exec check_encryption_status /res/dev/data

on post-fs
exec sfsck /res/dev/data ext4
mount ext4 /res/dev/data /data nosuid nodev noatime wait

# once everything is setup, no need to modify /
Expand Down
2 changes: 0 additions & 2 deletions init.rc.2
Expand Up @@ -119,7 +119,6 @@ on fs
# make sure sdcard is mounted because we may have our data and cache partitions on it
mount vfat /dev/block/mmcblk0p11 /mnt/.secondrom wait utf8

exec sfsck /res/dev/cache ext4
mount ext4 loop@/res/dev/cache /cache nosuid nodev noatime wait

mkdir /efs
Expand All @@ -137,7 +136,6 @@ on fs
exec check_encryption_status /res/dev/data

on post-fs
exec sfsck /res/dev/data ext4
mount ext4 loop@/res/dev/data /data nosuid nodev noatime wait

# once everything is setup, no need to modify /
Expand Down
Binary file modified lib/exfat_modules/exfat_core.ko
Binary file not shown.
25 changes: 6 additions & 19 deletions res/crontab_service/service.sh
Expand Up @@ -2,12 +2,10 @@

# Created By Dorimanx and Dairinin

MIUI_JB=0;
JELLY=0;
JB_SAMMY=0;
[ "`grep -i cMIUI /system/build.prop`" ] && MIUI_JB=1;
JBMIUI=`ls /system/framework/framework-miui-res.apk | wc -l`;
[ -f /system/lib/ssl/engines/libkeystore.so ] && JELLY=1;

if [ `cat /tmp/sammy_rom` -eq "1" ]; then
JB_SAMMY=1;
fi;
Expand Down Expand Up @@ -42,9 +40,9 @@ JB_SAMMY_CRON()
echo "root:x:0:0::/var/spool/cron/crontabs:/sbin/sh" > /etc/passwd;
}

if [ "$JB_SAMMY" -eq "1" ]; then
if [ "$JB_SAMMY" -eq "1" ] || [ "$JBMIUI" -eq "1" ]; then
JB_SAMMY_CRON;
elif [ "$MIUI_JB" -eq "1" ] || [ "$JELLY" -eq "1" ]; then
elif [ "$JELLY" -eq "1" ]; then
JELLY_MIUI;
else
JB_SAMMY_CRON;
Expand All @@ -62,23 +60,12 @@ chmod 777 /data/crontab/cron-scripts/*;

# use /system/etc/cron.d/crontabs/ call the crontab file "root" for JB ROMS
# use /var/spool/cron/crontabs/ call the crontab file "root" for ICS ROMS
if [ -e /system/xbin/busybox ]; then
/sbin/busybox chmod 6755 /system/xbin/busybox;
if [ "$JB_SAMMY" -eq "1" ]; then
if [ -e /system/xbin/busybox ] || [ -e /system/bin/busybox ]; then
if [ "$JB_SAMMY" -eq "1" ] || [ "$JBMIUI" -eq "1" ]; then
nohup /system/xbin/busybox crond -c /var/spool/cron/crontabs/
elif [ "$MIUI_JB" -eq "1" ] || [ "$JELLY" -eq "1" ]; then
elif [ "$JELLY" -eq "1" ]; then
nohup /system/xbin/busybox crond -c /system/etc/cron.d/crontabs/
else
nohup /system/xbin/busybox crond -c /var/spool/cron/crontabs/
fi;
elif [ -e /system/bin/busybox ]; then
/sbin/busybox chmod 6755 /system/bin/busybox;
if [ "$JB_SAMMY" -eq "1" ]; then
nohup /system/xbin/busybox crond -c /var/spool/cron/crontabs/
elif [ "$MIUI_JB" -eq "1" ] || [ "$JELLY" -eq "1" ]; then
nohup /system/bin/busybox crond -c /system/etc/cron.d/crontabs/
else
nohup /system/xbin/busybox crond -c /var/spool/cron/crontabs/
fi;
fi;

6 changes: 5 additions & 1 deletion res/misc/JellyB-CM-AOKP-10.1/init.rc
Expand Up @@ -233,11 +233,15 @@ on post-fs-data
mkdir /data/app-asec 0700 root root
mkdir /data/app-lib 0771 system system
mkdir /data/app 0771 system system
mkdir /data/property 0700 root root
mkdir /data/property 0770 root radio
mkdir /data/ssh 0750 root shell
mkdir /data/ssh/empty 0700 root root
mkdir /data/radio 0770 radio radio

# set correct permissions on /data/property
chown root radio /data/property
chmod 0770 /data/property

# create dalvik-cache and double-check the perms, so as to enforce our permissions
mkdir /data/dalvik-cache 0771 system system
chown system system /data/dalvik-cache
Expand Down
6 changes: 5 additions & 1 deletion res/misc/JellyB-Sammy/init.rc
Expand Up @@ -201,10 +201,14 @@ on post-fs-data
mkdir /data/app-private 0771 system system
mkdir /data/app-asec 0700 root root
mkdir /data/app 0771 system system
mkdir /data/property 0700 root root
mkdir /data/property 0770 root radio
mkdir /data/ssh 0750 root shell
mkdir /data/ssh/empty 0700 root root

# set correct permissions on /data/property
chown root radio /data/property
chmod 0770 /data/property

# SA, System SW, SAMSUNG create log directory
mkdir /data/log 0775 system log
chown system log /data/log
Expand Down
7 changes: 2 additions & 5 deletions res/misc/JellyB-Sammy/init.smdk4210.rc
Expand Up @@ -117,6 +117,8 @@ on boot
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type

# Permisions for sensors
chown system radio /sys/devices/platform/s5p-ehci/ehci_power
chown system radio /sys/devices/platform/s5p-ehci/ehci_runtime
chown system radio /dev/accelerometer
chown radio system /sys/devices/virtual/accelerometer/accelerometer/acc_file
chown radio system /sys/devices/virtual/sec/gsensorcal/calibration
Expand All @@ -140,11 +142,6 @@ on boot
chown root shell /dev/tspdrv

on fs
# check all
exec sfsck /res/dev/cache ext4
exec sfsck /dev/block/mmcblk0p1 ext4
exec sfsck /res/dev/data ext4

# Mount all
mount_all /fstab.smdk4210

Expand Down
2 changes: 2 additions & 0 deletions res/misc/JellyB-Sammy/init.smdk4210.rc.2
Expand Up @@ -117,6 +117,8 @@ on boot
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type

# Permisions for sensors
chown system radio /sys/devices/platform/s5p-ehci/ehci_power
chown system radio /sys/devices/platform/s5p-ehci/ehci_runtime
chown system radio /dev/accelerometer
chown radio system /sys/devices/virtual/accelerometer/accelerometer/acc_file
chown radio system /sys/devices/virtual/sec/gsensorcal/calibration
Expand Down
16 changes: 8 additions & 8 deletions res/misc/JellyB-Sammy/ueventd.smdk4210.rc
Expand Up @@ -74,16 +74,15 @@
/dev/HPD 0666 system system
/dev/fimg2d 0666 system graphics
/dev/fmradio 0660 system audio
/dev/input/* 0660 root input

#Audio
/dev/snd/controlC0 0660 system audio
/dev/snd/hwC0D0 0660 system audio
/dev/snd/pcmC0D0c 0660 system audio
/dev/snd/pcmC0D0p 0660 system audio
/dev/snd/pcmC0D1c 0660 system audio
/dev/snd/pcmC0D1p 0660 system audio
/dev/snd/timer 0660 system audio
/dev/snd/controlC0 0770 system audio
/dev/snd/hwC0D0 0770 system audio
/dev/snd/pcmC0D0c 0770 system audio
/dev/snd/pcmC0D0p 0770 system audio
/dev/snd/pcmC0D1c 0770 system audio
/dev/snd/pcmC0D1p 0770 system audio
/dev/snd/timer 0770 system audio

#ALP Audio
/dev/srp 0666 system audio
Expand All @@ -101,3 +100,4 @@
/dev/accelerometer 0660 system system
/dev/graphics/fb0 0777 root graphics
/dev/rfkill 0666 root root
/dev/input/* 0660 root input
2 changes: 0 additions & 2 deletions sbin/ext/post-init.sh
Expand Up @@ -341,12 +341,10 @@ chmod 666 /tmp/uci_done;
echo "booting" > /data/.siyah/booting;
chmod 777 /data/.siyah/booting;
pkill -f "com.gokhanmoral.stweaks.app";
export CONFIG_BOOTING=1;
nohup $BB sh /res/uci.sh restore;
UCI_PID=`pgrep -f "/res/uci.sh"`;
echo "-1000" > /proc/$UCI_PID/oom_score_adj;
echo "1" > /tmp/uci_done;
export CONFIG_BOOTING=

# restore all the PUSH Button Actions back to there location
$BB mount -o remount,rw rootfs;
Expand Down
29 changes: 9 additions & 20 deletions sbin/ext/system_tune_on_init.sh
Expand Up @@ -6,9 +6,6 @@ stop;
# set busybox location
BB=/sbin/busybox

$BB chmod -R 777 /tmp/;
$BB chmod -R 6755 /sbin/ext/;

mount -o remount,rw,nosuid,nodev /cache;
mount -o remount,rw,nosuid,nodev /data;
mount -o remount,rw /;
Expand All @@ -18,28 +15,20 @@ $BB rm -rf /cache/lost+found/* 2> /dev/null;
$BB rm -rf /data/lost+found/* 2> /dev/null;
$BB rm -rf /data/tombstones/* 2> /dev/null;
$BB rm -rf /data/anr/* 2> /dev/null;
$BB chmod -R 400 /data/tombstones;

# critical Permissions fix
$BB chown -R root:system /sys/devices/system/cpu/;
$BB chown -R system:system /data/anr;
$BB chown -R root:radio /data/property/;
$BB chmod -R 777 /tmp/;
$BB chmod -R 6755 /sbin/ext/;
$BB chmod -R 0777 /dev/cpuctl/;
$BB chmod -R 0777 /data/system/inputmethod/;
$BB chown -R root:system /sys/devices/system/cpu/;
$BB chmod -R 0777 /sys/devices/system/cpu/;
$BB chown -R system:system /data/anr;
$BB chmod -R 0777 /data/anr/;
$BB chmod 744 /proc/cmdline;

MIUI_JB=0;
JELLY=0;
JBSAMMY=0;
CM_AOKP_10_JB=0;

[ "`$BB grep -i cMIUI /system/build.prop`" ] && MIUI_JB=1;
if [ `cat /tmp/sammy_rom` -eq "1" ]; then
JBSAMMY=1;
fi;
JELLY=`$BB ls /system/lib/ssl/engines/libkeystore.so | wc -l`;
CM_AOKP_10_JB=`$BB ls /system/bin/wfd | wc -l`;
$BB chmod 0744 /proc/cmdline;
$BB chmod -R 0770 /data/property/;
$BB chmod -R 0400 /data/tombstones;

LOG_SDCARDS=/log-sdcards
FIX_BINARY=/sbin/fsck_msdos
Expand Down Expand Up @@ -88,7 +77,7 @@ BOOT_ROM()

if [ -e /tmp/wrong_kernel ]; then
if [ -e /system/bin/wrong_kernel.png ]; then
cp /system/bin/wrong_kernel.png /res/images/icon_clockwork.png;
$BB cp /system/bin/wrong_kernel.png /res/images/icon_clockwork.png;
/sbin/choose_rom 0;
fi;
sleep 15;
Expand Down

0 comments on commit 4f4576d

Please sign in to comment.