Related
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...
Hello everyone, I'm trying to figure out how to write a script to copy three .mp3 files from three different locations all to /system/media/audio/ringtones. So far, I'm in a bit over my head and I was wondering if anyone here could help me please?
Thanks in advance!
Mac of York said:
Hello everyone, I'm trying to figure out how to write a script to copy three .mp3 files from three different locations all to /system/media/audio/ringtones. So far, I'm in a bit over my head and I was wondering if anyone here could help me please?
Thanks in advance!
Click to expand...
Click to collapse
Well bud, honestly, it's not even worth all the writing it would take to compile a script for such an easy task via and file explorer that supports root functions. Simply copy n paste all into one folder, mount your /system -r/w and then the good ol multi-select button, copy to clipboard, browse up to /system/media/ringtones or /system/audio (whichever your phone model stores your system sounds/ui crap in), then after pasted to destination folder simply remount -r/o, reboot phone, voila!
jtmarich1985 said:
Well bud, honestly, it's not even worth all the writing it would take to compile a script for such an easy task via and file explorer that supports root functions. Simply copy n paste all into one folder, mount your /system -r/w and then the good ol multi-select button, copy to clipboard, browse up to /system/media/ringtones or /system/audio (whichever your phone model stores your system sounds/ui crap in), then after pasted to destination folder simply remount -r/o, reboot phone, voila!
Click to expand...
Click to collapse
Haha, thanks -- that's what I usually do but if it's too complicated it's not worth it.
Open a new text file, and write this:
Code:
#!/system/bin/sh
mount -o rw,remount /system
cp location1/file.mp3 /system/media/audio/ringtones/file.mp3
cp location2/file2.mp3 /system/media/audio/ringtones/file2.mp3
cp location3/file3.mp3 /system/media/audio/ringtones/file3.mp3
mount -o ro,remount /system
Save it (the extension doesn't matter) and that's it. You can run it using script manager, or the terminal emulator (in this case you need to get root permissions first, using the su command).
Also you can add some messages (to get a nicer script, you know ), this way:
Code:
#!/system/bin/sh
echo "Mounting /system as RW..."
mount -o rw,remount /system
echo "Copying files..."
cp location1/file.mp3 /system/media/audio/ringtones/file.mp3
cp location2/file2.mp3 /system/media/audio/ringtones/file2.mp3
cp location3/file3.mp3 /system/media/audio/ringtones/file3.mp3
echo "Done. Mounting /system as RO again..."
mount -o ro,remount /system
echo "All done. Have a nice day =)"
Please be careful while using scripts, otherwise you'll brick some devices :silly:
RoberGalarga said:
Open a new text file, and write this:
Code:
#!/system/bin/sh
mount -o rw,remount /system
cp location1/file.mp3 /system/media/audio/ringtones/file.mp3
cp location2/file2.mp3 /system/media/audio/ringtones/file2.mp3
cp location3/file3.mp3 /system/media/audio/ringtones/file3.mp3
mount -o ro,remount /system
Save it (the extension doesn't matter) and that's it. You can run it using script manager, or the terminal emulator (in this case you need to get root permissions first, using the su command).
Also you can add some messages (to get a nicer script, you know ), this way:
Code:
#!/system/bin/sh
echo "Mounting /system as RW..."
mount -o rw,remount /system
echo "Copying files..."
cp location1/file.mp3 /system/media/audio/ringtones/file.mp3
cp location2/file2.mp3 /system/media/audio/ringtones/file2.mp3
cp location3/file3.mp3 /system/media/audio/ringtones/file3.mp3
echo "Done. Mounting /system as RO again..."
mount -o ro,remount /system
echo "All done. Have a nice day =)"
Please be careful while using scripts, otherwise you'll brick some devices :silly:
Click to expand...
Click to collapse
Awesome, thanks. I'd give you a thanks but I'm all thanked out today.
RoberGalarga said:
Open a new text file, and write this:
Code:
#!/system/bin/sh
mount -o rw,remount /system
cp location1/file.mp3 /system/media/audio/ringtones/file.mp3
cp location2/file2.mp3 /system/media/audio/ringtones/file2.mp3
cp location3/file3.mp3 /system/media/audio/ringtones/file3.mp3
mount -o ro,remount /system
Save it (the extension doesn't matter) and that's it. You can run it using script manager, or the terminal emulator (in this case you need to get root permissions first, using the su command).
Also you can add some messages (to get a nicer script, you know ), this way:
Code:
#!/system/bin/sh
echo "Mounting /system as RW..."
mount -o rw,remount /system
echo "Copying files..."
cp location1/file.mp3 /system/media/audio/ringtones/file.mp3
cp location2/file2.mp3 /system/media/audio/ringtones/file2.mp3
cp location3/file3.mp3 /system/media/audio/ringtones/file3.mp3
echo "Done. Mounting /system as RO again..."
mount -o ro,remount /system
echo "All done. Have a nice day =)"
Please be careful while using scripts, otherwise you'll brick some devices :silly:
Click to expand...
Click to collapse
This is exactly what I wanted and it works beautifully! Thank you so much!
If I put script like thisone (classic copy-paste) in /system/etc/init.d, is it possible to configure that runing on ewery boot? And how?
Thanks.
Haven't tried this yet for fear of bricking, can someone help to see it this will work? I'm just trying to have a script to be placed on the homescreen so I can easily disable/enable the mediascanner/screenshot function. By the way, cp copies files, and cp -r actually moves (cut-paste) files, right?
#!/system/bin/sh
echo "Mounting /system as RW..."
mount -o rw,remount /system
echo "Movingfiles..."
cp -r /system/prv-app/MediaProvider.apk /system/prv-app/newfolder/MediaProvider.apk
echo "Done. Mounting /system as RO again..."
mount -o ro,remount /system
#!/system/bin/sh
echo "Mounting /system as RW..."
mount -o rw,remount /system
echo "Moving files..."
cp -r /system/prv-app/newfolder/MediaProvider.apk /system/prv-app/MediaProvider.apk
echo "Done. Mounting /system as RO again..."
mount -o ro,remount /system
Is it possible to do the same but with a folder+ content and not just a file?
Best thought to testing scripts, would be to add an android emulator to your computer. The one I use is nox. Its great for testing scripts and a variety of other things as well. Nox is an android based application, made jjust like a phone. All the features and extensions that your normal everyday android has, this emulator has as well.
This is cwm for your xperia u with locked bootloader, but this is beta version
FILES FOR XPERIA U
recovery.fstab
Code:
# mount point fstype device [device2] fstype2
/cache ext4 /dev/block/mmcblk0p12
/data ext4 /dev/block/mmcblk0p11
/system ext4 /dev/block/mmcblk0p10
/sdcard vfat /dev/block/mmcblk0p14
/boot emmc /dev/block/mmcblk0p9
fstab
Code:
/cache ext4 /dev/block/mmcblk0p12
/data ext4 /dev/block/mmcblk0p11
/system ext4 /dev/block/mmcblk0p10
/sdcard vfat /dev/block/mmcblk0p14
/boot emmc /dev/block/mmcblk0p9
bootrec
Code:
#!/sbin/sh
# trigger button-backlight
echo '255' > /sys/class/leds/r-key-blue/brightness
echo '255' > /sys/class/leds/m-key-red/brightness
echo '255' > /sys/class/leds/l-key-green/brightness
cat /dev/input/event2 > /dev/keycheck&
sleep 3
# trigger button-backlight
echo '0' > /sys/class/leds/r-key-red/brightness
echo '0' > /sys/class/leds/l-key-red/brightness
echo '0' > /sys/class/leds/m-key-red/brightness
kill -9 $!
fi
if [ -s /dev/keycheck -o -e /cache/recovery/enterrecovery ]
then
rm /cache/recovery/enterrecovery
mount -o remount,rw rootfs /
# shifting to "umount -l /partition" to avoid mounting issues in recovery
stop cspsa
stop tad
killall -9 cspsa-server
killall -9 logwrapper
killall -9 chargemon
killall -9 tad
umount -l /system
umount -l /data
umount -l /cache
umount -l /sdcard
umount -l /mnt/sdcard
rm -r /sdcard
rm -r /not/sdcard
mkdir /sdcard
mkdir /tmp
rm /etc
mkdir /etc
cp /recovery.fstab /etc/recovery.fstab
mount /dev/block/mmcblk0p14 /sdcard
/sbin/recovery &
/sbin/ps >/sdcard/ps.log
# DooMLoRD - enable USB Mass Storage mode - thanks to Napstar
echo 1 > /sys/devices/virtual/usb_composite/usb_mass_storage/enable
/sbin/recovery &
/sbin/adbd_rec recovery
fi
IM INTEGRATE THIS IN MY AOKP
works
everythings
mount /data
mount /cache
mount /sdcard
mount /usb
CHANGELOG:
BETA 1
FIXED MOUNT DATA AND USB
BETA 2
THE BAR LIGHTS IS ON IN RECOVERY MOD NICE!!!
FOR NOW THIS HAVE SOME BUGS
BETA 3
FIXED SOME ISSEUES
BUGS: ONLY MOUNT SYSTEM
BETA 4
NEW AOKP LOGO
NOW YOU CAN FORMAT /SYSTEM....BUT NOT FLASH ROMS
BETA 5
FIXED MOUNT /SYSTEM (From bootrec from Atis112)
FIXED Bootrec
Fixed Bootrec-Device
Fixed Bootrec-devce-fs
ITS MY CWM... NOT CWM MODIFY FROM ATIS112
IM ADD SOME FEATURES TO THISS CWM
INSTALLATION
RENAME TO recovery.tar AND PUT IN SYSTEM/BIN AND CHANGE PERMISSIONS
DOWNLOAD: HERE
maybe you need to check if the recovery is gaining access to root, check the mountpoint, etc...
xperiafan13 said:
This is cwm for your xperia u with locked bootloader, but this is beta version
bugs:
Cant mount system
I NEED TO FIX MOUNT SYSTEM... PLEASE HEELP ME!!!!
IM INTEGRATE THIS IN MY AOKP
works
everythings
mount /data
mount /cache
mount /sdcard
mount /usb
Click to expand...
Click to collapse
Wait my next rom.
Sent from my Xperia U using xda premium
THANKS
atis112 said:
Wait my next rom.
Sent from my Xperia U using xda premium
Click to expand...
Click to collapse
BUT IM MAKE MI CUSTOM RAMDIZK AND RECOVERYS FOR MY ROM,I'm about going on holiday, and now if I can give more time to ANDROID
New beta aviable
This is in progress, not flly working, is oly for development.....
The light bar is on in recovery
Delete.
HELLO
This is my personnel recovery, this is not a copy of CWM of Atis112, eh I repaired the system assembly from its bootrec, keeping the light bar is always turned on, I will initiate my own projects, this is different from CWM of Atis112, thank him for the fix, likewise warn my AOKP version will have a new morning, I no longer have tested and reboots ...
some new things will
Enabled 2D acceleration
LED repaired
Greater stability guaranteed
No more delays on lockscreen
Posted AndyX modules, activatable Romcontrol
All applications updated
Based on FXP 148
AND MORE
What are the main diferences between your cwm and attis ?
HOW TO:
Merge "Internal Storage" (/storage/sdcard0) and "Data" (/data) partitions.
WHY:
1) Eliminate "not enough storage" limitation on installed apps. Install as many as you want.
2) Increase potential Internal Storage space (adding unused space from the /cache /preload /data and /emmc partitions together into one mega partition).
3) True full device encryption for /data and /storage/sdcard0 (if you desire).
OVERVIEW OF HOW IT WORKS:
1) Use Odin to flash a modified PIT file to repartition your device. /data is sized to 14+ GB, /cache, /preload, and /emmc are all downsized to 10MB each and are unused.
2) Use my script to modify your ROM to store your "Internal Storage" files on the /data/media/0 folder. This script will hijack your "su" and "sdcard" binaries to work properly.
3) Use my custom TWRP recovery for all of your recovery needs (supports encryption).
4) Encrypt your device if you like.
DIFFICULTY:
Medium
REQUIRED SKILLS:
1) Know how to use ADB
2) Know how to use Odin
3) Know how to fully backup your device and restore it after a factory reset.
SUPPORTED DEVICES:
SGH-S959G ONLY
"COULD BE" SUPPORTED DEVICES:
***DO NOT USE THIS METHOD FOR ANYTHING OTHER THAN SGH-S959G OR YOU WILL RISK HARD-BRICKING IT.
***IF YOU WANT TO TRY IT OUT THEN YOU MUST POST TO THIS FORUM FIRST AND WE WILL DISCUSS
***GETTING YOUR DEVICE SUPPORTED
***Possibly SGH-I777
***Possibly SGH-I9100
***Maybe Others
SUPPORTED ROMS:
CyanogenMOD 12+ (and probably derivative ROMs)
*Risk of soft brick if trying on another ROM (but no higher risk of hard brick).
RISKS: There is a very small risk of hard-brick when flashing a PIT file to your device. To minimize your risk:
1) Don't try to flash during a thunderstorm.
2) Don't try to flash to an unsupported device.
3) Don't try to flash if your USB cable / port / charging port is damaged/faulty. YOU MUST HAVE A RELIABLE USB PORT
4) Don't try to flash with your battery at 0%.
5) Don't try to flash with a computer that likes to crash a lot.
6) Don't unplug or restart your device or computer in the middle of a flash (it takes 10 seconds, be patient, geez).
STEPS TO INSTALL:
Step #1:
Make 2 backups of everything on your phone. All partitions, sdcard, micro-SD, etc...
MOVE THESE BACKUPS TO YOUR COMPUTER, THEY WILL BE ERASED FROM YOUR PHONE.
Make sure you know how to fully restore a completely wiped phone (without a preinstalled recovery) using the computer backups, starting only from the phone's BOOTLOADER/Download/Odin mode.
If you don't know how to do this, you must stop here.
PROCEEDING WITH THIS TUTORIAL WILL PERMANENTLY WIPE MOST PARTITIONS ON YOUR PHONE, THAT INCLUDES: /cache /modem /system /data /emmc /preload
Did you back up your /efs?
BACK UP YOUR /efs!!!
Step #2: Download all attached files.
Step #3: Verify that you have an uncorrupted version of both PIT files. To do this, use the md5 tool (attached) in the windows command line:
> md5 Original_SGH-S959G.pit
Output should read:
7237EC02379B497C6028236B5BBC0C91 Original_SGH-S959G.pit
> md5 MEGADATA_SGH-S959G.pit
Output should read:
9036368F41FAD9FAA266D08398EA2A33 MEGADATA_SGH-S959G.pit
If the MD5 sums don't match, STOP HERE.
DO NOT FLASH A .PIT FILE IF THE MD5 SUM IS WRONG.
Step #5: Install recovery ...
SGH-S959G_TWRP_v2.8.7.0_datamedia.zip
Step #6: Flash PIT
Did you do Step 3? Do it again, don't be lazy.
Open Odin (attached), click the PIT button. Select MEGADATA_SGH-S959G.pit
Re-Partition, Auto Reboot and F. Reset Time should be checked. The PIT filename should appear next to the PIT button.
NOTHING ELSE SHOULD BE CHECKED.
Boot your phone into bootloader/download mode and connect it. The first ID:COM field should turn yellow and have text that looks like 0:[COM5]. In the message field you will see something like <ID:0/005> Added!
Review the risks of what you're about to do above.
Hold your breath, press the start button.
Flashing takes about 10 seconds. Once it's done your phone will reboot. You can close Odin at this point.
Step #7: Format partitions.
Boot into recovery.
Format EMMC: adb shell make_ext4fs mmcblk0p11
Format PRELOAD: adb shell make_ext4fs mmcblk0p12
Wipe CACHE using recovery interface (from advanced wipe screen).
Format DATA using recovery interface (special button present on wipe screen) .
Wipe INTERNAL STORAGE using recovery interface (from advanced wipe screen).
Step #8: Restore partitions.
Reboot into recovery (you must do this again after you format, and the recovery must be datamedia version if you are installing, regular version if you are uninstalling - did you follow step #5?).
... restore your /modem /system /data and /emmc partitions. /cache and /preload should not be restored.
Step #9: Modify Android ...
(I tested on a fully booted android system, but probably works from recovery too.)
Run these commands (obviously correcting the "C:datamedia_installer" path).
*********************************
** If installing from recovery **
*********************************
** mount /data **
** mount /system **
*********************************
adb root
adb push "C:datamedia_installer" /data/local/datamedia_installer
adb shell chmod 700 /data/local/datamedia_installer
To Install: adb shell /data/local/datamedia_installer install
Note: If you ever flash a new ROM in the future it will likely disable this mod. You'll have to do the Step #9 command(s) again.
To Uninstall: adb shell /data/local/datamedia_installer uninstall
Reboot.
Step #10: Adjust /data/media permissions ...
adb root
adb shell chown -R media_rw /data/media/0
adb shell chgrp -R media_rw /data/media/0
adb shell find /data/media/0 -type d -exec chmod 775 {} +
adb shell find /data/media/0 -type f -exec chmod 664 {} +
adb shell chcon -R ubject_r:media_rw_data_file:s0 /data/media/0
Congratulations, if you made it this far you're golden.
STEPS TO UNINSTALL:
Step #1: Install recovery ...
SGH-S959G_TWRP_v2.8.7.0.zip
Step #2: MD5 Verify and then Flash PIT ... (see Step #6 above)
Original_SGH-S959G.pit
Step #3: Format Partitions ... (see Step #7 above)
Step #4: Restore partitions ... (see Step #8 above)
Make sure you are using regular version, not datamedia version.
**You can optionally skip the /emmc restore at this point, and instead finish Step #5 below, then restore to /storage/sdcard0 while Android is running (not in recovery). This should (theoretically) setup the right permissions so you can skip step #6 below.
Step #5: Modify Android ... (see Step #9 above)
Only difference is the first argument for datamedia_installer script (use "uninstall")
Step #6: Adjust /mnt/media_rw/sdcard0 permissions ...
Not sure exactly what the permissions need to be, never had to do this. Let me know if you are trying to do this and I can help you troubleshoot.
**See my note in uninstall Step #4 if you are having trouble here.
XDA:DevDB Information
[PIT] SGH-S959G: Merge /data and /storage/sdcard0 (/data/media mod), Tool/Utility for the AT&T Samsung Galaxy S II SGH-I777
Contributors
dimoochka, Lanchon (thanks for the idea!)
Version Information
Status: Stable
Created 2015-10-07
Last Updated 2015-10-07
great work!
for those wanting to peek at the script without downloading 17MB...
Code:
if [ $1 ] && [ $1 == "install" ]
then
if [ -e /system/bin/sdcard_bin ]
then
echo "Already installed."
else
mount -o remount,rw /system
cp /system/xbin/su /data/local/su_bin_backup
cp /system/bin/sdcard /data/local/sdcard_bin_backup
chmod 700 /data/local/su_bin_backup /data/local/sdcard_bin_backup
cp /system/bin/sh /system/bin/sdcard_sh
mv /system/bin/sdcard /system/bin/sdcard_bin
mv /system/xbin/su /system/xbin/su_bin
echo "#!/system/bin/sdcard_sh" > /system/bin/sdcard
echo "" >> /system/bin/sdcard
echo "while true; do" >> /system/bin/sdcard
echo " sleep 10000" >> /system/bin/sdcard
echo "done" >> /system/bin/sdcard
echo "if [ \$7 ] && [ \$7 == \"/storage/sdcard0\" ]" >> /system/bin/sdcard
echo "then" >> /system/bin/sdcard
echo "fi" >> /system/bin/sdcard
echo "#!/system/bin/sh" > /system/xbin/su
echo "" >> /system/xbin/su
echo "if [ \$1 ] && [ \$1 == \"--daemon\" ]" >> /system/xbin/su
echo "then" >> /system/xbin/su
echo " /system/xbin/sdcardd&" >> /system/xbin/su
echo "fi" >> /system/xbin/su
echo "/system/xbin/su_bin \"\[email protected]\"" >> /system/xbin/su
echo "#!/system/bin/sh" > /system/xbin/sdcardd
echo "" >> /system/xbin/sdcardd
echo "while [ \"\$mprop\" != running ]; do" >> /system/xbin/sdcardd
echo " sleep 1" >> /system/xbin/sdcardd
echo " mprop=\`getprop init.svc.fuse_sdcard0\`" >> /system/xbin/sdcardd
echo "done" >> /system/xbin/sdcardd
echo " setenforce 0" >> /system/xbin/sdcardd
echo " runcon u:r:init:s0 /system/bin/sh -c \"
setenforce 1;
/system/bin/sdcard_bin -u 1023 -g 1023 -d /data/media/0 /storage/sdcard0&
/system/bin/sdcard_bin -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1&
/system/bin/sdcard_bin -u 1023 -g 1023 -d /mnt/media_rw/usbdisk0 /storage/usbdisk0&
\"&
" >> /system/xbin/sdcardd
chmod 755 /system/xbin/su /system/xbin/sdcardd
chmod -R 755 /system/bin/sdcard /system/bin/sdcard_sh
chown -R root /system/bin/sdcard /system/bin/sdcard_sh
chgrp -R shell /system/bin/sdcard /system/bin/sdcard_sh
chcon u:object_r:su_exec:s0 /system/xbin/su
chcon u:object_r:su_exec:s0 /system/xbin/sdcardd
chcon u:object_r:sdcardd_exec:s0 /system/bin/sdcard
chcon u:object_r:sdcardd_exec:s0 /system/bin/sdcard_sh
mount -o remount,ro /system
echo "Successfully installed (you can ignore any device busy errors and should not see any other errors)."
fi
fi
if [ $1 ] && [ $1 == "uninstall" ]
then
if [ -e /system/bin/sdcard_bin ]
then
mount -o remount,rw /system
mv -f /system/bin/sdcard_bin /system/bin/sdcard
mv -f /system/xbin/su_bin /system/xbin/su
rm /system/bin/sdcard_sh
rm /system/xbin/sdcardd
mount -o remount,ro /system
echo "Successfully installed (you can ignore any device busy errors and should not see any other errors)."
else
echo "Not installed."
fi
fi
This looks interesting to me, I have the 4 GB pit mod on my S959G and I have been wondering if one could take the internal SD card space and put it to /data. You made my day with this but has anyone had luck in doing this mod and using xposed modules to make the external SD card the card apps, music, pictures, downloads, and etc folders as a fake internal SD card or is that what modding the android system does so that ROMs see the external SD card as the only expandable memory directory?
Sent from my CM 10 Toshiba Thrive using XDA Free mobile app
cidlover said:
This looks interesting to me, I have the 4 GB pit mod on my S959G and I have been wondering if one could take the internal SD card space and put it to /data. You made my day with this but has anyone had luck in doing this mod and using xposed modules to make the external SD card the card apps, music, pictures, downloads, and etc folders as a fake internal SD card or is that what modding the android system does so that ROMs see the external SD card as the only expandable memory directory?
Sent from my CM 10 Toshiba Thrive using XDA Free mobile app
Click to expand...
Click to collapse
In a nutshell, this is what my mod does:
/data points to mmcblk0p10 (I think off the top of my head)
/storage/sdcard0 points to /mnt/media_rw/sdcard0 which points to mmcblk0p11 (I think off the top of my head)
By installing my PIT, you severely shrink mmcblk0p11 and expand mmcblk0p10 to monster size.
My script then changes the location that /storage/sdcard0 points to (to /data/media/0 which is located on mmcblk0p10).
Android puts everything (pictures, downloads, etc.) by default onto /storage/sdcard0 -> so these files get redirected to the partition which has all the space (/data/media/0 or mmcblk0p10).
So, to answer your question, an Xposed mod to redirect all of that stuff to /storage/sdcard1 (external SD) instead may or may not work depending on the method it uses. If it tells the system that the default directory to use is /storage/sdcard1 via some environment variable or method then there should be no interaction (which is probably the way that the mod works; that's the simplest method). If it does some unmounting/mounting of directories then that may interfere with my script depending on the timing with which the Xposed mod activates.
If you decide to try to get Xposed to do this and it doesn't work - let me know what mod you're using. I can fix my script to accommodate it.
Alternatively, you don't even need Xposed. Instead you can just edit the script at this point (in notepad):
/system/bin/sdcard_bin -u 1023 -g 1023 -d /data/media/0 /storage/sdcard0&
/system/bin/sdcard_bin -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1&
First line: change /storage/sdcard0 to /storage/sdcard1
Second line: change storage/sdcard1 to /storage/sdcard0
*don't add/remove any whitespace or new lines (or really change anything other than the 0 and 1) or you may break the script
This will swap the folders so that /storage/sdcard0 points to external SD and /storage/sdcard1 points to /data/media/0.
Why do you want to do this anyway? 14+ gigs of /data not enough for your carefully curated porn collection?
dimoochka said:
In a nutshell, this is what my mod does:
/data points to mmcblk0p10 (I think off the top of my head)
/storage/sdcard0 points to /mnt/media_rw/sdcard0 which points to mmcblk0p11 (I think off the top of my head)
By installing my PIT, you severely shrink mmcblk0p11 and expand mmcblk0p10 to monster size.
My script then changes the location that /storage/sdcard0 points to (to /data/media/0 which is located on mmcblk0p10).
Android puts everything (pictures, downloads, etc.) by default onto /storage/sdcard0 -> so these files get redirected to the partition which has all the space (/data/media/0 or mmcblk0p10).
So, to answer your question, an Xposed mod to redirect all of that stuff to /storage/sdcard1 (external SD) instead may or may not work depending on the method it uses. If it tells the system that the default directory to use is /storage/sdcard1 via some environment variable or method then there should be no interaction (which is probably the way that the mod works; that's the simplest method). If it does some unmounting/mounting of directories then that may interfere with my script depending on the timing with which the Xposed mod activates.
If you decide to try to get Xposed to do this and it doesn't work - let me know what mod you're using. I can fix my script to accommodate it.
Alternatively, you don't even need Xposed. Instead you can just edit the script at this point (in notepad):
/system/bin/sdcard_bin -u 1023 -g 1023 -d /data/media/0 /storage/sdcard0&
/system/bin/sdcard_bin -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1&
First line: change /storage/sdcard0 to /storage/sdcard1
Second line: change storage/sdcard1 to /storage/sdcard0
*don't add/remove any whitespace or new lines (or really change anything other than the 0 and 1) or you may break the script
This will swap the folders so that /storage/sdcard0 points to external SD and /storage/sdcard1 points to /data/media/0.
Why do you want to do this anyway? 14+ gigs of /data not enough for your carefully curated porn collection?
Click to expand...
Click to collapse
Lol, no, I wanted to see if we turn, in theory, our Galaxy S2 phones into a phone with no Internal Memory and the only expandable memory is a external sd card to expand it, i just was thinking a few xposed modules can help after doing this mod.
cidlover said:
Lol, no, I wanted to see if we turn, in theory, our Galaxy S2 phones into a phone with no Internal Memory and the only expandable memory is a external sd card to expand it, i just was thinking a few xposed modules can help after doing this mod.
Click to expand...
Click to collapse
Just to clarify, the behavior of the device after this mod is identical. If installed properly, this mod does not create any new problems that need fixing. It still behaves exactly the same as if an internal storage partition exists.
dimoochka said:
Just to clarify, the behavior of the device after this mod is identical. If installed properly, this mod does not create any new problems that need fixing. It still behaves exactly the same as if an internal storage partition exists.
Click to expand...
Click to collapse
Sorry to bring this up again, but how is sd card data handled? Like .obb files in the Android folder on the internal SD card after this mod. And has anyone tried this mod yet?
cidlover said:
Sorry to bring this up again, but how is sd card data handled? Like .obb files in the Android folder on the internal SD card after this mod. And has anyone tried this mod yet?
Click to expand...
Click to collapse
Real simple. Instead of files being placed into /storage/sdcard0 they are redirected to /data/media/0. At the end of the day that is the primary difference.
The /data/media/obb folder remains empty (I have no idea what this is used for normally).
I've been using this mod for 2 months, it's worked great. I think me and you are probably the only two people interested in doing it :laugh:
dimoochka said:
The /data/media/obb folder remains empty (I have no idea what this is used for normally).
Click to expand...
Click to collapse
http://blog.notfaqs.com/2013/05/android-obb-files-location.html
http://developer.android.com/google/play/expansion-files.html
/system 1gb
I would like to get some help modifying the /system partition to be 1 gb is there any help i can get?
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