codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#!/bin/shm # Init edited and modified by dan1j3l # If u want to use my work please drop my name somewhere fail() { /bin/echo "Failed" /bin/echo "$1" exec /bin/sh } /bin/mount -o remount,rw / / PATH=/sbin:/bin:/system/sbin:/system/bin:/system/xbin:/system/xbin/bb:/data/local/bin /bin/echo "Rootfs loaded." /bin/mount -t proc proc /proc /bin/mount -t sysfs sys /sys /bin/mount | grep mtd notnand=$? if [ $notnand = "0" ] ; then echo "running from NAND" /bin/mount -t yaffs2 /dev/block/mtdblock2 /system /bin/mount -t yaffs2 /dev/block/mtdblock3 /data fi partition=mmcblk0p1 # Try unpartitioned card if [ ! -d /sys/block/mmcblk0/$partition ] ; then partition=mmcblk0 fi #mkdir -m 0777 /sdcard #fsck already done in initrd mount -t vfat -o fmask=0000,dmask=0000,rw,flush,noatime,nodiratime /dev/block/$partition /sdcard [ $? -eq 0 ] || fail "Failed to mount the SD card. Cannot continue." if [ ! -d /sdcard/Android/cache ] ; then mkdir /sdcard/Android/cache fi #mkdir -m 0777 /cache mount /sdcard/Android/cache /cache CARD_PATH=`/bin/grep -o "rel_path=.*" /proc/cmdline | /bin/sed -e "s/.*rel_path=//g" -e "s/ .*//g"` if [ "$CARD_PATH" = "" ];then CARD_PATH="Android" fi; if [ -d /sdcard/$CARD_PATH ] ; then card=/sdcard/$CARD_PATH else card=/sdcard fi if [ $notnand = "1" ] ; then if [ -f $card/data.gz ] ; then echo "Please wait... extracting Data Image" if [ -f $card/data.img ] ; then rm $card/data.img fi gzip -df $card/data.gz [ $? -eq 0 ] || fail "Failed to extract Data Image" mv $card/data $card/data.img echo "done" fi PARTITIONED=0 echo "Checking for partition..." if [ -d /sys/block/mmcblk0/mmcblk0p2 ] ; then PARTITIONED=1 if [ -d /sys/block/mmcblk0/mmcblk0p3 ] ; then PARTITIONED=2 fi fi if [ -f $card/backupsystem/installedsystem.sqsh -o -f $card/backupsystem/installedsystem.img -o -f $card/backupsystem.ext2 ]; then echo "Partitioned Build Detected" else PARTITIONED=0 fi if [ $PARTITIONED -lt 2 ] ; then if [ ! -f $card/data.img ] ; then echo "Creating a new Data store" dd if=/dev/zero of=$card/data.img bs=1048576 count=512 [ $? -eq 0 ] || fail "Failed to allocate the storage" mke2fs -F $card/data.img [ $? -eq 0 ] || fail "Failed to format the storage" fi fi if [ $PARTITIONED -lt 2 ] ; then losetup /dev/block/loop0 $card/data.img [ $? -eq 0 ] || fail "Failed to find data.img on SD Card" e2fsck -y /dev/block/loop0 mount -t ext2 -o noatime,nodiratime,sync /dev/block/loop0 /data else e2fsck -y /dev/block/mmcblk0p3 mount -t ext2 -o noatime,nodiratime /dev/block/mmcblk0p3 /data fi [ $? -eq 0 ] || fail "Failed to mount /data" if [ $PARTITIONED -eq 0 ] ; then if [ -f $card/system.ext2 ] ; then echo "Using uncompressed system" losetup /dev/block/loop1 $card/system.ext2 [ $? -eq 0 ] || fail "Failed to reach system.ext2 on SD Card" e2fsck -y /dev/block/loop1 mount -t ext2 -o noatime,nodiratime /dev/block/loop1 /system [ $? -eq 0 ] || fail "Failed to mount /system" elif [ -f $card/system.sqsh ] ; then echo "Using SquashFS system" losetup /dev/block/loop1 $card/system.sqsh [ $? -eq 0 ] || fail "Failed to find system.sqsh on SD Card" mount -t squashfs -o ro,noatime,nodiratime /dev/block/loop1 /system [ $? -eq 0 ] || fail "Failed to mount /system" else losetup /dev/block/loop1 $card/system.img [ $? -eq 0 ] || fail "Failed to find system.img on SD Card" mount -t cramfs -o ro,noatime,nodiratime /dev/block/loop1 /system [ $? -eq 0 ] || fail "Failed to mount /system" fi else echo "Using partitioned system" e2fsck -y /dev/block/mmcblk0p2 mount -t ext2 -o ro,noatime,nodiratime /dev/block/mmcblk0p2 /system [ $? -eq 0 ] || fail "Failed to mount /system" fi fi if [ -d $card/AndroidApps ] ; then echo Copying Applications if [ ! -d /data/app ] ; then mkdir -m 0771 /data/app fi /bin/cp $card/AndroidApps/* /data/app chown -R 1000:1000 /data/app fi if [ -d "$card/root" ] ; then echo Updating files cp -ar $card/root/* / fi if [ ! -d $card/media ] ; then echo You have no media folder, please extract the resources to your SD card android folder fi /bin/rm -rf /data/etc /bin/mkdir -m 0755 /data/etc mount /data/etc /etc cp -a /system/etc/* /etc #cp -ar /init.etc/* /etc/ #echo "ro.sf.lcd_density=217" >> /etc/default.prop if [ ! -d /data/shared_prefs ] ; then mkdir -m 0770 /data/shared_prefs fi chmod 0770 /data/shared_prefs chown 1000:1000 /data/shared_prefs mount /data/shared_prefs /shared_prefs mount /sdcard/cache /tmp #cp /system/build.prop /tmp/build.prop #mount --bind /tmp/build.prop /system/build.prop #ln -s /lib/android_nexus/hw /system/lib/hw #ln -s /lib/android_nexus/modules /system/lib/modules ### Fix su on some builds... mount --bind /bin/su /system/bin/su 2> /dev/null mount --bind /bin/su /system/xbin/su 2> /dev/null # echo /dev/block/mmcblk0p2 > /sys/devices/platform/usb_mass_storage/lun0/file ifconfig usb0 192.168.20.1 up busybox telnetd -b 192.168.20.1 -l /bin/sh #chmod 4755 /bin/su #mkdir -m 0777 /smodem if [ -d /data/dropbear/ ] ; then echo "Starting SSH" mknod /dev/random c 1 8 mknod /dev/urandom c 1 9 /bin/dropbear -r /data/dropbear/dropbear_rsa_host_key -s fi mount -tdebugfs none /dbgfs #Activate baclight control echo 3 > /sys/class/htc_hw/test #Smooth scroll echo 40 >/sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold #Activate full charging echo 2 > /dbgfs/htc_battery/charger_state echo 1024 > /dbgfs/micropklt_dbg/sleep_leds mkdir /dev/msm_camera mknod /dev/msm_camera/control0 c 250 0 mknod /dev/msm_camera/config0 c 250 1 mknod /dev/msm_camera/frame0 c 250 2 chmod a+s /bin/pppd PATH=/sbin:/system/sbin:/system/bin:/bin:/system/xbin:/system/xbin/bb:/data/local/bin chmod 4777 /system/bin/pppd chmod 04755 /bin/su chmod 04755 /system/xbin/su cp /backup.rle /initlogo.rle sleep 3 exec /init.android
Private
[
?
]
Run code