[HOWTO][Xperia P]save some space on sdcard via init.d script - Sony Xperia P, U, Sola, Go

i dont have many apps on my phone and need the space on sdcard for photos and videos....
so i made an init.d script to move some big folders (games) from sdcard to /data/ and /system/ partition because there is much space left.
Code:
busybox mkdir -p /sdcard/Android/obb/com.nextgenreality.minimoto
busybox mkdir -p /data/Android/obb/com.nextgenreality.minimoto
mount -o bind /data/Android/obb/com.nextgenreality.minimoto /sdcard/Android/obb/com.nextgenreality.minimoto
busybox mkdir -p /sdcard/Navigon
busybox mkdir -p /data/Navigon
mount -o bind /data/Navigon /sdcard/Navigon
rm -r /sdcard/Android/data/com.eamobile.sims3_row_qwf
busybox mkdir -p /sdcard/Android/data/com.eamobile.sims3_row_qwf
busybox mkdir -p /data/Android/data/com.eamobile.sims3_row_qwf
mount -o bind /data/Android/data/com.eamobile.sims3_row_qwf /sdcard/Android/data/com.eamobile.sims3_row_qwf
rm -r /sdcard/Android/data/com.eamobile.nfshp_row_wf
busybox mkdir -p /sdcard/Android/data/com.eamobile.nfshp_row_wf
busybox mkdir -p /system/Android/data/com.eamobile.nfshp_row_wf
mount -o bind /system/Android/data/com.eamobile.nfshp_row_wf /sdcard/Android/data/com.eamobile.nfshp_row_wf
after a reboot i have moved around 1gb to data and 320mb to system ->
Code:
Filesystem Size Used Free Blksize
/dev 386.3M 64.0K 386.3M 4096
/mnt/asec 386.3M 0.0K 386.3M 4096
/mnt/obb 386.3M 0.0K 386.3M 4096
/dev/shm 386.3M 0.0K 386.3M 4096
/system 1007.9M 891.6M 116.3M 4096
/modemfs 2.8M 1.1M 1.7M 1024
/data 2.0G 1.7G 269.0M 4096
/cache 246.1M 4.2M 241.8M 4096
/mnt/sdcard 11.3G 5.1G 6.1G 32768
/mnt/secure/asec 11.3G 5.1G 6.1G 32768
/mnt/sdcard/Android/obb/com.nextgenreality.minimoto 2.0G 1.7G 269.0M 4096
/mnt/sdcard/Navigon 2.0G 1.7G 269.0M 4096
/mnt/sdcard/Android/data/com.eamobile.sims3_row_qwf 2.0G 1.7G 269.0M 4096
/mnt/sdcard/Android/data/com.eamobile.nfshp_row_wf 1007.9M 891.6M 116.3M 4096
be aware that these data are lost if you reflash your rom !!!
have fun
inteks
[edit]
to let you know. i faced a small problem and found a solution
after i moved some big folders to phone memory i got a "low phone memory" at 200mb ?! witch i find is MORE than enogh !
this warning come usally at 10% ....
i found a mod to change the threshold to i.e. 2 or 5% :good:
http://forum.xda-developers.com/showthread.php?t=877793

so i can use this script ( or make my own, which would be very similar) on the xperia u too rite?

unreal3000 said:
so i can use this script ( or make my own, which would be very similar) on the xperia u too rite?
Click to expand...
Click to collapse
Yep, you should be able to.
@OP: what you need is to write a generic script that moves directories based on a plain text list on /sdcard.

there is a sd card in xperia P ? oO

ilgreco112 said:
there is a sd card in xperia P ? oO
Click to expand...
Click to collapse
There is no sdcard, but /sdcard is a separate partition.

the main idea stays the same. the xperia u has a partition which acts as an internal sd. so lets say i want to move my music folder on the sdcard to the /data partition. will this work? -
Code:
busybox mkdir -p /sdcard/music
busybox mkdir -p /data/music
mount -o bind /data/music /sdcard/music
tks fr the help!

unreal3000 said:
the main idea stays the same. the xperia u has a partition which acts as an internal sd. so lets say i want to move my music folder on the sdcard to the /data partition. will this work? -
Code:
busybox mkdir -p /sdcard/music
busybox mkdir -p /data/music
mount -o bind /data/music /sdcard/music
tks fr the help!
Click to expand...
Click to collapse
should work, but you should use it for i. e. gamedata that you can always redownload. because if you reflash your phone this data will be lost.
btw. next version of setxperia is able to execute /sdcard/userinit.sh then you can easily edit this file on pc when phone is docked...
Gesendet von meinem LT22i

inteks said:
should work, but you should use it for i. e. gamedata that you can always redownload. because if you reflash your phone this data will be lost.
btw. next version of setxperia is able to execute /sdcard/userinit.sh then you can easily edit this file on pc when phone is docked...
Gesendet von meinem LT22i
Click to expand...
Click to collapse
so your saying once i have my music folder on the /data partition, i cant edit it through the sdcard partition? (like copy things to the music folder on the sd from my comp, but it would actual get stored on the /data partition?)

unreal3000 said:
so your saying once i have my music folder on the /data partition, i cant edit it through the sdcard partition? (like copy things to the music folder on the sd from my comp, but it would actual get stored on the /data partition?)
Click to expand...
Click to collapse
Yeah, that's exactly it.

unreal3000 said:
so your saying once i have my music folder on the /data partition, i cant edit it through the sdcard partition? (like copy things to the music folder on the sd from my comp, but it would actual get stored on the /data partition?)
Click to expand...
Click to collapse
no you can't access them through PC. on PC these folders are empty. as i said this is only useful for i. e. big game folder to save some space...
Gesendet von meinem LT22i

to let you know. i faced a small problem and found a solution
after i moved some big folders to phone memory i got a "low phone memory" at 200mb ?! witch i find is MORE than enogh !
this warning come usally at 10% ....
i found a mod to change the threshold to i.e. 2 or 5% :good:
http://forum.xda-developers.com/showthread.php?t=877793

ok.... last version of setxperia can execute "/sdcard/userinit.sh"
btw. i change the script to use a function to mount folders. its easier to add new locations here is the act version of my /sdcard/userinit.sh -->>
Code:
echo '/dev/block/mmcblk0p14' > /sys/devices/platform/usb_mass_storage/lun0/file
echo '1' > /sys/devices/virtual/usb_composite/usb_mass_storage/enable
checkMount(){
if grep -qs $1 /proc/mounts; then
echo "$1 is allready mounted"
else
busybox rm -r $1
busybox mkdir -p $1
busybox mkdir -p $2
mount -o bind $2 $1
echo "$1 successfully mounted"
fi
}
checkMount '/sdcard/Navigon' '/data/Navigon'
checkMount '/sdcard/Android/data/com.eamobile.sims3_row_qwf' '/data/Android/data/com.eamobile.sims3_row_qwf'
checkMount '/sdcard/Android/data/com.eamobile.nfshp_row_wf' '/system/Android/data/com.eamobile.nfshp_row_wf'
checkMount '/sdcard/Android/data/com.opera.browser' '/cache/Android/data/com.opera.browser'
checkMount '/sdcard/PlayerPro' '/cache/data/PlayerPro'

Hi inteks i own a xperia U. I want to move asphalt 7 gamedata to the data partition. I used this script:
rm -r /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
busybox mkdir -p /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
busybox mkdir -p /system/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
mount -o bind /data/Android/obb/com.gameloft.android.ANMP.GloftA7HM /sdcard/Android/obb/com
But its still in the sdcard partition after reboot. Something wrong i'm doing here. Please point it out so i can move the data.
Thanks !
Sent from my ST25i using Tapatalk 2

Rapier07 said:
Hi inteks i own a xperia U. I want to move asphalt 7 gamedata to the data partition. I used this script:
rm -r /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
busybox mkdir -p /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
busybox mkdir -p /system/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
mount -o bind /data/Android/obb/com.gameloft.android.ANMP.GloftA7HM /sdcard/Android/obb/com
But its still in the sdcard partition after reboot. Something wrong i'm doing here. Please point it out so i can move the data.
Thanks !
Sent from my ST25i using Tapatalk 2
Click to expand...
Click to collapse
busybox mkdir -p /system/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
mount -o bind /data/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
a few errors in script...

inteks said:
busybox mkdir -p /system/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
mount -o bind /data/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
a few errors in script...
Click to expand...
Click to collapse
Oh.. What should i use in place of them?
Edit: i get it i guess. Will try again and report back.
Thanks for your help.
Sent from my ST25i using Tapatalk 2

No go
I've been trying this since morning. Tried one more method and it destroyed my gta3 data.
Could you please write the full script i need to use?
The gamedata location is
/sdcard/Android/obb/ com.gameloft.android.ANMP.GloftA7HM
Thanks.
Sent from my ST25i using Tapatalk 2

Rapier07 said:
No go
I've been trying this since morning. Tried one more method and it destroyed my gta3 data.
Could you please write the full script i need to use?
The gamedata location is
/sdcard/Android/obb/ com.gameloft.android.ANMP.GloftA7HM
Thanks.
Sent from my ST25i using Tapatalk 2
Click to expand...
Click to collapse
how do you start the script ? /etc/init.d or /sdcard/userinit.sh with setxperia ?
have you tryed my new script ?
save this to /sdcard/userinit.sh and use setxperia .... -->>
checkMount(){
if grep -qs $1 /proc/mounts; then
echo "$1 is allready mounted"
else
busybox rm -r $1
busybox mkdir -p $1
busybox mkdir -p $2
mount -o bind $2 $1
echo "$1 successfully mounted"
fi
}
checkMount '/sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf' '/data/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf'
Click to expand...
Click to collapse
but keep in mind after this you have to redownload gamedata ...
parameter of checkmount -> "checkmount orginalfolderpath newfolderpath"

Hi... I m kinda noob... So could u plz tell me to steps to follow to how to get this done.... Tnx
Sent from my ST25i using xda app-developers app

Related

[W-I-P][DEVELOPMENT] Dual / Multi Boot Project: Devs Only

{ LONG POST WARNING }
{ NOT FULLY WORKING YET}
{ NEEDS A LOT OF FURTHER DEVELOPMENT }
Hey everyone I had thought of making this Dual Booting system work along side recovery… because initially (with FreeX10-alpha) it was not possible to have both recovery & dual boot...
Thank you zdzihu & jerpelea for your great work on FreeX10-alpha, which booted off SDCARD… I got inspiration to try and make this work for FreeX10-beta4 based on the amazing work that u guys did! Thank you jerpelea for all your feedback on my repeated messages when I was testing this a few months back (hope I didn’t bother u too much with questions )...
zdzihu & jerpelea u are truly LEGENDS!!!
[This is just my personal opinion] Really hoping that some devs can take interest in this to provide compatible files (ramdisks, system files) for this to work… may be as an add-on to their main roms… please don’t keep bothering devs to create ramdisks for booting off SDCARD… they are already very busy trying to make our X10 better with faster and stable ROMS/MODS/etc… this is just an additional feature…
The basic idea was to use the chargemon booting scripts provided in FreeX10-alpha and to try and make FreeX10-beta4 to boot off SDCARD…
Initially I used the img files which came with FreeX10-alpha and wiped the image to then put FreeX10-beta4 on it… while doing so I realized that all of the symbolic links were not getting copied correctly (obviously)… so I started from scratch with blank ext2fs images…
Later I thought of using clean/base nandroid/recovery backups as they are already working/preconfigured system of FreeX10-beta4…
Following is a small How-To on converting NANDROID/RECOVERY images (with yaffs fs) to ext2 fs images keeping the symlinks intact!!
I have used Ubuntu for these steps.
I have attached blank_files.7z which contains precompiled ext2fs images:
system.img [size: 256 MB]
data.img [size: 512 MB]
cache.img [size: 128 MB]
To resize or create newer ext2fs images:
[APP] Windows: Create Your Own Data.img Maker Application, +/- From Existing data.img
U can use the commands provided there even in linux to create/resize these images...
We will keep the NANDROID images at:
Code:
/home/user/nandroid_imgs/test1/
and EXT2 FS images at:
Code:
/home/user/ext2fs_imgs/test1/
while temporary mounts points will be made at:
Code:
/home/user/mntpts/
We will be using unyaffs from here:
[How-To] Extracting/Accessing Recovery/Nandroid backup (.img) files
Extracting files from the nandroid/recovery backups:
Code:
cd /home/user/nandroid_imgs/test1
mv system.img /home/user/nandroid_imgs/test1/system/
cd /home/user/nandroid_imgs/test1/system/
sudo unyaffs system.img
mv system.img ../.
mv data.img /home/user/nandroid_imgs/test1/data/.
cd /home/user/nandroid_imgs/test1/data/
sudo unyaffs data.img
mv data.img ../.
mv cache.img /home/user/nandroid_imgs/test1/cache/
cd /home/user/nandroid_imgs/test1/cache/
sudo unyaffs cache.img
mv cache.img ../.
Loop mounting ext2 fs files:
Code:
sudo mount -t ext2 -o loop,rw,noatime,nodiratime /home/user/ext2fs_imgs/test1/system.img /home/user/mntpts/system/
sudo mount -t ext2 -o loop,rw,noatime,nodiratime,nosuid,nodev /home/user/ext2fs_imgs/test1/data.img /home/user/mntpts/data/
sudo mount -t ext2 -o loop,rw,noatime,nodiratime,nosuid,nodev /home/user/ext2fs_imgs/test1/cache.img /home/user/mntpts/cache/
Recursively copy all files (preserving symlinks) from extracted yaffs images to mount points
Code:
sudo cp -r -p /home/user/nandroid_imgs/test1/system/* /home/user/mntpts/system/.
sudo cp -r -p /home/user/nandroid_imgs/test1/data/* /home/user/mntpts/data/.
sudo cp -r -p /home/user/nandroid_imgs/test1/cache/* /home/user/mntpts/cache/.
Unmount the mounts:
Code:
sudo umount /home/user/mntpts/system/
sudo umount /home/user/mntpts/data/
sudo umount /home/user/mntpts/cache/
Ok now that the ext2fs iamges are populated with working files copy them onto SDCARD…
I have placed it at:
Code:
/sdcard/FreeX10
lets move on to the chargemon script...
This is, as of now, based off xRecovery chargemon (modified from FreeX10-alpha)
Code:
#!/system/bin/busybox sh
# modified chargemon for recovery + dual boot from NAND/SDCARD
/system/bin/charger
cat /dev/input/event2 > /dev/keycheck&
sleep 3
kill -9 $!
# intact recovery
if [ -s /dev/keycheck ]
then
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /data
umount -l /cache
# Extract recovery
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount system
umount -l /system
chroot / /init
fi
echo "check if reboot into SDCARD OS was called"
if [ -e /data/local/tmp/rebootsdcardos ]
then
echo "Booting from SDCARD!"
# FreeX10-alpha code follows with slight modifications!!!
# remount rootfs rw
mount -o remount,rw rootfs /
busybox chmod 0777 /dev -R
busybox chown 0.2000 /dev/oncrpc -R
rm -r /sdcard
cd /
mkdir sd
chmod 777 sd
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/sdcardos_ramdisk.tar
# Umount system,data,cache
umount -l /system
umount -l /data
umount -l /cache
# Check and mount SD Card
dosfsck -y /dev/block/mmcblk0p1
sleep 5
mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /sd
sleep 5
# Mount system and data ext2 images
losetup /dev/block/loop1 /sd/FreeX10/system.img
sleep 5
losetup /dev/block/loop2 /sd/FreeX10/data.img
sleep 5
losetup /dev/block/loop3 /sd/FreeX10/cache.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
sleep 5
# zdzihu: hack-fix
if [ -e /data/data/com.android.providers.telephony/databases/telephony.db ]; then
/system/bin/chroot / /init
exit
fi
# Chroot :)
chroot / /init
# jump out of chargemon to skip NAND booting
exit
fi
echo "Booting from NAND!"
# remount rw
mount -o remount,rw rootfs /
cd /
rm -r /sdcard
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# zdzihu: hack-fix
if [ -e /data/data/com.android.providers.telephony/databases/telephony.db ]; then
/system/bin/chroot / /init
exit
fi
chroot / /init
Recovery is intact so u can get into recovery the normal way… (press/tap back key after seeing SE text logo)
OS on NAND (normal system on MTD) will boot by default…
To reboot into OS on SDCARD issue the following commands in terminal emulator/adb shell:
Code:
touch /data/local/tmp/rebootsdcardos
reboot
NOW the OS should start booting off the SDCARD…
It completes commands in chargemon and then BootAnimation can be seen…
BUT HERE IS THE PROBLEM!
Check LOGCAT here: http://www.mediafire.com/?phxm3uqzp0dzzhb
here is wht J had to say:
jerpelea said:
as you can see in logcat
1.your prelink is not ok
2.you don't have something ok in initrd
3.you dont have all permisions ok on data
Click to expand...
Click to collapse
From my limited understanding we yet have to make a proper ramdisk (sdcardos_ramdisk.tar)… I feel the init.rc file has to be changed especially the following line (based off FreeX10-beta4 ramdisk):
Code:
mount yaffs2 [email protected] /system rw remount
mount yaffs2 [email protected] /data nosuid nodev
mount yaffs2 [email protected] /cache nosuid nodev
As for Multi-Booting:
We can keep adding different sections to chargmeon:
Code:
/data/local/tmp/rebootsdcardos1
/data/local/tmp/rebootsdcardos2
etc…
OR
possible solution for having both recovery and dual boot
and similarly keep adding ramdisks in NAND /system:
Code:
sdcardos1_ramdisk.tar
sdcardos2_ramdisk.tar
etc
So we can have as many OS/ROMs on SDCARD as u have free space… though we need to make specific ramdisks for each…
Hope this was slightly useful… and waiting for feedback from advance users on how we can get this working....
Lol, you're working very hard Doom! Keep going!
Doom! You are making enormous progress and helping a lot with Other Devs.
A Combination of a good rom and one of these additional Dual Boot would make x10 better than any Android mobile SE could deliver.
Thank you and I really pray to give SE a run for their money!
for someone thats always saying hes not a developer you sure as hell seem to know what your doing!
Keep up the great work, i hope to see this working flawlessly that would be awesome to be able to dual boot.
Whats the next steps in the project?
BULL3TPR00F said:
for someone thats always saying hes not a developer you sure as hell seem to know what your doing!
Keep up the great work, i hope to see this working flawlessly that would be awesome to be able to dual boot.
Whats the next steps in the project?
Click to expand...
Click to collapse
well i am not exactly a ROM developer and dont know much about how to compile libs/sources/etc...
next step is that we need to make compatible system files & ramdisk (init.rc) for dual booting
DooMLoRD said:
well i am not exactly a ROM developer and dont know much about how to compile libs/sources/etc...
next step is that we need to make compatible system files & ramdisk (init.rc) for dual booting
Click to expand...
Click to collapse
You may not be a rom developer but your an amazing commited x10 modder
Sent from my X10i TripNMiUI using XDA App
DooMLoRD said:
well i am not exactly a ROM developer and dont know much about how to compile libs/sources/etc...
next step is that we need to make compatible system files & ramdisk (init.rc) for dual booting
Click to expand...
Click to collapse
I am also excited buddy..... Once i get through my experiments i will surely like to focus on this as this will allow us to have more then one version of ROM on one machine.
Based on your first post
all i can get is we are getting the boot animation but not going after that.
i would suggest following things based on my experiments with ubuntu work.
use loops above 10 coz i suspect some loops are already in use during my ubuntu boot i am watching that loop7 is already created so i would suggest avoiding it.
also as we have been adding debug "we have reached here" style code can we do the same here that might help us.
also can we find any debug-able place i mean place where we can track the progress to get the position inside the rom so that we can understand except logcat where we are.
any progress or hurdles buddy.....
i am eager to test this .....
anantshri said:
any progress or hurdles buddy.....
i am eager to test this .....
Click to expand...
Click to collapse
sorry man havent had time to do any further testing for this... have been very busy with some personal work and kernel manager scripts...
DooMLoRD said:
sorry man havent had time to do any further testing for this... have been very busy with some personal work and kernel manager scripts...
Click to expand...
Click to collapse
Keep up the good Work Doom. ! and thx for your work
Sorry if its no help but there's a thread in the x10 mini pro section
http://forum.xda-developers.com/showthread.php?t=1084555
Sent from my SEX10 using XDA App
These are great news, keep on developing!
sent from my x10i with wolfbreaks CM 6.1.3 v006 undervolted, bb67
rtblittlebrown said:
Sorry if its no help but there's a thread in the x10 mini pro section
http://forum.xda-developers.com/showthread.php?t=1084555
Sent from my SEX10 using XDA App
Click to expand...
Click to collapse
they have posted exactly the same thing!
read my 1st post in this thread and then read the first few posts there
Ohk so since we now have one more option in Xrecovery i am back to my old suggestion.
however this time i will post my thought out in open so that if someone has required skills and time then they can work on .
I have an idea of using xrecovery as a boot menu.
process would be
1) Xrecovery to start everytime. (this needs some consideration.)
2) To have a timeout value if any key pressed before that then remain in menu otherwise boot to the os.
3) inside menu we should have options of all O.S. / ROM (os coz my intention are to run linux off dualboot) available with selection options.
4) ON selection it will just be the same procedure as already using in xrecovery 1.0 to handover the command to a script. and let it load.
5) boot menu if possible could be controlled by an outside file which we can edit just like grub.conf in linux.
Note : This will requires good understanding of booting process of X10i and c skills as xrecovery is written in complete c.
anantshri said:
Ohk so since we now have one more option in Xrecovery i am back to my old suggestion.
however this time i will post my thought out in open so that if someone has required skills and time then they can work on .
I have an idea of using xrecovery as a boot menu.
process would be
1) Xrecovery to start everytime. (this needs some consideration.)
2) To have a timeout value if any key pressed before that then remain in menu otherwise boot to the os.
3) inside menu we should have options of all O.S. / ROM (os coz my intention are to run linux off dualboot) available with selection options.
4) ON selection it will just be the same procedure as already using in xrecovery 1.0 to handover the command to a script. and let it load.
5) boot menu if possible could be controlled by an outside file which we can edit just like grub.conf in linux.
Note : This will requires good understanding of booting process of X10i and c skills as xrecovery is written in complete c.
Click to expand...
Click to collapse
point no.1 is easy... not an issue..
abt point 2 i think that too would be possible... a while loop with sleep function & wait for input/keppress
pt3 the newer xrecovery v1.0.0 already has something similar may be we can look into it to add "Boot NAND system" as first option
point no. 5 if possible WILL BE BRILLIANT!!!
@anantshri
dude may be these guys can help us:
http://forum.xda-developers.com/showpost.php?p=14354231&postcount=49
DooMLoRD said:
they have posted exactly the same thing!
read my 1st post in this thread and then read the first few posts there
Click to expand...
Click to collapse
Oops sorry..
Sent from my SEX10 using XDA App
rtblittlebrown said:
Oops sorry..
Sent from my SEX10 using XDA App
Click to expand...
Click to collapse
no dude thanks for the info... i have already contacted those guys for help... lets see may be they can help us out to get this working!!!
dual boot hint by Z
http://forum.xda-developers.com/showthread.php?t=1107111
something related

[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...

[Q] SDCard Script

Can someone post the script that mount sdcard at boot?
I created a kernel but it doesn't mount sdcard at boot, it's possibile to create the script in system/etc/init.d that mount sdcard at boot?
Try busybox mount while booted to see if it's possible to mount SD Card with a script. SD card mounts automatically if it's FAT32 and it takes a little vold.fstab configuration for other file systems. You should check franco's or LG's kernel to see how to automount sd card from kernel.
This is taken from CM7, put it in init.d and see.
Turducken said:
This is taken from CM7, put it in init.d and see.
Click to expand...
Click to collapse
Thank you very much but what's that?
# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $e2fsk_exitcode;
if [ "$e2fsk_exitcode" -lt 2 ];
then
# mount and set perms
$BB mount -o noatime,nodiratime,barrier=1 -t ext3 $SD_EXT_PART $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
Click to expand...
Click to collapse
EDIT: Mount This script sdcard?
#!/system/bin/sh
mount -o remount,ro -t yaffs2 /dev/block/mmcblk0
Click to expand...
Click to collapse
RE-EDIT: The CM7 script doesn't works, in the second reboot the sd wasn't mount
The CM7 script mounts a2sd apps (apps2sd script). The second one should be like
Code:
mount -o remount,r[b]w[/b] -t [b]fat32[/b] /dev/block/mmcblk0
. As I already said, it's probably a kernel problem, vold mounts sdcards automatically.
Cricco said:
Thank you very much but what's that?
Click to expand...
Click to collapse
That part of the script mounts an ext partition if one exists.
RE-EDIT: The CM7 script doesn't works, in the second reboot the sd wasn't mount
Click to expand...
Click to collapse
As Ianis G. Vasilev said there are various ways to mount the SD card but I suspect the issue is with the kernel you've compiled. Flash francos, if it mounts then your kernel is bad. Run logcat to see what's going on.
**EDIT**
I didn't see Ianis post before I began mine...
so with
mount -o remount,rw -t fat32 /dev/block/mmcblk0
Click to expand...
Click to collapse
the sd will be mount?
EDIT: I need a script that mount sd without write or read permission, infact if i use root explorer and I go to sdcard sometimes the sdcard folder is blank, so the sd didn't mount
Read permissions are needed to see what's on the sd card. For a read-only mount replace rw with ro:
Code:
mount -o remount,r[b]o[/b] -t fat32 /dev/block/mmcblk0
I would advice you to use dmesg(should be enabled in kernel) to see if your phone detects the card and logcat to see if any errors are preventing your card from mounting.
Now i create script
#!/system/bin/sh
mount -o remount,rw -t fat32 /dev/block/mmcblk0
mount -t vfat -o /dev/block/mmcblk0
Click to expand...
Click to collapse
is it correct?

symlink /data/data to /mnt/sdcard

Hi... I have a rooted Sony Xperia J. It has phone memory of 764 mb, Internal SD card of 2.01gb and an ext SD card of 32gb.
What I want to do is move my app data which I think is in /data/data to my internal SD card which I think is mounted at /mnt/sdcard? I am going to create a folder on my sdcard called data.
I need some advice though as to whether this is possible and safe to do?
is it as simple as doing;
mkdir /mnt/sdcard/data
cp -r /data/data /mnt/sdcard/data
ln -s /data/data /mnt/sdcard/data
Then rebooting ?
in fact, thinking this might be a better option? Please can someone confirm this wont brick my phone?
mkdir /mnt/sdcard/data
mkdir /mnt/sdcard/app
cp -r /data/data /mnt/sdcard/data
cp -r /data/app /mnt/sdcard/app
ln -s /data/data /mnt/sdcard/data
ln -s /data/app /mnt/sdcard/app
Then rebooting ?
Sorry, I am doing lots of reading on this, but still haven't seen if anyone has done exactly this before. Would like some confirmation. I think I got the linking the wrong way around, so I now think it should be like this;
mkdir /mnt/sdcard/data
mkdir /mnt/sdcard/app
cp -pr /data/data /mnt/sdcard
cp -pr /data/app /mnt/sdcard
rm -r /data/data
rm -r /data/app
ln -s /mnt/sdcard/data /data/data
ln -s /mnt/sdcard/app /data/app
Then rebooting ?
yeah, that doesnt workd... soft bricked
ninjaprawn said:
yeah, that doesnt workd... soft bricked
Click to expand...
Click to collapse
Just in case someone needs this.
This wont work as you guys described because you need to format your card to EXT2 or EXT4, android is linux and needs perms wich FAT32 dont have. Also you need to make init script to mount the sdcard at boot and not at startup.
magix01 said:
Just in case someone needs this.
This wont work as you guys described because you need to format your card to EXT2 or EXT4, android is linux and needs perms wich FAT32 dont have. Also you need to make init script to mount the sdcard at boot and not at startup.
Click to expand...
Click to collapse
But is there any app that makes it easy?
i've a tablet vega with honeice android.
my problem is /data dimension, too.
i'm using link2sd app but /data is full, evenly.
why?

[Q] [SOLVED] Is there kernel loop support for our device ?

Hi,
As the title says, Is there Kernel loop support for our LG Optimus L9 ?
I'm trying to mount a loop file created on debian on the device, but I get the error
ioctl LOOP_SET_FD failed: Device or resource busy
Click to expand...
Click to collapse
.
This is what I did --
Loop file created on debian and formatted with ext4.
On Optimus L9 with CM10.1, in terminal emulator,
$su
#losetup /dev/block/loop0 /storage/sdcar1/file
#mount -o remount,rw /system
#mkdir /system/temp
#mount -rw -o loop -t ext4 /dev/block/loop0 /system/temp/
ioctl LOOP_SET_FD failed: Device or resource busy
#
Click to expand...
Click to collapse
Is our kernel having loop support. If yes, am I doing anything wrong? The file gets successfully mounted in Debian.
EDIT:
using "busybox mount" solved the issue.
Tried adding busybox to the mount command and voila it worked.
#busybox mount -rw -o loop -t ext4 /dev/block/loop0 /system/temp/
Click to expand...
Click to collapse
You just taught me something new, thanks.
Can you upload your img, I would really like to check this out, or can you direct me to a thread so I can learn some more.
Sent from my LGMS769 using xda app-developers app
kuma82 said:
You just taught me something new, thanks.
Can you upload your img, I would really like to check this out, or can you direct me to a thread so I can learn some more.
Sent from my LGMS769 using xda app-developers app
Click to expand...
Click to collapse
The one I created is over 100MB. I had a html tutorial containing 12,000 files. I don't want to put those files on sdcard and mess it up. So, I used this block device.
I have created a sample "temp.img" file with a size of 500KB. It contains a single text file. I'm attaching it and you can check it out.
Below is the way i created and mounted it.
Code:
# "temp.img" md5 b97642fed817fa3f1a0cc6dc64b6c40d
# remount rootfs rw.
mount -o remount,rw /
# create mount point.
mkdir /mnt/temp
# chmod mountpoint.
chmod 777 /mnt/temp
# create block file.
dd if=/dev/zero of=/storage/sdcard0/temp.img bs=1024 count=500
# this creates 500 KB file. I can't seem
# to get bs=1M argument working on android.
# so bs1024 x count = target file size (=count times in KB).
# query free loop device. (will be /dev/block/loopx)
losetup -f
#attach block file with free loop.
losetup /dev/block/loop0 /storage/sdcard0/temp.img
#create file system.
mke2fs -T ext2 /dev/block/loop0
# And finally mount it
busybox mount -o loop -t ext2 -rw /dev/block/loop0 /mnt/temp
# For unmounting
busybox umount /mnt/temp
And it isn't encrypted. I don't need encryption, and i can't even seem to figure out how to encrypt it.

Categories

Resources