cm10 roms don't flash. Status 7 error - HTC Pico (Explorer)

I would like to explain my problem here. Almost two weeks ago I guess I flashed sense 4 build 7 by derefas and I guess i had a nand burn. No rom flashed at that time like cm10 roms. cm9 rom flashed but there were a lot of FC's at startup so I couldn't use them. Xenon rom and Ateeq rom only worked for me at that time but internal memory was very large and there was only 40 mb free space. Then I followed this guide by cute_prince
Ok guys, here I am posting NAND Recovery Procedure:
Download the following attachment.. Rename flash_erase.txt to flash_erase ( Its actually a binary file )
Copy this file to /system/xbin directory using Root Explorer. Set permission as 755
Make sure Root Access is enabled for both Apps and ADB in Developer settings
Connect phone to PC .. Now open a terminal ( I am using Ubuntu ) and type the following:
Code:
adb shell
su
cd /system/xbin
./flash_erase -N /dev/mtd/mtd2 0 0
./flash_erase -N /dev/mtd/mtd4 0 0
./flash_erase -N /dev/mtd/mtd5 0 0
Note: when you execute above command you may get an IO error.. Its OK, dont get panic
Now disconnect phone from PC.. Remove battery and reinsert it ..
Goto recovery and:
format /boot
format /system
wipe data / factory reset
Now install your favourite ROM
Once the ROM is booted, goto storage settings.. Everything should be fine now and you should get around 140MB free depending on your ROM
and then then the less internal memory problem at boot and fc's in cm9 rom, these problems were solved but the problem that cm10 roms don't flash and error appears like this one
"symlinks failed
file at bla bla bla couldn't be flashed
status 7"
This problem still persists while installing any jelly bean rom not for ics and sense roms flash but they simply bootloop. At htc beats audio screen they don't go any further.
please help me. I am stuck with this problem now for weeks now. Someone please end my misery.:crying::crying::crying::crying::crying::crying:

Possible method
Steps that I would recommend:
1. Remove the sd-ext, and format the SD-card.
1.5: Create a new sd-ext with an ext4 partition using any partition manager apps.
2. Get a superwipe.zip, by akya22, and get it onto your Sd card by any means available.
3. Redownload Beta #6, super-stripped gapps, and get them on your sd card.
4. Insert SD card in your phone.
5. Go to fastboot and flash a new recovery, twrp 2.4 , preferably, because it's official.
6. Reboot your phone using fastboot reboot command.
7. Go to recovery, and flash superwipe.zip.
8. Go to Wipe section, and wipe Cache, Dalvik cache, for security.
9. Do a factory reset once more, for security.
10. Flash CM10 first, and check if it gets flashed correctly.
11. Flash Gapps.
12. Reboot.
Don't think your NAND is burnt because less than 50 percent of memory is available in your device, after flashing CM10. It is normal.
If all these steps get executed correctly, then...
1. Install Solid Explorer on your device. It is the best app for adding scripts.
2. Get an int2ext+ or int2ext (recommended)(i am using beta #6 with int2ext) script by croniccorey.
3. Extract the script to the root of your SD Card. Its name would be "40int2ext", and can be found in the /system/etc/init.d/ folder of the zip file.
4. Open the ROM's zip file in one pane.
5. Browse to /system/etc/init.d . There will already be two files present.
6. Drag and drop the 40int2ext into this folder, from the other pane.
7. Now, if you see that there are 3 files in this folder, the script has been added.
8. Reboot into recovery and flash this ROM.
P.S.: Did you follow the NAND recovery procedure correctly?

Related

[UTIL] sdparted v0.6 - easy sdcard partitioning, upgrading to ext3/4

this script automates the process of partitioning a sdcard on your android device. it should work fine for all sizes/types of sdcards, but since i can't test all sizes/types of sdcards, we'll have to see.
if you are running into problems with the script, post the log file(located at /data/sdparted.log) when asking for help.
big ups to cyanogen (parted and upgrade_fs) and Denkai (upgrading to ext4).
i welcome all comments, questions & suggestions, related to the script. this is NOT a general q&a.
read the ENTIRE post BEFORE asking questions, please.
to manually partition your sdcard see my other thread.
DISCLAIMER: i take no responsibility for what happens to you, your phone, sdcard, data, sanity, etc if you use this script. remember to backup your sdcard to your pc before you begin. this script has the potential to COMPLETELY WIPE your sdcard!
##########################
shameless promotion:
sdparted can also be found in amon_ra's recovery and natalic's android toolkit.​
##########################
features:
-automated partition of sdcard using parted
-upgrading to ext3/ext4
-downgrading to ext2
-interactive mode
-supports units (M and G)
-supports floating point partition sizes (ie. .5G=512M)
-automatic logging to /data/sdparted.log​
##########################
requirements:
android phone with proper utilities(cm-recovery-1.4, amon_ra's recovery)
sdcard <--class 6 recommended(adata makes good ones...they max out the g1 hw in terms of speed)
adb
fingies​
##########################
Code:
sdparted v0.6 created by 51dusty
if you use this script in your work, please give some credit. thanks.
requirements: cm-recovery-v1.4
usage: sdparted [options]
options:
--fatsize|-fs SIZE[MG] set the size of the fat32 partition to <SIZE>.
default=total sdcard size - (ext + swap)
--extsize|-es SIZE[MG] set the size of the ext partition to <SIZE>.
default=512M
--swapsize|-ss SIZE[MG] set the size of the swap partition to <SIZE>.
if set to 0, no swap partition will be created.
default=32M
--extfs|-efs TYPE set the filesystem of ext partition to <TYPE>.
valid types=ext2, ext3, ext4
default=ext2
--upgradefs|-ufs TYPE upgrades existing ext partition to <TYPE>.
this operation will NOT wipe your sdcard and
cannot be used with any partition creation options.
valid types=ext3, ext4
--downgradefs|-dfs TYPE downgrades existing ext partition to <TYPE>.
this operation will NOT wipe your sdcard and
cannot be used with any partition creation options.
valid types=ext2
--interactive|-i interactive mode
--help|-h display this help
--printonly|-po display sdcard information
--silent|-s do not prompt user, not even initial warning.
examples:
sdparted creates swap=32M ext2=512M fat32=remaining free space
sdparted -efs ext4 creates swap=32M ext4=512M fat32=remaining free space
sdparted -fs 1.5G -efs ext3 creates swap=32M ext3=512M fat32=1536M
sdparted -es 256M -ss 0 creates no swap ext2=256M fat32=remaining free space
sdparted -ufs ext4 upgrades ext partition to ext4
##########################
need to backup your ext partition?
the following commands will backup/restore your ext partition to/from a folder named sdbackup in your current directory. these must be run while phone is booted, not recovery.
to backup your ext partition: adb pull /system/sd/ %CD%\sdbackup
to restore back to sdcard: adb push %CD%\sdbackup /system/sd
##########################
to run from computer:
1. download sdparted.txt below to computer
2. connect g1 via usb
3. boot into cm-recovery-v1.4, goto console(alt-x)
4. at your windows cmd prompt type: adb push /path-to/sdparted.txt /sbin/sdparted
5. then type: adb shell chmod 755 /sbin/sdparted
6. to run type adb shell and hit enter.
7. you can now run script (ie. sdparted -efs ext4).​
to run w/o computer:
1. download sdparted.txt below to root of sdcard. (get downloadcrutch if needed*thnx lycoln)
2. boot into cm-recovery-v1.4, goto console(alt-x)
3. at # prompt type: mount /sdcard
4. then, mv /sdcard/sdparted.txt /sbin/sdparted
5. then, chmod 755 /sbin/sdparted
6. you can now run script (ie. sdparted -efs ext4).​
you CANNOT run this script from terminal app.
##########################
if the script crashes or you receive an error:
immediately pull the log to your computer(using adb pull /data/sdparted.log sdparted.log), b/c the log will not be there after a reboot. send me the log when reporting errors, please.
##########################
changelog:
changes in v0.6
*new feature=interactive mode
*tweak user abort function for those with itchy fingers
changes in v0.5.3
*remove initial warning(kinda pointless if there is another before you wipe)
*clean partition table handling code
*general code cleanup/consolidation in anticipation of new features
changes in v0.5.2
*handling of "partition 1 may not be aligned to cylinder boundaries", fixing "sh: -gt: argument expected" and related phenomena (ie. sdparted trying to partition using negative numbers ) reported by midtoad
changes in v0.5.1
*slight change to logging(so slight it only gets a .1), fixing "/sbin/sdparted: line 5: .//sbin/sdparted: not found"
changes in v0.5
*new feature=floating point partition sizes
*new feature=downgrade ext filesystem (ext3->ext2 ONLY, for now)
*fix some crappy programming
changes in v0.4
*unmount all partitions before operations, fixing "Error: Partition(s) on /dev/block/mmcblk0 are being used".
*remove some useless code
changes in v0.3
*new feature=logging
*new feature=units
*new feature=print card info
changes in v0.2
*add cm-r-v1.4 check to prevent running in 1.3.1
##########################
todo items:
-downgradefs support for ext4
##########################
Excellent!
One of the easiest things Ive done in a while. Worked great!
great.
i'm new to android, so i have a question.
I'm guessing when you go to settings and eject SD card, it only unmounts the FAT32 partition, right?
So does that mean the only safe way to eject the card is shutting down?
great job!
SyXbiT said:
great.
i'm new to android, so i have a question.
I'm guessing when you go to settings and eject SD card, it only unmounts the FAT32 partition, right?
So does that mean the only safe way to eject the card is shutting down?
great job!
Click to expand...
Click to collapse
That depends which ROM you are running and how it's set up. CyanogenMod for example, will automatically use the Ext partition for Apps-to-SD if it finds one. Ejecting a card while the phone is using it as part of its internal memory would be a Bad Thing™.
If you are running the stock firmware, it would be safe to remove the card after ejecting it in settings.
Could anyone at their convenience post directions for using this with console,
and where to place text attached? Funny, I've done this the manual way but don't know the simple things.
Thanks in advance for your work and patience. =)
Figured this one out!
Can you tell me how exactly to run this script? I ran this in recovery and i get sdparted not found.
sacredsoul said:
Can you tell me how exactly to run this script? I ran this in recovery and i get sdparted not found.
Click to expand...
Click to collapse
where did you place the file? did you run chmod?
excellent! Great job dusty
sacredsoul, Make sure you have the latest Cyanogen's Recovery Image, which I used 1.4. I got the same error using 1.31. I then updated to 1.4 and it worked perfectly. great Post 51dusty.
i am tryin to do this...hw do i get in recovery mode and wat exactly im i typin?..i hav a 4gig
Just wanted to chime in and say this script worked beautifully for me on a 16gb card.
Thanks!
I don't get it, am I mounting first, placing the file on the SD, then rebooting into recovery? The instructions make it sound as if I can just boot into console and pull it off my machine. Many people might find that confusing.
ctheory83 said:
I don't get it, am I mounting first, placing the file on the SD, then rebooting into recovery?
Click to expand...
Click to collapse
...i don't say to mount anything.
ctheory83 said:
The instructions make it sound as if I can just boot into console and pull it off my machine.
Click to expand...
Click to collapse
actually, you can...but you push instead.
51dusty said:
to install from computer, download, boot into cm-recovery-v1.4, goto console, and adb push /path-to/sdparted.txt /sbin/sdparted, then adb shell chmod 755 /sbin/sdparted. you can now run the script from adb(in recovery) or from g1 recovery console.
Click to expand...
Click to collapse
i will edit post to make installation less "confusing"...done.
Hey dusty i been struggling with this for like a week now and finally decided to post! so i got the adb thing running on my pc, windows 32-bit and it finds my device when i put the command "adb devices", so that far im fine but then your instructions tell us to boot the phone into recovery console and the type "adb shell" the result comes up "no adb found", at this point i have tried it with my phone plugged into the pc and unplugged without mounting it from the G1... please help what am i doing wrong im really confused! thanks!
The script is great i finally figured it out how to work this thing, but i just a bit of an issue now, when i keep installing apps my internal storage is also getting reduced a bit, i have installed about 100mb of apps and my internal storage reduced to 67 from 70mb, i have already cleared cache, using the app to move it to sd card, and also turned my phone off and took out the battery and rebooted, but its standing at 67mb... does this possibly have anything to do with protected apps??? please help!!
adb not found
hi,
it says adb not found, what am i doing wrong ?.
so my problem is that im not quite sure on what you mean by the path in the following command
adb push /path-to/sdparted.txt /sbin/sdparted
i know that you mean where ever the file is located but, for instance i just put mine in the c drive, so it should be adb push /c drive/sdparted.txt /sbin/sdparted
what is the correct way that should look?
edit: ok so i found my problem, i tried to install it from the adb shell, that was wrong, and this is the string in windows cmd i used for sdparted located just on the c drive
"adb push %cd%\sdparted.txt /sbin/sdparted" it then says the speed it was written, etc. does that mean it is correctly installed? from here, im not too sure how to go about setting up my partitions, again im very new to this.
you can now run the script from adb(in recovery) or from g1 recovery console.
Click to expand...
Click to collapse
Everything went okay, only the last stap with running from adb i dont understand.
What command is that ?
CoopZor said:
Everything went okay, only the last stap with running from adb i dont understand.
What command is that ?
Click to expand...
Click to collapse
i have edited first post to clarify how to run.
to run, from adb:
1. boot into cm-recovery-v1.4, goto console(alt-x)
2. at windows prompt, type adb shell and hit enter.
3. once connected via adb, you can now run script (ie. sdparted -efs ext4).
Click to expand...
Click to collapse

[HOWTO] UnRoot MyTouch 3G

!!WARNING!! THIS PROCESS MAY REQUIRE KNOWLEDGE OF THE LINUX OS BEYOND BASIC UNDERSTANDING
I did this on my own phone (original myTouch) and it worked. What is really handy is that you can manipulate anything within /data after flashing the NBH file and PRIOR to flashing the OTA update. Here is what I did:
Within recovery I put all the /data files together (moving /sd-ext/data to /data/data etc) and then ran a script which did this (0628 is just a handy way to know when you perform the backup):
NOTE: only run these commands after "mount data", "mount sdcard" are successful
Code:
busybox mkdir -p /sdcard/my_backup_data/2010_0628
rm -r /data/data/com.google*
rm -r /data/data/com.android*
for d in app app-private data
do
busybox tar -cvzf /sdcard/my_backup_data/2010_0628/$d.tgz -C /data $d
done
The removal of com.google and com.android is mostly for compatibility with system files. You are going to an older version of the OS.
Using the goldcard generator (http://psas.revskills.de/?q=goldcard) I entered my CID from the sdcard and put the goldcard.img on the card. I also placed the sappimg.nbh file on the sdcard. Now using VOLDOWN+POWER I flashed the phone back to its original state.
So now I can put in my "normal" sdcard that has recovery flasher, recovery-RA.img, modified DRC92 update.zip, DMD64 update.zip, all placed in the /sdcard root location. Using the recovery flasher I then flashed /sdcard/recovery-RA.img and went back into recovery.
NOTE: only run these commands after "mount data", "mount sdcard" are successful
Code:
for d in app app-private data
do
busybox tar -xvzf /sdcard/my_backup_data/2010_0628/$d.tgz -C /data
done
Now I have all previous apps and data loaded. So I had to boot the phone at least once and let it do its thing and then I was able to use RA's recovery to run fix_permissions. After that, all the apps worked (minus any beyond v1.5). So the last thing is to now get to v1.6 and make sure everything worked.
Once you verify everything is proper, you can copy the signed-opal-DMD64-from-DRC92.64f7dfbc.zip file into /cache (this allows easy upgrade later) and flash the signed-opal-DRC92-from-COC10.1c95e995-testkeys.zip file like any other within RA's recovery. After flashing, you will have everything stock. Once the update is completed you should instantly receive a notice that a new update has already been downloaded and is available.
I believe I have covered everything. These are the steps I used on the original myTouch to keep all my apps and settings and data after flashing the NBH file. If I left out something or you need further clarification, please ask.
this space held
hold this space

[Q]How to flash broadcom?

Hi,
i installed Shadow Hawk, but Wifi doesn´t work. It´s because of the Hyperion Kernel. I just don´t know how to "replace the broadcom module inside /system/etc/lib/modules". Because i used HTCDev(il) to unlock, i flash boot.img with fastboot. But how do i replace the broadcom module?
Please help!
Given your handset is S-OFF, either,
- Hard way :
Use android SDK adb to mount system RW and push module file :
Code:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mmcblk0p25 /system
adb pull c:\bcm4329.ko /system/lib/modules/bcm4329.ko
- Easy way :
Just use ES file explorer, enable root R/W mode and copy/paste bcm4329.ko into /system/lib/modules
And then reboot.
dmfr said:
Code:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mmcblk0p25 /system
adb pull c:\bcm4329.ko /system/lib/modules/bcm4329.ko
And then reboot.
Click to expand...
Click to collapse
If you use adb, those are not the commands. Should be:
adb remount
adb push :\bcm4329.ko /system/lib/modules/bcm4329.ko
In your first line you were trying to mount a yaffs2 filesystem, when it's probably a ext4 one. The "remount" option will work regardless of the fs.
Ths second line is fairly obvious, you want to push the file to the rom, not pull it from there.
Also, if you S-ON and flashed the rom, the broadcom module was flashed, it's just boot.img that gets left out. This means that when you manualy flash boot.img with fastboot, you don't need to update anything else.
So: Check in system settings if you actually flashed the kernel. It must say "Hyperion V2.XXX", or whatever version was included. If it is, wifi must work, if not, you messed something up on the fastboot flash procedure.
Cheers
will try later, thank you.
ICS Quattro Rom worked including Wifi..
update:
working now.
"Please follow these steps in the same order (I'm shouting) :
1. Boot into recovery
2. Format System (not wipe option but format option !!!)
3. Format Data
4. Format Cache then Format Boot
5. Wipe Data/Factory reset (1st option in wipe/format menu)
6. Wipe Dalvik Cache
Next if you have some wiping utility like Full Wipe 1.5 Ext4 for Saga.zip...run that by selecting install zip from sd card and installing the zip...
7. Now install zip from sd card and flash the rom
8. If any kernel flash it as well
9. Now reboot (Note don't flash any tweaks like transparent notification except gapps if required)
10. Now setup your phone
11. Reboot into recovery
12. Now go into advanced fix permissions and then any tweaks you want (Note whether mentioned or not always wipe Dalvik Cache before installing tweak zip)
13. Voila everything would work perfect 100%.... "
did follow these instructions.
flashed boot.img
having a fast and stable rom now hopefully. ICS wasnt stable enough. especially browser.

[Guide]How to recover from a bootloop

Guide: How to Recover from a bootloop​by brooplank1337​
This guide will learn you the common ways of fixing a bootloop, how to create a custom CWM Fix-Zip and how to use ADB to recover from a bootloop.
Chapters:
Chapter 1: Finding the cause of the bootloop
Chapter 2: Using a CWM ZIP as solution
Chapter 3: Using ADB as solution
Chapter 1: Finding the cause of the bootloop
Bootloops are mainly caused because system files interfering with each other which causes instability and/or crashes at the boot sequence.
To find the cause of a bootloop you have to think about what you did before getting the bootloop.
Choose one of the following reasons that caused the bootloop for you and try out its solution.
- After flashing a new rom
If you flash a new (base)rom with odin your /data will be kept. This means your old dalvik-cache will be used for the new system files which would result in a bootloop, to fix this problem:
1. Start your phone in CWM Recovery
2. Go to Advanced
3. Choose "Wipe dalvik-cache"
4. Now go to "Mounts & Storage"
5. Choose "Wipe /cache"
6. Reboot your phone
if the problems still exists after doing that and you're sure it's not related to the rom, then you need to do this:
1. Start your phone in CWM Recovery
2. Now go to "Mounts & Storage"
3. Choose "Wipe /data"
4. Choose "Wipe /cache"
5. Reboot your phone
- After restoring a system only backup
This one is actually the same as the above one, since only /system is restored (advanced restore) there is an incorrect dalvik-cache present which will cause the bootloop. perform the same steps as above to solve the problem.
- After installing a Mod / Theme or UOT Kitchen output
When you install a Mod / Theme or UOT Kitchen output and you get a bootloop, you know there is something wrong with the file that you are installing. This is mostly caused by an incorrect BaseROM of the mod/theme, but can also happen if the creator just didn't create it properly.
Wiping dalvik-cache won't be enough to fix this, you will need to open the zip on your computer and look at the files that are installed with the mod/theme. you can do this by looking into the system folder in the zip, there you can find the files that are being installed. for example:
You have installed an Extended Power Menu mod but it causes a bootloop, here is what you do:
1. Open the installation zip with Winrar (Extended Power Menu in this case)
2. Now look inside the "system" folder, in my case I found the framework folder inside the system folder
3. The framework folder contains: android.policy.jar & framework-res.apk, so these are the suspicious files.
4. What you simply do is searching for the original files (from your (base)rom) and drag them into the framework folder (inside winrar)
5. Now it will ask for a compression level, choose "Store" and the archive will be done in seconds.
6. You will need to put the file on your external sdcard using the "Mount USB Storage" option in CWM under "Mounts & Storage"
7. Install the zip just as you did with the mod, you should now be bootloop free, if not reinstall the zip with a mounted /system (Mounts & Storage > Mount /system) (and you can optionally wipe /cache and /dalvik-cache, this will never harm any file/setting.
Q: Ok... but I have no external sdcard.. how to fix it then?
A: Have a look at the "Using ADB as solution" chapter
- After setting wrong permissions
Android is very dependent on the right permissions, if you adjust file permissions incorrectly you could get a bootloop, giving a file to less permissions would break it, but also giving a file to much permissions would break it. most common permissions of system files are:
- 644 (RW-R-R) - (this is best known system permission, it exists in /system/app, /system/framework, /system/etc, /system/lib and allot of seperate files)
- 755 (RWX-RX-RX) - (mainly used for /system/bin)
- 777 (RWX-RWX-RWX) - (used for scripts inside /system/etc/init.d and busybox files)
An easy fix is performing the "Fix permissions" option in CWM under Advanced. be sure to mount the partitions before running the fix. Although this doesn't cover all permissions. have a look at the CWM or ADB chapter to find the solution.
Chapter 2 Using a CWM ZIP as solution
Using the original cwm zip is the easiest way, since the zip is already created for you, you only need to replace the files with the original rom files. You can get those files from the deodex packages for baseroms which are posted on the forums. If you are using an odexed ROM, you can get your files from system.img.ext4 (open the baserom: *.tar.md5 with Winrar and extract system.img.ext4)
Now you can open system.img.ext4 with "DiskInternals Linux Reader". browse to the app/framework directory and extract the needed files from the image file.
Once you got the same files as present in the original CWM zip you can easily drag em into the archive, then choose "store" as compression level. Now finally you need to put it on your sdcard and install it.
If you don't have an external sdcard or you can't reach your internal sdcard (which is very likely when you have a bootloop), you can use ADB to push the zip to your phone, read about how to use ADB in Chapter 3.
Commands for updater-script (located in CWMFIX.zip/META-INF/com/google/android/)
Mount & Install
To mount the system partition:
mount("ext4", "EMMC", "/dev/block/mmcblk0p15", "/system");
To extract the system folder in your zip:
package_extract_dir("system", "/system");
Setting Permissions
To set permissions of an individual file:
set_perm(0, 0, Mod, "File here");
A working example:
set_perm(0, 0, 0644, "/system/build.prop");
To set permissions of a directory:
set_perm(0, 0, Mod, "Dir here without a trailing slash");
Setting Permissions Recursively
To set permissions to all files inside a directory (resursive):
set_perm_recursive(0, 0, 0755, Mod, "Dir here without a trailing slash");
A working example:
set_perm_recursive(0, 0, 0755, 0777, "/system/etc/init.d");
Chapter 3 Using ADB as solution
ADB can be used to access the phone while booting, be aware that some bootloops make it unable to use ADB since they do not go further then the samsung logo.
The only tricky part about using ADB with bootloops is that you have to do it on the right time, this is just after the Galaxy S Plus logo, so just when the bootanimation starts. The easiest way to enter your phone in this part is using a batch script that monitors the state of your device and connects directly when possible.
I use this script for example (requires adb.exe and the 2 dlls)
Code:
@echo off
cd /d %~dp0
echo.
echo Waiting for device...
adb wait-for-device
echo.
adb -d shell stop
adb push mycwmfix.zip /sdcard/mycwmfix.zip
adb reboot recovery
This script will wait for the device to become ready, when it's ready it freeze the device, so the script has more time to push the file (instead of keep rebooting). Then it will push the specified cwmfix zip to your sdcard, and after that it will reboot in recovery so you can install the cwm fix you made.
You can also make an batch script that pushes the files automatically to your phone, here is an example:
Code:
@echo off
cd /d %~dp0
echo.
echo Waiting for device...
adb wait-for-device
echo.
adb -d shell stop
adb -d shell su -c "mount -o remount rw /system"
adb push framework-res.apk /system/framework/framework-res.apk
adb -d shell chmod 644 /system/framework/framework-res.apk
adb push SystemUI.apk /system/app/SystemUI.apk
adb -d shell chmod 644 /system/app/SystemUI.apk
adb reboot
This script will wait for the device to become ready, when it's ready it freeze the device, so the script has more time to push the file (instead of keep rebooting). Then it will push framework-res.apk and SystemUI.apk to the directory it belongs to, after that it changes the permissions of the files to RW-R-R (644) and then it will reboot.
I hope you learned something from this tutorial, when I think I forgot something Ill add it later.
That's perfect thanks a lot brood
knank said:
That's perfect thanks a lot brood
Click to expand...
Click to collapse
Thanks
broodplank1337 said:
Guide: How to Recover from a bootloop​by brooplank1337​
This guide will learn you the common ways of fixing a bootloop, how to create a custom CWM Fix-Zip and how to use ADB to recover from a bootloop.
Chapters:
Chapter 1: Finding the cause of the bootloop
Chapter 2: Using a CWM ZIP as solution
Chapter 3: Using ADB as solution
Chapter 1: Finding the cause of the bootloop
Bootloops are mainly caused because system files interfering with each other which causes instability and/or crashes at the boot sequence.
To find the cause of a bootloop you have to think about what you did before getting the bootloop.
Choose one of the following reasons that caused the bootloop for you and try out its solution.
- After flashing a new rom
If you flash a new (base)rom with odin your /data will be kept. This means your old dalvik-cache will be used for the new system files which would result in a bootloop, to fix this problem:
1. Start your phone in CWM Recovery
2. Go to Advanced
3. Choose "Wipe dalvik-cache"
4. Now go to "Mounts & Storage"
5. Choose "Wipe /cache"
6. Reboot your phone
if the problems still exists after doing that and you're sure it's not related to the rom, then you need to do this:
1. Start your phone in CWM Recovery
2. Now go to "Mounts & Storage"
3. Choose "Wipe /data"
4. Choose "Wipe /cache"
5. Reboot your phone
- After restoring a system only backup
This one is actually the same as the above one, since only /system is restored (advanced restore) there is an incorrect dalvik-cache present which will cause the bootloop. perform the same steps as above to solve the problem.
- After installing a Mod / Theme or UOT Kitchen output
When you install a Mod / Theme or UOT Kitchen output and you get a bootloop, you know there is something wrong with the file that you are installing. This is mostly caused by an incorrect BaseROM of the mod/theme, but can also happen if the creator just didn't create it properly.
Wiping dalvik-cache won't be enough to fix this, you will need to open the zip on your computer and look at the files that are installed with the mod/theme. you can do this by looking into the system folder in the zip, there you can find the files that are being installed. for example:
You have installed an Extended Power Menu mod but it causes a bootloop, here is what you do:
1. Open the installation zip with Winrar (Extended Power Menu in this case)
2. Now look inside the "system" folder, in my case I found the framework folder inside the system folder
3. The framework folder contains: android.policy.jar & framework-res.apk, so these are the suspicious files.
4. What you simply do is searching for the original files (from your (base)rom) and drag them into the framework folder (inside winrar)
5. Now it will ask for a compression level, choose "Store" and the archive will be done in seconds.
6. You will need to put the file on your external sdcard using the "Mount USB Storage" option in CWM under "Mounts & Storage"
7. Install the zip just as you did with the mod, you should now be bootloop free, if not reinstall the zip with a mounted /system (Mounts & Storage > Mount /system) (and you can optionally wipe /cache and /dalvik-cache, this will never harm any file/setting.
Q: Ok... but I have no external sdcard.. how to fix it then?
A: Have a look at the "Using ADB as solution" chapter
- After setting wrong permissions
Android is very dependent on the right permissions, if you adjust file permissions incorrectly you could get a bootloop, giving a file to less permissions would break it, but also giving a file to much permissions would break it. most common permissions of system files are:
- 644 (RW-R-R) - (this is best known system permission, it exists in /system/app, /system/framework, /system/etc, /system/lib and allot of seperate files)
- 755 (RWX-RX-RX) - (mainly used for /system/bin)
- 777 (RWX-RWX-RWX) - (used for scripts inside /system/etc/init.d and busybox files)
An easy fix is performing the "Fix permissions" option in CWM under Advanced. be sure to mount the partitions before running the fix. Although this doesn't cover all permissions. have a look at the CWM or ADB chapter to find the solution.
Chapter 2 Using a CWM ZIP as solution
Using the original cwm zip is the easiest way, since the zip is already created for you, you only need to replace the files with the original rom files. You can get those files from the deodex packages for baseroms which are posted on the forums. If you are using an odexed ROM, you can get your files from system.img.ext4 (open the baserom: *.tar.md5 with Winrar and extract system.img.ext4)
Now you can open system.img.ext4 with "DiskInternals Linux Reader". browse to the app/framework directory and extract the needed files from the image file.
Once you got the same files as present in the original CWM zip you can easily drag em into the archive, then choose "store" as compression level. Now finally you need to put it on your sdcard and install it.
If you don't have an external sdcard or you can't reach your internal sdcard (which is very likely when you have a bootloop), you can use ADB to push the zip to your phone, read about how to use ADB in Chapter 3.
Commands for updater-script (located in CWMFIX.zip/META-INF/com/google/android/)
Mount & Install
To mount the system partition:
mount("ext4", "EMMC", "/dev/block/mmcblk0p15", "/system");
To extract the system folder in your zip:
package_extract_dir("system", "/system");
Setting Permissions
To set permissions of an individual file:
set_perm(0, 0, Mod, "File here");
A working example:
set_perm(0, 0, 0644, "/system/build.prop");
To set permissions of a directory:
set_perm(0, 0, Mod, "Dir here without a trailing slash");
Setting Permissions Recursively
To set permissions to all files inside a directory (resursive):
set_perm_recursive(0, 0, 0755, Mod, "Dir here without a trailing slash");
A working example:
set_perm_recursive(0, 0, 0755, 0777, "/system/etc/init.d");
Chapter 3 Using ADB as solution
ADB can be used to access the phone while booting, be aware that some bootloops make it unable to use ADB since they do not go further then the samsung logo.
The only tricky part about using ADB with bootloops is that you have to do it on the right time, this is just after the Galaxy S Plus logo, so just when the bootanimation starts. The easiest way to enter your phone in this part is using a batch script that monitors the state of your device and connects directly when possible.
I use this script for example (requires adb.exe and the 2 dlls)
Code:
@echo off
cd /d %~dp0
echo.
echo Waiting for device...
adb wait-for-device
echo.
adb -d shell stop
adb push mycwmfix.zip /sdcard/mycwmfix.zip
adb reboot recovery
This script will wait for the device to become ready, when it's ready it freeze the device, so the script has more time to push the file (instead of keep rebooting). Then it will push the specified cwmfix zip to your sdcard, and after that it will reboot in recovery so you can install the cwm fix you made.
You can also make an batch script that pushes the files automatically to your phone, here is an example:
Code:
@echo off
cd /d %~dp0
echo.
echo Waiting for device...
adb wait-for-device
echo.
adb -d shell stop
adb -d shell su -c "mount -o remount rw /system"
adb push framework-res.apk /system/framework/framework-res.apk
adb -d shell chmod 644 /system/framework/framework-res.apk
adb push SystemUI.apk /system/app/SystemUI.apk
adb -d shell chmod 644 /system/app/SystemUI.apk
adb reboot
This script will wait for the device to become ready, when it's ready it freeze the device, so the script has more time to push the file (instead of keep rebooting). Then it will push framework-res.apk and SystemUI.apk to the directory it belongs to, after that it changes the permissions of the files to RW-R-R (644) and then it will reboot.
I hope you learned something from this tutorial, when I think I forgot something Ill add it later.
Click to expand...
Click to collapse
Dear sir,
I tried every possible way to recover my handset but its not working as the permissions for SYSTEM folder are changed and adb cannot read it or write it.
i also tried to pull the original folder and push another new system folder so that the files are accessible but no success.
I also tried flashing boot,recovery,system images but no use.
what would you suggest in such situation as the shell su chmod and all the other files reside into system/bin folder.
please do try to check asap and reply.
thanks in advance
mat7961 said:
Dear sir,
I tried every possible way to recover my handset but its not working as the permissions for SYSTEM folder are changed and adb cannot read it or write it.
i also tried to pull the original folder and push another new system folder so that the files are accessible but no success.
I also tried flashing boot,recovery,system images but no use.
what would you suggest in such situation as the shell su chmod and all the other files reside into system/bin folder.
please do try to check asap and reply.
thanks in advance
Click to expand...
Click to collapse
My first advice is to not quote the OP.
Secondly, try to use the adb in recovery mode. If this doesn't work either, use the repartition thread guide to restore your /system partition.
Sent from my GT-I9001 using xda premium
pattern unlock, bootloop
I installed some frameworks, after that settings some features not working properly. yesterday i wanted to set pattern unlock and when i set it i immediately got bootloop.. please tell me what to do? should i flash stock setting mod? or something like it? (framework) i have xperia arc s stock 4.0.4 ...
I need HELP, guys! I am having a little problem and idk how to fix this. After flashing Infamous ROM, reboot, everything worked fine, but then I reboot the phone and it stuck in the bootloop, so I went to the TWRP and factory reset, reboot, still stuck in bootloop. So i went back and format data and flash it again. Everything works fine, then i try to reboot and it and stuck and the samsung screen AGAIN! So i went back to the Stock ROM do the same thing, first boot is fine, reboot and it stuck in the Samung Galaxy S4 screen. Any solution guys? I even tried fix permission . Still didntwork. HELP, PLEASE!!
minhthai17 said:
I need HELP, guys! I am having a little problem and idk how to fix this. After flashing Infamous ROM, reboot, everything worked fine, but then I reboot the phone and it stuck in the bootloop, so I went to the TWRP and factory reset, reboot, still stuck in bootloop. So i went back and format data and flash it again. Everything works fine, then i try to reboot and it and stuck and the samsung screen AGAIN! So i went back to the Stock ROM do the same thing, first boot is fine, reboot and it stuck in the Samung Galaxy S4 screen. Any solution guys? I even tried fix permission . Still didntwork. HELP, PLEASE!!
Click to expand...
Click to collapse
Obviously there is no Infamous ROM for I9001 - you're sure you flashed a ROM that fits to SGS+ please review this and maybe reflash a dedicated ROM.
minhthai17 said:
I need HELP, guys! I am having a little problem and idk how to fix this. After flashing Infamous ROM, reboot, everything worked fine, but then I reboot the phone and it stuck in the bootloop, so I went to the TWRP and factory reset, reboot, still stuck in bootloop. So i went back and format data and flash it again. Everything works fine, then i try to reboot and it and stuck and the samsung screen AGAIN! So i went back to the Stock ROM do the same thing, first boot is fine, reboot and it stuck in the Samung Galaxy S4 screen. Any solution guys? I even tried fix permission . Still didntwork. HELP, PLEASE!!
Click to expand...
Click to collapse
Two questions
1) on which phone did you flash this infamous rom?
2) tried wipe /system and tried it again?
minhthai17 said:
reboot and it stuck in the Samung Galaxy S4 screen.
Click to expand...
Click to collapse
this forum is for Samsung Galaxy S Plus man.... we can't help you... go in S4 section
minhthai17 said:
I need HELP, guys! I am having a little problem and idk how to fix this. After flashing Infamous ROM, reboot, everything worked fine, but then I reboot the phone and it stuck in the bootloop, so I went to the TWRP and factory reset, reboot, still stuck in bootloop. So i went back and format data and flash it again. Everything works fine, then i try to reboot and it and stuck and the samsung screen AGAIN! So i went back to the Stock ROM do the same thing, first boot is fine, reboot and it stuck in the Samung Galaxy S4 screen. Any solution guys? I even tried fix permission . Still didntwork. HELP, PLEASE!!
Click to expand...
Click to collapse
Format emmc and flash any stock ROM for ur device through Odin.
Reroot again and flash any custom ROM built for your device.
Sent from my GT-S7562 using xda premium
bootlooping after data restore to a new rom
hi, i installed jelly bam on my note i717 and it works great, but when i restore data from my stock laggy jelly bean it bootloops i tried doing fix permissions, wiping delvik cashe and cashe. i tried going back and restoring to old jelly bean and then backing it up again and flashing jelly bam again and after restoring data again with fix permissions it bootloops again. how can i safely restore data on my new rom? please help!
p.s. using twrp with cwm i couldn't even flash rom cuz it errored and aborted it every time.
GameOverMan said:
hi, i installed jelly bam on my note i717 and it works great, but when i restore data from my stock laggy jelly bean it bootloops i tried doing fix permissions, wiping delvik cashe and cashe. i tried going back and restoring to old jelly bean and then backing it up again and flashing jelly bam again and after restoring data again with fix permissions it bootloops again. how can i safely restore data on my new rom? please help!
p.s. using twrp with cwm i couldn't even flash rom cuz it errored and aborted it every time.
Click to expand...
Click to collapse
This is i9001 forum... BTW are you trying to restore system apps data?
Inviato dal mio GT-i9001 con topatalk 2
oh sorry didn't notice that. yes im just trying to restore data.
GameOverMan said:
oh sorry didn't notice that. yes im just trying to restore data.
Click to expand...
Click to collapse
I understand, but system apps data or user apps? You can't restore system apps data
Inviato dal mio GT-i9001 con topatalk 2
broodplank1337 said:
Guide: How to Recover from a bootloop​by brooplank1337​
This guide will learn you the common ways of fixing a bootloop, how to create a custom CWM Fix-Zip and how to use ADB to recover from a bootloop.
Chapters:
Chapter 1: Finding the cause of the bootloop
Chapter 2: Using a CWM ZIP as solution
Chapter 3: Using ADB as solution
Chapter 1: Finding the cause of the bootloop
Bootloops are mainly caused because system files interfering with each other which causes instability and/or crashes at the boot sequence.
To find the cause of a bootloop you have to think about what you did before getting the bootloop.
Choose one of the following reasons that caused the bootloop for you and try out its solution.
- After flashing a new rom
If you flash a new (base)rom with odin your /data will be kept. This means your old dalvik-cache will be used for the new system files which would result in a bootloop, to fix this problem:
1. Start your phone in CWM Recovery
2. Go to Advanced
3. Choose "Wipe dalvik-cache"
4. Now go to "Mounts & Storage"
5. Choose "Wipe /cache"
6. Reboot your phone
if the problems still exists after doing that and you're sure it's not related to the rom, then you need to do this:
1. Start your phone in CWM Recovery
2. Now go to "Mounts & Storage"
3. Choose "Wipe /data"
4. Choose "Wipe /cache"
5. Reboot your phone
- After restoring a system only backup
This one is actually the same as the above one, since only /system is restored (advanced restore) there is an incorrect dalvik-cache present which will cause the bootloop. perform the same steps as above to solve the problem.
- After installing a Mod / Theme or UOT Kitchen output
When you install a Mod / Theme or UOT Kitchen output and you get a bootloop, you know there is something wrong with the file that you are installing. This is mostly caused by an incorrect BaseROM of the mod/theme, but can also happen if the creator just didn't create it properly.
Wiping dalvik-cache won't be enough to fix this, you will need to open the zip on your computer and look at the files that are installed with the mod/theme. you can do this by looking into the system folder in the zip, there you can find the files that are being installed. for example:
You have installed an Extended Power Menu mod but it causes a bootloop, here is what you do:
1. Open the installation zip with Winrar (Extended Power Menu in this case)
2. Now look inside the "system" folder, in my case I found the framework folder inside the system folder
3. The framework folder contains: android.policy.jar & framework-res.apk, so these are the suspicious files.
4. What you simply do is searching for the original files (from your (base)rom) and drag them into the framework folder (inside winrar)
5. Now it will ask for a compression level, choose "Store" and the archive will be done in seconds.
6. You will need to put the file on your external sdcard using the "Mount USB Storage" option in CWM under "Mounts & Storage"
7. Install the zip just as you did with the mod, you should now be bootloop free, if not reinstall the zip with a mounted /system (Mounts & Storage > Mount /system) (and you can optionally wipe /cache and /dalvik-cache, this will never harm any file/setting.
Q: Ok... but I have no external sdcard.. how to fix it then?
A: Have a look at the "Using ADB as solution" chapter
- After setting wrong permissions
Android is very dependent on the right permissions, if you adjust file permissions incorrectly you could get a bootloop, giving a file to less permissions would break it, but also giving a file to much permissions would break it. most common permissions of system files are:
- 644 (RW-R-R) - (this is best known system permission, it exists in /system/app, /system/framework, /system/etc, /system/lib and allot of seperate files)
- 755 (RWX-RX-RX) - (mainly used for /system/bin)
- 777 (RWX-RWX-RWX) - (used for scripts inside /system/etc/init.d and busybox files)
An easy fix is performing the "Fix permissions" option in CWM under Advanced. be sure to mount the partitions before running the fix. Although this doesn't cover all permissions. have a look at the CWM or ADB chapter to find the solution.
Chapter 2 Using a CWM ZIP as solution
Using the original cwm zip is the easiest way, since the zip is already created for you, you only need to replace the files with the original rom files. You can get those files from the deodex packages for baseroms which are posted on the forums. If you are using an odexed ROM, you can get your files from system.img.ext4 (open the baserom: *.tar.md5 with Winrar and extract system.img.ext4)
Now you can open system.img.ext4 with "DiskInternals Linux Reader". browse to the app/framework directory and extract the needed files from the image file.
Once you got the same files as present in the original CWM zip you can easily drag em into the archive, then choose "store" as compression level. Now finally you need to put it on your sdcard and install it.
If you don't have an external sdcard or you can't reach your internal sdcard (which is very likely when you have a bootloop), you can use ADB to push the zip to your phone, read about how to use ADB in Chapter 3.
Commands for updater-script (located in CWMFIX.zip/META-INF/com/google/android/)
Mount & Install
To mount the system partition:
mount("ext4", "EMMC", "/dev/block/mmcblk0p15", "/system");
To extract the system folder in your zip:
package_extract_dir("system", "/system");
Setting Permissions
To set permissions of an individual file:
set_perm(0, 0, Mod, "File here");
A working example:
set_perm(0, 0, 0644, "/system/build.prop");
To set permissions of a directory:
set_perm(0, 0, Mod, "Dir here without a trailing slash");
Setting Permissions Recursively
To set permissions to all files inside a directory (resursive):
set_perm_recursive(0, 0, 0755, Mod, "Dir here without a trailing slash");
A working example:
set_perm_recursive(0, 0, 0755, 0777, "/system/etc/init.d");
Chapter 3 Using ADB as solution
ADB can be used to access the phone while booting, be aware that some bootloops make it unable to use ADB since they do not go further then the samsung logo.
The only tricky part about using ADB with bootloops is that you have to do it on the right time, this is just after the Galaxy S Plus logo, so just when the bootanimation starts. The easiest way to enter your phone in this part is using a batch script that monitors the state of your device and connects directly when possible.
I use this script for example (requires adb.exe and the 2 dlls)
Code:
@echo off
cd /d %~dp0
echo.
echo Waiting for device...
adb wait-for-device
echo.
adb -d shell stop
adb push mycwmfix.zip /sdcard/mycwmfix.zip
adb reboot recovery
This script will wait for the device to become ready, when it's ready it freeze the device, so the script has more time to push the file (instead of keep rebooting). Then it will push the specified cwmfix zip to your sdcard, and after that it will reboot in recovery so you can install the cwm fix you made.
You can also make an batch script that pushes the files automatically to your phone, here is an example:
Code:
@echo off
cd /d %~dp0
echo.
echo Waiting for device...
adb wait-for-device
echo.
adb -d shell stop
adb -d shell su -c "mount -o remount rw /system"
adb push framework-res.apk /system/framework/framework-res.apk
adb -d shell chmod 644 /system/framework/framework-res.apk
adb push SystemUI.apk /system/app/SystemUI.apk
adb -d shell chmod 644 /system/app/SystemUI.apk
adb reboot
This script will wait for the device to become ready, when it's ready it freeze the device, so the script has more time to push the file (instead of keep rebooting). Then it will push framework-res.apk and SystemUI.apk to the directory it belongs to, after that it changes the permissions of the files to RW-R-R (644) and then it will reboot.
I hope you learned something from this tutorial, when I think I forgot something Ill add it later.
Click to expand...
Click to collapse
Hey,
After trying to make a backup using cwm my phone got caught on a bootloop. I think the backup was not completed and I believe there was some sort of error (something about an image not being copied, I think). There is also a warning on the cwm recovery page that says "no file-context". What can I do?
Thank you
vascotto said:
Hey,
After trying to make a backup using cwm my phone got caught on a bootloop. I think the backup was not completed and I believe there was some sort of error (something about an image not being copied, I think). There is also a warning on the cwm recovery page that says "no file-context". What can I do?
Thank you
Click to expand...
Click to collapse
do you mean you flashed a backup and it is boot looping?
sa1tine said:
do you mean you flashed a backup and it is boot looping?
Click to expand...
Click to collapse
I was creating a backup of my current ROM (which is the default, factory version).
vascotto said:
Hey,
After trying to make a backup using cwm my phone got caught on a bootloop. I think the backup was not completed and I believe there was some sort of error (something about an image not being copied, I think). There is also a warning on the cwm recovery page that says "no file-context". What can I do?
Thank you
Click to expand...
Click to collapse
Probably your device ran out of free space. Try to delete some backups you've made before.
Hi,
I have CyanogenMod 10 installed on my I9001 and it worked perfectly for the past few months until I rebooted the phone today and now it is stuck on the CyanogenMod start screen. I had not installed/modified anything on my phone before rebooting...
I tried to wipe cache, but that did not help. Any idea how to fix this without deleting everything from the phone?
Thanks!!

[DUAL_BOOT]Dual booting an android phone with an extrrnal SD card

So here you come. To read and perform this tutorial, you obviously need a first hand experience on flashing a ROM and/or kernels. Otherwise this tutorial and my efforts to get you a device with two OSes running might end up giving you a bricked device. So, if you're hearing the terms "flashing" or 'kernels' for the first time and thinking it's kinda good food, then bro, just go and taste those first.
Something's to remind before we gonna dig deep into this tutorial->
1> Noone but you will be responsible for what you end up with.
2> The warranty of your device will be voided after this if it isn't already after rooting. For MI users, the good news is that you can reclaim it by just flashing the fastboot ROM for your device.
Enough lectures. Bro let's get to work.
This you'll be needing =>
1> One working Windows PC(because I doesn't know any replacement of bootimg.exe on any other OS. If you know, then let me).
2> A class 10 memory card ( I recommend 32GB for the spaces)
3> A custom ROM and kernel for your phone(the second os)
4> Any custom CWM based recovery installed.(since TWRP is most popular, I will demonstrate using it. You can use any other you want overall process will be the same)
5> ADB, fastboot and the device drivers (easily found in XDA)
PART 1: MODIFYING THE BOOT
At first, how does your device boots up? What are the partitions called /data and /system? The answer is quite simple. It's your kernel that points out the location from where the OS should be picked up. So for booting into the second OS we need some modifications to it at first.
Search and download bootimg.exe on XDA, I'll post a link later. Create two folders. Name them "Internal OS" and "External OS" respectively. Put the zip file of the OS you're currently using to the first one and the OS you're gonna use on the external storage to the second one. Rename the second OS to originalExternalOS.zip. Extract originalExternalOS.zip. Pick the boot.img file from the root of the extracted folder and move it to a new folder named "boot2". Extract the IMG using bootimg.exe. Navigate to the initrd folder and you will get a file named 'fstab".
Basically it's the file that tells the kernel which partition does the OS resides in.
Open the file in your favourite text editor.
Replace every instance of the first line with the second one:
/dev/block/bootdevice/by-name/system => /dev/block/mmcblk1p2
/dev/block/bootdevice/by-name/userdata => /dev/block/mmcblk1p3
/dev/block/bootdevice/by-name/cache => /dev/block/mmcblk1p4
Save the file without giving any extension to it. Repack it using the same tool. You'll have boot-new.img and boot-old.img. Rename boot-new.img to boot.img and replace the one in the root folder with this. Basically what we're doing here is replacing the old boot.img with the modified one.
For your knowledge, blocks are the partitions of any storage you have on your device. For example, your internal storage is partitioned to near about 30 different blocks each starting with prefix "mmcblk0p". We here just told the kernel to load the OS from the blocks mentioned. We'll be creating these blocks in the external SD card next.
PART 2: PARTITIONING THE SD CARD
Connect your device with the memory card inserted to your PC. If you haven't installed fastboot, ADB, and the drivers, do it now.
READ THE FOLLOWING CAREFULLY
Reboot the device to recovery mode. Type the commands in cmd:
Code:
adb shell
parted
unit MB
print
quit
umount external_sd
Read and store the minimum and maximum capacity of your card. Since different cards will have different capacities I will point it as variable MIN_SIZE and MAX_SIZE. You'll need to calculate and put the values in the commands. Now type the following commands on cmd:
Code:
parted /dev/block/mmcblk1
rm 1
//START_BLOCK = MAX_SIZE - 5000
mkpartfs primary fat32 MIN_SIZE START_BLOCK
//SYS_START = START_BLOCK+1
//SYS_END = SYS_START + 1200
mkpartfs primary ext2 SYS_START SYS_END
//DATA_START = SYS_END+1
//DATA_END = DATA_START + 3500
mkpartfs primary ext2 DATA_START DATA_END
//CACHE_START = DATA_END + 1
mkpartfs primary ext2 CACHE_START MAX_SIZE
//We have partitioned the memory card. Let's format them. Ignore all "Do you wish to continue" question in the next commands as we're already mentioning yes.
mkfs yes 1 fat32
mkfs yes 2 ext2
mkfs yes 3 ext2
mkfs yes 4 ext2
quit
//Now they are almost ready. Just make the newly created blocks readable by the OS.
make_ext4fs /dev/block/mmcblk1p2
make_ext4fs /dev/block/mmcblk1p3
make_ext4fs /dev/block/mmcblk1p4
//Now you get where does the blocks come in the kernel right?
exit
//You've covered up the hardest part. Let's get some coffee and cheeerssss.
PART 3: MODIFYING THE NEW OS
You've left the OS extracted in the "External OS" folder right? It's time to do some magic in it. We're gonna tell the OS to be installed in the blocks we created just like the kernel. But wait, where does the OS know before installing where it should get installed? Well, the answer hides in the updater-script in the folder META-INF > com > google > android. Navigate yourself in it. Open the updater-script file in your favourite editor ( I use notepad++ ) and modify it in the same way as the kernel.
Replace every instance of the first line with the second one:
/dev/block/bootdevice/by-name/system => /dev/block/mmcblk1p2
/dev/block/bootdevice/by-name/userdata => /dev/block/mmcblk1p3
Leave the /dev/block/bootdevice/by-name/boot as it's the fundamental block and we can't replicate it. Don't think for the /cache partition as we've already done that in the boot.img file. Now navigate to the root of the folder where you extracted the External OS. Select all files, add them to a zip file using WinRAR. Name the file to newOS.zip. Open newOs.zip and originalExternalOS.zip with WinRAR and compare them if you find any change in the folder tree. They must and they should be exactly the same. You're 80% done.
PART 4: MODIFYING THE RECOVERY
We often flash many zips including very popular Xposed and other mods to our OS right? They also look for the /system partition. So what are we gonna do? Modifying each of them? Nah. Let's modify where they get which one the /system is. The recovery. Extract the img of the recovery you're using with the same bootimg.exe. Modify exactly the same things. I.e.
Replace every instance of the first line with the second one:
/dev/block/bootdevice/by-name/system => /dev/block/mmcblk1p2
/dev/block/bootdevice/by-name/userdata => /dev/block/mmcblk1p3
/dev/block/bootdevice/by-name/cache => /dev/block/mmcblk1p4
in the following files : initrd/fstab.qcom
initrd/etc/recovery.fstab
initrd/etc/twrp.fstab(For TWRP only)
Save them. Repack. And you got your recovery-new.img and recovery-old.img. Put recovery-new.img and newOS.zip in the same folder. Now wake up, it's time for some action.
PART 5 : INSTALLING THE OS
Open cmd in the folder where newOS.zip resides. Reboot the devixe in fastboot mode. Type the following commands:
Code:
adb push newOS.zip external_sd
fastboot flash recovery recovery-new.img
fastboot boot recovery
Now your device should boot up in recovery mode. To check if everything has gone fine mount system using TWRP. Use twrp's built in file manager and navigate to system folder. It's empty? Yup. You've done a great job. Now flash the newOS.zip using TWRP and your device should boot up in the new OS. To cross check again remove the SD card and try to boot. If you're headed towards recovery or bootloop after that then it's a win. Put the SD card back again and watch the new OS to boot.
PART 6: SWITCHING BETWEEN THE TWO
Extract the boot.img from the "Internal OS" zip file and put it together with recovery-old.img. To check if your old system is untouched type the following commands in fastboot mode:
Code:
fastboot flash recovery recovery-old.img
fastboot flash boot boot.img
fastboot boot system
Your device should take you back to the old one. Surprised? Now let's make a switch between the two. There are two methods.
METHOD 1: USING FLASHIFY
Create two folders in your SD card. Put boot.img and recovery-old.img to one and boot-new.img and recovery-new.img to the other. To switch to the external OS, just flash boot-new.img as boot and recovery-new.img using flashify. Ignore reboot now dialog and reboot directly to the system. To go back, first install flashify in the new OS and flash boot.img and recovery-old.img. Easy right?
METHOD 2: USING ZIPS
I'm gonna tell you that tomorrow as I can write no more today.
More to come....
CREDITS:
justzzshadz from MIUI forum for this revolutionary concept. @iamsubhranil for adding TWRP, Flashify support and completely rewriting the tutorial.

Categories

Resources