Add init.d stuff.
This commit is contained in:
12
prebuilt/common/etc/init.d/00banner
Executable file
12
prebuilt/common/etc/init.d/00banner
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/system/bin/sh
|
||||
#
|
||||
# Print startup info
|
||||
#
|
||||
L="log -p i -t cm"
|
||||
|
||||
$L "Welcome to Android `getprop ro.build.version.release` / `getprop ro.modversion`";
|
||||
$L " _ ";
|
||||
$L " __ __ _ ___ _ _ __ ___ __ _ _ _ _ __ __))";
|
||||
$L "((_ \\(/'((_( ((\\( ((_)((_( (('((\\( ((\`1( ((_)((_( ";
|
||||
$L " )) _))";
|
||||
$L " ";
|
2
prebuilt/common/etc/init.d/01sysctl
Executable file
2
prebuilt/common/etc/init.d/01sysctl
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/system/bin/sh
|
||||
sysctl -p
|
9
prebuilt/common/etc/init.d/03firstboot
Executable file
9
prebuilt/common/etc/init.d/03firstboot
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/system/bin/sh
|
||||
# execute any postinstall script then kill it
|
||||
if [ -e /data/firstboot.sh ];
|
||||
then
|
||||
log -p i -t boot "Executing firstboot.sh..";
|
||||
logwrapper /system/bin/sh /data/firstboot.sh;
|
||||
rm -f /data/firstboot.sh;
|
||||
fi;
|
||||
|
14
prebuilt/common/etc/init.d/04modules
Executable file
14
prebuilt/common/etc/init.d/04modules
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/system/bin/sh
|
||||
#
|
||||
# Load any extra modules
|
||||
|
||||
MODULES=""
|
||||
|
||||
if [ "`getprop persist.net.ipv6`" = "1" ]; then
|
||||
MODULES="$MODULES ipv6"
|
||||
fi
|
||||
|
||||
for i in $MODULES;
|
||||
do
|
||||
modprobe $i;
|
||||
done
|
54
prebuilt/common/etc/init.d/05mountsd
Executable file
54
prebuilt/common/etc/init.d/05mountsd
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/system/bin/sh
|
||||
#
|
||||
# mount ext[234] partition from sd card
|
||||
|
||||
BB="logwrapper busybox";
|
||||
|
||||
if [ "$SD_EXT_DIRECTORY" = "" ];
|
||||
then
|
||||
SD_EXT_DIRECTORY=/sd-ext;
|
||||
fi;
|
||||
|
||||
# find first linux partition on SD card
|
||||
MMC=/dev/block/mmcblk0
|
||||
|
||||
# wait for the device to settle
|
||||
COUNT=6;
|
||||
until [ -b "$MMC" ] || [ $COUNT -lt 1 ];
|
||||
do
|
||||
sleep 1;
|
||||
COUNT=$((COUNT-1));
|
||||
done;
|
||||
|
||||
if [ -b "$MMC" ];
|
||||
then
|
||||
FDISK="busybox fdisk"
|
||||
PARTITION=`$FDISK -l $MMC | awk '/^\// && $5 == 83 {print $1;exit;}'`
|
||||
|
||||
if [ -b "$PARTITION" ];
|
||||
then
|
||||
log -p i -t mountsd "Checking filesystems..";
|
||||
|
||||
# fsck the sdcard filesystem first
|
||||
logwrapper e2fsck -y $PARTITION;
|
||||
|
||||
# set property with exit code in case an error occurs
|
||||
setprop cm.e2fsck.errors $?;
|
||||
if [ "$?" = 0 ];
|
||||
then
|
||||
|
||||
# mount and set perms
|
||||
$BB mount -o noatime,nodiratime -t auto $PARTITION $SD_EXT_DIRECTORY;
|
||||
if [ "$?" = 0 ];
|
||||
then
|
||||
$BB chown 1000:1000 $SD_EXT_DIRECTORY;
|
||||
$BB chmod 771 $SD_EXT_DIRECTORY;
|
||||
log -p i -t mountsd "$SD_EXT_DIRECTORY successfully mounted";
|
||||
else
|
||||
log -p e -t mountsd "Unable to mount filesystem for $SD_EXT_DIRECTORY!";
|
||||
fi
|
||||
else
|
||||
log -p e -t mountsd "Unable to repair filesystem, disabling apps2sd";
|
||||
fi
|
||||
fi
|
||||
fi
|
24
prebuilt/common/etc/init.d/10apps2sd
Executable file
24
prebuilt/common/etc/init.d/10apps2sd
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/system/bin/sh
|
||||
# Make sure the Apps2SD structure exists.
|
||||
|
||||
if [ "$SD_EXT_DIRECTORY" = "" ];
|
||||
then
|
||||
SD_EXT_DIRECTORY=/sd-ext;
|
||||
fi;
|
||||
|
||||
if ! awk -vDIR="$SD_EXT_DIRECTORY" '$2 == DIR { exit 1; }' /proc/mounts ;
|
||||
then
|
||||
# create directories if necessary.
|
||||
for i in app app-private dalvik-cache;
|
||||
do
|
||||
if [ ! -d $SD_EXT_DIRECTORY/$i ];
|
||||
then
|
||||
mkdir $SD_EXT_DIRECTORY/$i;
|
||||
busybox chown 1000:1000 $SD_EXT_DIRECTORY/$i;
|
||||
busybox chmod 771 $SD_EXT_DIRECTORY/$i;
|
||||
log -p i -t a2sd "$SD_EXT_DIRECTORY/$i created"
|
||||
fi;
|
||||
done
|
||||
setprop cm.a2sd.active 1
|
||||
log -p i -t a2sd "Apps2SD successfully activated";
|
||||
fi;
|
21
prebuilt/common/etc/init.d/20userinit
Executable file
21
prebuilt/common/etc/init.d/20userinit
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/system/bin/sh
|
||||
# call a userinit.sh script if it's present on the sdcard
|
||||
|
||||
if [ "$SD_EXT_DIRECTORY" = "" ];
|
||||
then
|
||||
SD_EXT_DIRECTORY=/sd-ext;
|
||||
fi;
|
||||
|
||||
if [ -e $SD_EXT_DIRECTORY/userinit.sh ];
|
||||
then
|
||||
log -p i -t userinit "Executing $SD_EXT_DIRECTORY/userinit.sh";
|
||||
busybox chmod +x $SD_EXT_DIRECTORY/userinit.sh;
|
||||
logwrapper /system/bin/sh $SD_EXT_DIRECTORY/userinit.sh;
|
||||
setprop cm.userinit.active 1;
|
||||
fi;
|
||||
|
||||
if [ -d $SD_EXT_DIRECTORY/userinit.d ];
|
||||
then
|
||||
logwrapper busybox run-parts $SD_EXT_DIRECTORY/userinit.d;
|
||||
setprop cm.userinit.active 1;
|
||||
fi;
|
13
prebuilt/dream_sapphire/etc/init.d/02audio_profile
Executable file
13
prebuilt/dream_sapphire/etc/init.d/02audio_profile
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/system/bin/sh
|
||||
|
||||
if [ ! -e /system/etc/AudioPara4.csv ];
|
||||
then
|
||||
mount -o remount,rw /system
|
||||
if [ `getprop ro.product.device` = "dream" ];
|
||||
then
|
||||
ln -s /system/etc/AudioPara_dream.csv /system/etc/AudioPara4.csv
|
||||
else
|
||||
ln -s /system/etc/AudioPara_sapphire.csv /system/etc/AudioPara4.csv
|
||||
fi
|
||||
mount -o remount,ro /system
|
||||
fi
|
@@ -60,6 +60,11 @@ PRODUCT_COPY_FILES += \
|
||||
vendor/cyanogen/prebuilt/common/etc/terminfo/l/linux:system/etc/terminfo/l/linux \
|
||||
vendor/cyanogen/prebuilt/common/etc/terminfo/u/unknown:system/etc/terminfo/u/unknown \
|
||||
vendor/cyanogen/prebuilt/common/etc/profile:system/etc/profile \
|
||||
vendor/cyanogen/prebuilt/common/etc/init.d/00banner:system/etc/init.d/00banner \
|
||||
vendor/cyanogen/prebuilt/common/etc/init.d/01sysctl:system/etc/init.d/01sysctl \
|
||||
vendor/cyanogen/prebuilt/common/etc/init.d/03firstboot:system/etc/init.d/03firstboot \
|
||||
vendor/cyanogen/prebuilt/common/etc/init.d/04modules:system/etc/init.d/04modules \
|
||||
vendor/cyanogen/prebuilt/common/etc/init.d/20userinit:system/etc/init.d/20userinit \
|
||||
vendor/cyanogen/prebuilt/common/xbin/bash:system/xbin/bash \
|
||||
vendor/cyanogen/prebuilt/common/xbin/htop:system/xbin/htop \
|
||||
vendor/cyanogen/prebuilt/common/xbin/irssi:system/xbin/irssi \
|
||||
@@ -68,6 +73,10 @@ PRODUCT_COPY_FILES += \
|
||||
vendor/cyanogen/prebuilt/common/xbin/powertop:system/xbin/powertop \
|
||||
vendor/cyanogen/prebuilt/common/xbin/openvpn-up.sh:system/xbin/openvpn-up.sh
|
||||
|
||||
#PRODUCT_COPY_FILES += \
|
||||
# vendor/cyanogen/prebuilt/common/etc/init.d/05mountsd:system/etc/init.d/05mountsd \
|
||||
# vendor/cyanogen/prebuilt/common/etc/init.d/10apps2sd:system/etc/init.d/10apps2sd
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
vendor/cyanogen/proprietary/RomManager.apk:system/app/RomManager.apk \
|
||||
|
||||
|
@@ -25,6 +25,9 @@ PRODUCT_SPECIFIC_DEFINES += TARGET_PREBUILT_KERNEL=
|
||||
PRODUCT_SPECIFIC_DEFINES += TARGET_KERNEL_DIR=kernel-msm
|
||||
PRODUCT_SPECIFIC_DEFINES += TARGET_KERNEL_CONFIG=cyanogen_msm_defconfig
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
vendor/cyanogen/prebuilt/dream_sapphire/etc/init.d/02audio_profile:system/etc/init.d/02audio_profile
|
||||
|
||||
#
|
||||
# Set ro.modversion
|
||||
#
|
||||
|
Reference in New Issue
Block a user