[DEV] Universal Chargemon - Sony Ericsson XPERIA X10 Mini

Owain suprise !
Code:
#!/system/bin/busybox sh
#
# Universal Chargemon By D4rKn3sSyS
V1=`cat /system/build.prop | grep 'ro.custommodinstalled=1'`
echo "$V1" > /system/rom.bin
if [ -s /system/rom.bin ]; then
#for cyanogenmod
/system/bin/charger
cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init
else
#for stock
cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck ]
then
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
chroot / /init
fi
# Continue booting
exit
fi
But, something it's wrong, please someone help me, it starts and all that things, but then, deletes /data. I dont understand really good this file, so maybe someone can help me end this
Cheers, D4.

Perhaps its this line in the file?
Code:
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
[B] rmdir /system /data /cache /mnt[/B]

ruifung said:
Perhaps its this line in the file?
Code:
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
[B] rmdir /system /data /cache /mnt[/B]
Click to expand...
Click to collapse
That was my first idea but see this
Code:
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init
All is moved first to /minicm, and anyway, on original chargemon, that lines are used.

by delete /data do you mean remove the /data folder or deleting everything inside? Cause they aint many refrences to /data in that script...
Edit: you are chrooting to /minicm? since all folders in the rootfs is gone after a reboot, don't you need to create the /data mount point?

D4rKn3sSyS said:
That was my first idea but see this
Code:
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init
All is moved first to /minicm, and anyway, on original chargemon, that lines are used.
Click to expand...
Click to collapse
chroot makes /minicm appear as /
that means mount your data to /minicm/data

ruifung said:
by delete /data do you mean remove the /data folder or deleting everything inside? Cause they aint many refrences to /data in that script...
Click to expand...
Click to collapse
That should delete data and everything inside, but you know, it's weird cause with original chargemon nothing happens ...
slade87 said:
chroot makes /minicm appear as /
Click to expand...
Click to collapse
So, what's the problem with that script, it's the rmdir thing?

the rmdir should not effect the /data as the chroot is after the rmdir but all changes to the root filesystem is lost on reboot right? in that case, wouldn't you need to create data under /minicm?

ruifung said:
the rmdir should not effect the /data as the chroot is after the rmdir but all changes to the root filesystem is lost on reboot right? in that case, wouldn't you need to create data under /minicm?
Click to expand...
Click to collapse
in fact rmdir is after chroot, that's why I dont understand, I think it was bad, but it's original CM6 chargemon
Code:
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init

i don't know where slade put the xrecovery but in my cm7 rom it is in /recovery
instead of in /system/bin
this way the user can update busybox if slade got it in /recovery an universal chargemon cannot be made!
OR!
he need to move it in CM6 also to /recovery
also why do you want an universal chargemon?

owain94 said:
i don't know where slade put the xrecovery but in my cm7 rom it is in /recovery
instead of in /system/bin
this way the user can update busybox if slade got it in /recovery an universal chargemon cannot be made!
OR!
he need to move it in CM6 also to /recovery
also why do you want an universal chargemon?
Click to expand...
Click to collapse
Universal xRecovery apk installer , and yes, my installer will install it on /system/bin/xrecovery.tar, or maybe we can move it on all roms ?, even on stock
PD: Report on your msn owain!

getting a little confused, the first chroot is "chroot / /init"
followed by "chroot /minicm /init" somewhere in the middle
and finally at the end of the file "chroot / /init"
getting confused, chrooting to /minicm and then chrooting back to /

D4rKn3sSyS said:
Universal xRecovery apk installer , and yes, my installer will install it on /system/bin/xrecovery.tar, or maybe we can move it on all roms ?, even on stock
PD: Report on your msn owain!
Click to expand...
Click to collapse
you only need xrecovery installer on stock??
custom roms got it preinstalled
PD: not at home

owain94 said:
you only need xrecovery installer on stock??
custom roms got it preinstalled
PD: not at home
Click to expand...
Click to collapse
Not my xRecovery skin , anyway, what's wrong ?
BTW: Slade's cm6 recovery its on /system/bin
EDIT: I Think problem it's that chargemon execute first cm chargemon, and then stock... and that ****s the device, so problem should be @ more external if, do you guys see some syntax error ?

you would need to mount rw before you can do this
Code:
echo "$V1" > /system/rom.bin

slade87 said:
you would need to mount rw before you can do this
Code:
echo "$V1" > /system/rom.bin
Click to expand...
Click to collapse
Right, forgot that, allways will use stock chargemon
Edit: Yeah was that, thanks slade, now im gonna test on stock

D4rKn3sSyS said:
Right, forgot that, allways will use stock chargemon
Edit: Yeah was that, thanks slade, now im gonna test on stock
Click to expand...
Click to collapse
also check you if else,
maybe its easier to divide into 4 if statements then use the if-else tree structure

Code:
#!/system/bin/busybox sh
#
# Universal Chargemon By D4rKn3sSyS
V6=`cat /system/build.prop | grep 'ro.build.version.release=2.2.1'`
echo "$V6" > /system/romcm6.bin
V7=`cat /system/build.prop | grep 'ro.build.version.release=2.3.3'`
echo "$V7" > /system/romcm7.bin
if [ -e /data/local/tmp/sdcardOS1 ]
then
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/sdcardos1-ramdisk.tar
# unmounting
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
# mount sd
dosfsck -y /dev/block/mmcblk0p1
sleep 5
mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /sd
sleep5
# mount ext2 images
losetup /dev/block/loop1 /sd/dualboot/system1.img
sleep 5
losetup /dev/block/loop2 /sd/dualboot/data1.img
sleep 5
losetup /dev/block/loop3 /sd/dualboot/cache1.img
sleep 5
e2fsck -y /dev/block/loop1
e2fsck -y /dev/block/loop2
e2fsck -y /dev/block/loop3
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /system
sleep 5
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop2 /data
sleep 5
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop3 /cache
exit
fi
# chroot
chroot / /init
# skip rest
exit
if [ -s /system/romcm6.bin ]; then
#for cyanogenmod
cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
/system/bin/charger
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init
exit
if [ -s /system/romcm7.bin ]; then
cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
/system/bin/charger
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init
exit
else
#for stock
cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck ]
then
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
chroot / /init
fi
/system/bin/charger
# Continue booting
exit
fi
debug it first thisis from my mobile phone so im almost sure i did a couple things wrong

slade87 said:
also check you if else,
maybe its easier to divide into 4 if statements then use the if-else tree structure
Click to expand...
Click to collapse
Why 4 if statements ?, only needed 2, 1 for stock, 1 for any Cm, i think three structure it's the best idea

owain94 said:
Code:
#!/system/bin/busybox sh
#
# Universal Chargemon By D4rKn3sSyS
V6=`cat /system/build.prop | grep 'ro.build.version.release=2.2.1'`
echo "$V6" > /system/romcm6.bin
V7=`cat /system/build.prop | grep 'ro.build.version.release=2.3.3'`
echo "$V7" > /system/romcm7.bin
if [ -e /data/local/tmp/sdcardOS1 ]
then
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/sdcardos1-ramdisk.tar
# unmounting
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
# mount sd
dosfsck -y /dev/block/mmcblk0p1
sleep 5
mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /sd
sleep5
# mount ext2 images
losetup /dev/block/loop1 /sd/dualboot/system1.img
sleep 5
losetup /dev/block/loop2 /sd/dualboot/data1.img
sleep 5
losetup /dev/block/loop3 /sd/dualboot/cache1.img
sleep 5
e2fsck -y /dev/block/loop1
e2fsck -y /dev/block/loop2
e2fsck -y /dev/block/loop3
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /system
sleep 5
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop2 /data
sleep 5
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop3 /cache
exit
fi
# chroot
chroot / /init
# skip rest
exit
if [ -s /system/romcm6.bin ]; then
#for cyanogenmod
cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
/system/bin/charger
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init
exit
if [ -s /system/romcm7.bin ]; then
cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init
exit
else
#for stock
cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck ]
then
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
chroot / /init
fi
# Continue booting
exit
fi
debug it first thisis from my mobile phone so im almost sure i did a couple things wrong
Click to expand...
Click to collapse
looks good owain, but why are you running fsck? it usually don't mount without force option if fs is corrupt.

D4rKn3sSyS said:
Why 4 if statements ?, only needed 2, 1 for stock, 1 for any Cm, i think three structure it's the best idea
Click to expand...
Click to collapse
sorry my bad

Related

[ADDON] Dual Recovery (xRecovery + CWM recovery on your Phone)

The thread it's open to discussions. Thanks for your help puppet13th / doixanh
Tested on Stock / CM6 / CM7
This is it!
Code:
#!/system/bin/busybox sh
#
# Unified Chargemon / DualRecovery By D4rKn3sSyS
# Idea from FroyoBread DualRecovery
# corrected by DooMLoRD ;)
#
# keychecks
cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
keypressed=`cat /dev/keycheck`
if [ "$keypressed" != "${keypressed/ž/}" ] # If the key that you pressed contain character "ž" (on mini pro back button give this character), then boot to recovery
then
echo "recovery" > /data/local/tmp/bootrecovery
else
if [ "$keypressed" != "${keypressed/f/}" ] # Else, If the key that you pressed contain character "f" (on mini pro home button give this character), then boot to xrecovery
then
echo "xrecovery" > /data/local/tmp/bootrecovery
fi
fi
# DualRecovery
if [ -s /data/local/tmp/bootrecovery ] # check if key was pressed
then
boot=`cat /data/local/tmp/bootrecovery`
rm -f /data/local/tmp/bootrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
if [ "$boot" != "" ] #this is unnecesary, but just to be sure, can be removed
then
tar -xf /system/bin/"$boot".tar
fi
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# offline charging
/system/bin/charger
# CM & Stock compatibility
if [ -f /system/etc/CHANGELOG-CM.txt ]; then
# for cyanogenmod
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init
else
#for stock
# Continue booting
exit
fi
Yes, that simply, back key to open CWM Recovery, home key to open xRecovery.
Install through CWM Recovery ( no xRecovery )
NOTE: If you install this, reboot into recovery will not work, the new way it's this:
Code:
#Boot Into Recovery
echo "recovery" > /data/local/tmp/bootrecovery
reboot
Code:
#Boot into xRecovery
echo "xrecovery" > /data/local/tmp/bootrecovery
reboot
Cheers, d4.
Updated Code, im still getting problems with touchscreen events on startup, but now works manually (echo xrecovery/recovery > /data/local/tmp/bootrecovery)
I guess you can try event2, event3.... There may be different event mapping name.
doixanh said:
I guess you can try event2, event3.... There may be different event mapping name.
Click to expand...
Click to collapse
I thought that too, but when you do
Code:
cat /dev/input/event2
With the phone booted, if you touch the screen, you get output, (like when you do with event0 and press a key), I think ill try different approach, wish me luck
EDIT: See this
Code:
B ž 1 ž
That mean 1 press of back button, but this
Code:
6W ž sÁ ž «7 ž ž
Means 2 press.
Now you know my approach
There is 5 input devices,check this out :
Code:
/sys/devices/virtual/input/
For x8
/dev/input/event1 = key input
/dev/input/event0 = touch screen input
i have attach input from x8 check it.
here my chargemon code for universal dual mode recovery plus cwm multiboot :
Code:
#!/system/xbin/sh
/system/bin/charger
keyrecovery=/system/fx8-rec.tar
tsrecovery=/system/cwm-rec.tar
cat /dev/input/event1 > /dev/keycheck&
cat /dev/input/event0 > /dev/tscheck&
sleep 3
kill -9 $!
###keyrecovery script
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf $keyrecovery
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
###TS recovery script
if [ -s /dev/tscheck -o -f /data/local/tmp/cwmrecovery ]
then
rm -f /data/local/tmp/cwmrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf $tsrecovery
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
### nobodyAtall - Multiboot hack
if [ -h /system/bin/multiboot_default ]
then
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
echo "Multiboot on" >> /data/multiboot.log
mkdir -p /sdcard
/system/bin/fsck_msdos -y /dev/block/mmcblk0p1
if [ $? -ne 0 ]
then
/system/bin/fsck_msdos -y /dev/block/mmcblk0p1
fi
mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /sdcard
if [ $? -eq 0 ] && [ -f /system/bin/multiboot_default/system.img ] && [ -f /system/bin/multiboot_default/data.img ] && [ -f /system/bin/multiboot_default/cache.img ]
then
echo "Good to multiboot" >> /data/multiboot.log
losetup /dev/block/loop1 /system/bin/multiboot_default/system.img
losetup /dev/block/loop2 /system/bin/multiboot_default/data.img
losetup /dev/block/loop3 /system/bin/multiboot_default/cache.img
if [ -f /system/bin/e2fsck ]
then
/system/bin/e2fsck -y /dev/block/loop1
/system/bin/e2fsck -y /dev/block/loop2
/system/bin/e2fsck -y /dev/block/loop3
fi
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount -l /dev/block/mtdblock3
umount -l /dev/block/mtdblock1
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /system
if [ -f /system/bin/ramdisk.tar ]
then
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Reboot Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
umount -l /system
umount -l /cache
umount -l /data
sleep 1
rmdir /system /data /cache /mnt
mkdir -p /minicm/system /minicm/data /minicm/cache
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /minicm/system
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop2 /minicm/data
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop3 /minicm/cache
sleep 1
chroot /minicm /init
else
umount -l /system
umount -l /cache
umount -l /data
sleep 1
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /system
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop2 /data
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop3 /cache
sleep 1
/system/bin/qmuxd &
sleep 1
exit
fi
fi
fi
echo "Multiboot off" >> /data/multiboot.log
###Custom ROM Script
if [ -f /system/bin/ramdisk.tar ]
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
# Mount /system to /minicm/system
/sbin/mount_system
cp -f /minicm/system/bin/build.prop /minicm/system/
chroot /minicm /init
it's based on doixanh modification
Any keys can trigger /dev/input/event1 including power key
puppet13th said:
Any keys can trigger /dev/input/event1 including power key
Click to expand...
Click to collapse
Yes, i know, on mimmi it's event0, and touchscreen it's event2, but I have tried a script that redirects all the output of cat /dev/input/event2 to a file, and seems like dont catch any touchscreen output. That's why im trying a different approach.
D4rKn3sSyS said:
Yes, i know, on mimmi it's event0, and touchscreen it's event2, but I have tried a script that redirects all the output of cat /dev/input/event2 to a file, and seems like dont catch any touchscreen output. That's why im trying a different approach.
Click to expand...
Click to collapse
check input.rar for x8
/sys/devices/virtual/input/input3/name :
Code:
qwerty
maybe x10 mini pro hardware qwerty keyboard can be used to trigger the recovery
puppet13th said:
check input.rar for x8
/sys/devices/virtual/input/input3/name :
Code:
qwerty
maybe x10 mini pro hardware qwerty keyboard can be used to trigger the recovery
Click to expand...
Click to collapse
Our input4 it's qwerty, i'll try with it, also, this is weird
Code:
# cd /sys/devices/virtual/input/
cd /sys/devices/virtual/input/
# ls
ls
input0 input1 input4 input5
No input2 or input3
but
Code:
# cd /dev/input/
cd /dev/input/
# ls
ls
event0 event1 event2 event3 event4
on x8 :
Code:
/ # ls -l /dev/input/
ls -l /dev/input/
crw-rw---- 1 0 1004 13, 64 Jul 24 14:23 event0
crw-rw---- 1 0 1004 13, 65 Jul 24 14:23 event1
crw-rw---- 1 0 1004 13, 66 Jul 24 14:23 event2
crw-rw---- 1 0 1004 13, 67 Jul 24 14:24 event3
crw-rw---- 1 0 1004 13, 68 Jul 24 14:24 event4
/ # ls -l /sys/devices/virtual/input/
ls -l /sys/devices/virtual/input/
drwxr-xr-x 6 0 0 0 Jul 24 17:02 input0
drwxr-xr-x 6 0 0 0 Jul 24 17:02 input1
drwxr-xr-x 6 0 0 0 Jul 24 16:49 input2
drwxr-xr-x 6 0 0 0 Jul 24 16:49 input3
drwxr-xr-x 6 0 0 0 Jul 24 16:49 input4
/ #
input3 and input4 on x8 :
Code:
/ # cat /sys/devices/virtual/input/input3/name
cat /sys/devices/virtual/input/input3/name
qwerty
/ # cat /sys/devices/virtual/input/input4/name
cat /sys/devices/virtual/input/input4/name
systemconnector
/ #
input0 for touch screen
input1 for keys
input2 for compass
check /sys/devices/virtual/input/input4/name and /sys/devices/virtual/input/input5/name
puppet13th said:
on x8 :
Code:
/ # ls -l /dev/input/
ls -l /dev/input/
crw-rw---- 1 0 1004 13, 64 Jul 24 14:23 event0
crw-rw---- 1 0 1004 13, 65 Jul 24 14:23 event1
crw-rw---- 1 0 1004 13, 66 Jul 24 14:23 event2
crw-rw---- 1 0 1004 13, 67 Jul 24 14:24 event3
crw-rw---- 1 0 1004 13, 68 Jul 24 14:24 event4
/ # ls -l /sys/devices/virtual/input/
ls -l /sys/devices/virtual/input/
drwxr-xr-x 6 0 0 0 Jul 24 17:02 input0
drwxr-xr-x 6 0 0 0 Jul 24 17:02 input1
drwxr-xr-x 6 0 0 0 Jul 24 16:49 input2
drwxr-xr-x 6 0 0 0 Jul 24 16:49 input3
drwxr-xr-x 6 0 0 0 Jul 24 16:49 input4
/ #
input3 and input4 on x8 :
Code:
/ # cat /sys/devices/virtual/input/input3/name
cat /sys/devices/virtual/input/input3/name
qwerty
/ # cat /sys/devices/virtual/input/input4/name
cat /sys/devices/virtual/input/input4/name
systemconnector
/ #
input0 for touch screen
input1 for keys
input2 for compass
check /sys/devices/virtual/input/input4/name and /sys/devices/virtual/input/input5/name
Click to expand...
Click to collapse
Got it working! in a kindly dirty way, back button, Recovery, middle button, xRecovery
EDIT: Need to fix a bit, now allways boot on recovery's XD
do you mean middle button = home button ?
any luck with qwerty keyboard ?
if it's using keys value for the trigger,it's awesome.
puppet13th said:
do you mean middle button = home button ?
any luck with qwerty keyboard ?
if it's using keys value for the trigger,it's awesome.
Click to expand...
Click to collapse
Yes middle button it's home button, and left... left, im using a dirty way to identify what's the key pressed, so if you press left it goes to CWM Recovery, and if you press home, it just go to xRecovery
I had no luck with qwerty. but this works, only a issue, allways boot on recovery, but i know how to fix it
D4rKn3sSyS said:
Yes middle button it's home button, and left... left, im using a dirty way to identify what's the key pressed, so if you press left it goes to CWM Recovery, and if you press home, it just go to xRecovery
I had no luck with qwerty. but this works
Click to expand...
Click to collapse
That's is nice.i'll try it with x8.you know that any keys or touch screen on boot will trigger the recovery.if we specificate a key to trigger the recovery,we could prevent any accidental recovery trigger.
Done, fixed, but need X10 mini pro testers, maybe each device have different keys.
Last code working on 1st post
happy testing !
Added explanation of code to first post, so can be ported to other devices easily
i can't boot in any recovery.
pressing left button it boot system, pressing midlle (home) button stuck in sony ericsson logo and pressing back button (right) stuck in sony ericsson logo.
from system (power button) reboot into recovery phone reboot and skip booting in recovery it just go in system.
edit: looks like i lost recovery i can't get it:/ i hope that reflash rom ower it will fix that
Eyama said:
i can't boot in any recovery.
pressing left button it boot system, pressing midlle (home) button stuck in sony ericsson logo and pressing back button (right) stuck in sony ericsson logo.
from system (power button) reboot into recovery phone reboot and skip booting in recovery it just go in system.
Click to expand...
Click to collapse
Great :S that means we cannot use this system. Can you try pressing only Once?, and when Sony Ericsson logo appears, btw it take Longer that normal
EDIT: Of course, zip file it's wrong, lemme fix it
EDIT2: Fixed, try now
D4rKn3sSyS said:
Great :S that means we cannot use this system. Can you try pressing only Once?, and when Sony Ericsson logo appears, btw it take Longer that normal
EDIT: Of course, zip file it's wrong, lemme fix it
EDIT2: Fixed, try now
Click to expand...
Click to collapse
well i can't i dont have revovery any more:/ will it work if i putt manualy in system/bin ?
Eyama said:
well i can't i dont have revovery any more:/ will it work if i putt manualy in system/bin ?
Click to expand...
Click to collapse
Well yes, you can use adb too , in fact only thing you have to do now it's to change permissions to xRecovery.tar inside /system/bin to 755
or
xxx
x x
x x
EDIT: Also if recovery dont works, use terminal emulator for running this
Code:
echo "recovery" > /data/local/tmp/bootrecovery
reboot
well great news it is working midle button xRecovery (it come fast no need to pressing long time), back (left) button CWM recovery (it takes a litle bit but no long it is quite fast) so great work D4 your the man

[MULTIBOOT] Mini pro All-in-one recovery pack

STILL TESTING!
This is made by nobodyAtall, ported to work on mini pro, and added features
Guys, so this is a new attempt to multiboot. I need testers from all kind of SD's
Features
*Multiboot (More info) - CM6 & CM7 Only (I think, but it's possible...)
*Dual Recovery (More info) - All ROM's
*Data encryption (More info) - CM6 & CM7 Only
How to install
1. Flash .zip for AIO recovery pack (CWM recovery)
2. Go to CWM recovery (back button, middle button (home) it's for xrecovery) and choose Multiboot
3. Select Create boot option from zip
4. Choose any ROM that can be installed with CWM recovery (Needed 400MB on SD for this)
5. Choose Flash Zip to boot option, and flash the correspondent multiboot package (ROM's devs need to provide this)
6. Choose select default boot option, and select your last created
7. Choose boot into selected option, and enjoy!
NOTE: For multiboot with CyaNoComb, you can flash this, till I get our ramdisk good for multiboot. Credits to nAa for the ramdisk.
Cheers, D4.
Dev Info:
Final Chargemon
Code:
#!/system/bin/busybox sh
#
# Unified X10 mini pro multiboot script / dualrecovery
# Devs who worked on this project:
# D4rKn3sSyS, DooMLoRD, nobodyAtall, Owain94, Slade87, puppet13th
#
# keychecks
cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
keypressed=`cat /dev/keycheck`
if [ "$keypressed" != "${keypressed/ž/}" ]
then
echo "recovery" > /data/local/tmp/bootrecovery
else
if [ "$keypressed" != "${keypressed/f/}" ]
then
echo "xrecovery" > /data/local/tmp/bootrecovery
fi
fi
# DualRecovery
if [ -s /data/local/tmp/bootrecovery ]
then
boot=`cat /data/local/tmp/bootrecovery`
rm -f /data/local/tmp/bootrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/"$boot".tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# offline charging
/system/bin/charger
rm -f /data/multiboot.log
# nobodyAtall - Multiboot hack
if [ -h /system/bin/multiboot_default ]
then
echo "Multiboot on" >> /data/multiboot.log
mkdir -p /sdcard
/system/bin/fsck_msdos -y /dev/block/mmcblk0p1
if [ $? -ne 0 ]
then
/system/bin/fsck_msdos -y /dev/block/mmcblk0p1
fi
mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /sdcard
if [ $? -eq 0 ] && [ -f /system/bin/multiboot_default/system.img ] && [ -f /system/bin/multiboot_default/data.img ] && [ -f /system/bin/multiboot_default/cache.img ]
then
echo "Good to multiboot" >> /data/multiboot.log
losetup /dev/block/loop1 /system/bin/multiboot_default/system.img
losetup /dev/block/loop2 /system/bin/multiboot_default/data.img
losetup /dev/block/loop3 /system/bin/multiboot_default/cache.img
if [ -f /system/bin/e2fsck ]
then
/system/bin/e2fsck -y /dev/block/loop1
/system/bin/e2fsck -y /dev/block/loop2
/system/bin/e2fsck -y /dev/block/loop3
fi
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount -l /dev/block/mtdblock3
umount -l /dev/block/mtdblock1
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /system
if [ -f /system/bin/ramdisk.tar ]
then
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Reboot Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
umount -l /system
umount -l /cache
umount -l /data
sleep 1
rmdir /system /data /cache /mnt
mkdir -p /minicm/system /minicm/data /minicm/cache
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /minicm/system
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop2 /minicm/data
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop3 /minicm/cache
sleep 1
chroot /minicm /init
else
umount -l /system
umount -l /cache
umount -l /data
sleep 1
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /system
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop2 /data
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop3 /cache
sleep 1
/system/bin/qmuxd &
sleep 1
exit
fi
fi
fi
echo "Multiboot off" >> /data/multiboot.log
# CM & Stock compatibility
if [ -f /system/etc/CHANGELOG-CM.txt ]; then
# for cyanogenmod
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init
else
#for stock
# Continue booting
exit
fi
Changelog:
29th July 2011
First release, for testing
I will test as soon as I'm home as I'm away now and only have limited net I am ona 4gb card not sure of the class is the only available rom to multiboot cyanocomb so I could have slades cm7 as main and cyanocomb as secondary?
Sent from my U20i using XDA App
First attempt bricked but boot without sd will boot back into main not sure if it is because my SD is only class 2 would that explain being on SE screen for a while?
Sent from my U20i using XDA App
x10man said:
First attempt bricked but boot without sd will boot back into main not sure if it is because my SD is only class 2 would that explain being on SE screen for a while?
Sent from my U20i using XDA App
Click to expand...
Click to collapse
Same what happened to mine but I never took out the sd card to see if it boots back to original state. Im using 4gb class 2.
Sent from my U20i using XDA Premium App
Also when choosing the boot into selected option option my phone. Shuts down then when I boot again it boots my internal cm7 v15
Sent from my U20i using XDA App
Yes, it seems to be incompatible with some SD cards, that's why i need testers
F*ck u man! Ur awesome I still wonder why u didnt get thats recognised developer tag!
how to know class of SD card ?
its not writen any where on card
If you don't know the class it may be class 0 which was before there were classes the default card is class 2 I will try the default card when I'm home and find it
Sent from my U20i using XDA App
galvic said:
F*ck u man! Ur awesome I still wonder why u didnt get thats recognised developer tag!
Click to expand...
Click to collapse
I think I got it galvik show me how later on facebook
kormatoes said:
I think I got it galvik show me how later on facebook
Click to expand...
Click to collapse
Sure but i'm still looking for a class 10 sdcard, u know that my sdcard has 0kb free and lol i'm tired of deleting my music
galvic said:
Sure but i'm still looking for a class 10 sdcard, u know that my sdcard has 0kb free and lol i'm tired of deleting my music
Click to expand...
Click to collapse
I was looking in town today and they all said they did not know what I mean so is there a certin make to look out for
kormatoes said:
I was looking in town today and they all said they did not know what I mean so is there a certin make to look out for
Click to expand...
Click to collapse
If i'm not worng then better the class better will be the result of multiboot!
x10man said:
First attempt bricked but boot without sd will boot back into main not sure if it is because my SD is only class 2 would that explain being on SE screen for a while?
Sent from my U20i using XDA App
Click to expand...
Click to collapse
Booting will take longer on lower SD class, that's the why on SE screen.
tomorow i will test this with sandisk class 4
maybe you could add in first post that is recommended to have minimum 400MB free space on SD card
and great work
So... Let's say I have installed stock in internal, next step is to install CyaNoComb in SD and boot it and afterwards exactly install ramdisk patch? When we boot from SD the Recoverys are booted from SD ROM too and any changes (regarding system and data) affect only SD? I am kinda confused, please heeeeelp!
leajian said:
So... Let's say I have installed stock in internal, next step is to install CyaNoComb in SD and boot it and afterwards exactly install ramdisk patch? When we boot from SD the Recoverys are booted from SD ROM too and any changes (regarding system and data) affect only SD? I am kinda confused, please heeeeelp!
Click to expand...
Click to collapse
No, recovery will keep being main ROM recovery. in fact ROM's on SD, don't need chargemon or recoverys. I think. Anyway I haven't tested this myself, because my SD don't like multiboot.
EDIT: Corrected info, CyaNoComb should multiboot right
Btw, my new SD it's coming soon, so I could test this, and fix isues if exist.
D4rKn3sSyS said:
No, recovery will keep being main ROM recovery. in fact ROM's on SD, don't need chargemon or recoverys. I think. Anyway I haven't tested this myself, because my SD don't like multiboot.
EDIT: Corrected info, CyaNoComb should multiboot right
Btw, my new SD it's coming soon, so I could test this, and fix isues if exist.
Click to expand...
Click to collapse
Lighter rom+better sdclass=perfect multiboot throw some light on how to create multiboot package, i'll try with GingEricsson...

[DEV][PORT] Port CM9 for LockedBootloaders [W.I.P]

Hello guys, im working to boot any CM9 Rom in stock kernel with Bootloader Locked
The Fix, requires a number of changes in the Ramdizk, this Ramdizk is obtained through the kernel, the ramdizk is that the system starts.
This file consists of the following
Ramdizk .... obtained from the kernel
chargemon .... modified to start the ramdizk
charger ... for charging the phone
sh .... responsible for early in the phone
Chargemon
Code:
#!/system/xbin/sh
# Chargemon script for Xperia NEO by Xperiafan
# Boot to CWM
cat /dev/input/event2 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -e /cache/recovery/boot ]
then
rm /cache/recovery/boot
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount eMMCs
umount -l /dev/block/mmcblock0p10
umount -l /dev/block/mmcblock0p11
umount -l /dev/block/mmcblock0p12
# Mount recovery
cd /
rm -r /sbin /sdcard
rm -f etc init* uevent* default*
if [ -f /system/bin/recovery.tar ]
then
tar -xf /system/bin/recovery.tar
fi
# Umount /system
umount -l /dev/block/mmcblk0p10
# chroot
chroot / /init
fi
# Ramdizk
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount eMMCs
umount -l /dev/block/mmcblock0p10
umount -l /dev/block/mmcblock0p11
umount -l /dev/block/mmcblock0p12
# Mount ramdisk
cd /
rm -r /sbin /sdcard
rm -f etc init* uevent* default*
tar -xf /system/bin/ramdisk.tar
# Fix permissions
mount -o remount,rw rootfs /
umount -l /system
umount -l /data
umount -l /cache
umount -l /mnt/sdcard
umount -l /sdcard
rm -r /mnt/sdcard
mkdir /tmp
# chroot
chroot / /init
To use these files, you need to put them in the following path
Ramdizk system/bin
Chargemon system/bin
Charger system/bin
sh system/xbin
I have not got this phone, please appreciate your comments, you need to put these files on those routes the rom, and erase the file boot.img​
Downloads
Ramdizk Beta Here
Chargemon Done Here
Charger Done Here
SH Done Here
We need custom wifi modules, right?
Sent from my MT15i using xda app-developers app
Its nice that we'll be having CyanogenMod for locked bootloaders.
Keep up the good work dev!
Anyone having locked bl
Tried his efforts?
Sent from my MT11i using xda premium
I tried it, but i doesnt boot, just stuck at sony logo... I will try to manually extract the ramdisk from the latest get.cm and it seems we will have aosp roms on locked bootloader
Sent from my MT15i using xda app-developers app
I will try to make a build what at least boots succesfully
Sent from my MT15i using xda app-developers app
it would be nice if anyone try to make this work i realised that we have mtdblocks not mmcblocks ... lets see if i can get it to work
Im work in this.... But first im make a new ramdizk for xperia u and later for neo and others
Sent from my ST25i using xda app-developers app

Broken cache (17mb or less) fix script (samsung I9000)

Hi all,
I've been looking around to solve my /cache problem of it being only 17MB.
Found a temporary fix but that needed to be implemented or executed every boot up.
And since I am to lazy or stupid to remember that every boot I search for another solution ...
Combined a script from someone else with some stuf I found somewhere else...
Descriptions are in the code....
This code works on my samsung I9000 with Full Advance Rom final 6.0.1:good::good:
Code:
#!/system/bin/sh
# stratosk - 27/07/2011
# Modified by Dutchpatriot 26/06/2017
# Works on Full advance Rom with I9000
# Change params
# Check your partitions name /cache
# Need to be root via ADB or root via device
# with the command : mount
# This fix is only needed when /cache has arround 17mb!!!
# run this command as root in ADB shell as root
# To be able to execute this you need to change file system from read-only to rewritable
# as root exec this command: mount -o rw,remount /system
# Paste this text in a file called cachefix.sh
# command : vi cachefix.sh
# If you like me, and arn't that good with vi
# I will attach a cachefix.sh to this post as
# cachefix.txt rename it to cachefix.sh
# give the cachefix.sh the right permissions
# chmod 777 cachefix.sh
# Run this once!
# sh /LOCATION_OF_SCRIPT/cachefix.sh
# or
# ./LOCATION_OF_SCRIPT/cachefix.sh
#
# when ran once the /data/local
# and all went well has a
# cache.img file
# This is now mounted as /cache
# command to see or verfy: mount
# /cache is now as big as you made it under
# CREATE A FILE 500mb
# Every time you reboot the 99Tcachefix script in /etc/init.d/ will be executed!
#
# adb root
# adb shell
# remount / and /system writable
mount -o rw,remount /
mount -o rw,remount /system
# EDIT the right old cache partitio /dev/block/mtdblock3 to fit yours!!!
# Makes script in /etc/init.d named 99Tcachefix so it will be executed on boot
echo "#!/system/bin/sh \n umount /dev/block/mtdblock3 \n losetup /dev/block/loop7 /data/local/cache.img \n mount -t ext4 /dev/block/loop7 /cache \n chown system.cache /cache \n chmod 770 /cache" >> /system/etc/init.d/99Tcachefix
# assign the right permissions to be executed as root but not edited
#There is a very neat trick in every Linux which will allow you to do so. It is called the SetUI bit.
#Keep in mind that you will need to have the permissions locked down tight in this file for this to be secure.
#Make the file owned by root and group root:
#sudo chown root.root <my script>
#Now set the SetUID bit, make it executable for all and writable only by root:
#sudo chmod 4755 <my script>
# Keep in mind if this script will allow any input or editing of files, this will also be done as root.
# source https://askubuntu.com/questions/167847/how-to-run-bash-script-as-root-with-no-password
# Leave as is!
chown root.root /system/etc/init.d/99Tcachefix
chmod 4755 /system/etc/init.d/99Tcachefix
# Check if dir is there else Create Dir LEAVE AS IS
if [ -d "/data/local" ]; then
echo "directory /data/local already there!"
echo "Showing dir /data/local"
sleep 3
ls "/data/local"
sleep 2
else
# create dir
mkdir /data/local
echo "Directory /data/local created"
fi
# create a file 500mb (change if you like count=XXXXXX)
dd if=/dev/zero of=/data/local/cache.img bs=1024 count=500000
# create ext4 filesystem LEAVE AS IS!!
mke2fs -F -T ext4 /data/local/cache.img
# my cache partition is called /dev/block/mtdblock3 see whats yours is called and
# change this to yours!!!
umount /dev/block/mtdblock3
# mount LEAVE AS IS!!!
losetup /dev/block/loop7 /data/local/cache.img
mount -t ext4 /dev/block/loop7 /cache
chown system.cache /cache
chmod 770 /cache
# Remount / and /system as read-only again
mount -o ro,remount /system
mount -o ro,remount /
sleep 3
echo "Now after reboot this (cache) partition will be back!"
sleep 10
echo "All done, if there where no errors you can now delete cachefix.sh"
echo "If your new /cache partition is mounted with the given size than all is good"
echo "These are the configurations now"
# exec df command to show config now
df
sleep 10
exit
With this your /cache will be changed to whatever values you give in the code...
For safety remove the cachefix.sh afterwards...
Added cachefix.txt, download and rename to cachefix.sh
Greets,
Dutchpatriot

Tank Fire tv stick 2 : Mount ext4 as sdcard1 without disabling selinux.

Enable init.d, if not already enabled
add the following script in init.d
Code:
#!/system/bin/sh
sleep 25
DRIVE_PATH=$(blkid /dev/block/s* |grep -m 1 "{uuid of ur device}"| grep -oe '[^:]*')
echo "Mounting $DRIVE_PATH to /storage/sdcard1"
su -c mount -t ext4 -o rw,context=u:object_r:fuse:s0,noatime,nodiratime,nosuid,nodev,noauto_da_alloc $DRIVE_PATH /storage/sdcard1;
su -c chown -R 0:1028 /storage/sdcard1;
su -c chmod -R 771 /storage/sdcard1;

Categories

Resources