[ETC] Flashable File to Create Bootable SDCard for Nook Tablet - Barnes & Noble Nook Tablet

I AM NOT RESPONSIBLE IF YOU DAMAGED YOUR SDCARD OR NOOK TABLET
WHAT IS THIS?
It's a flashable file (a file that you can install from recovery) that will create a bootable SDCard for your Nook Tablet.
What it does is creates 4 partitions on your SDCard.
100MB for partition 1 (BOOT)
400MB for partition 2 (SYSTEM1)
Size for partition 3 (DATA1) and partition 4 (SDCARD) vary.
It'll also copy over boot files to your SDCard, making the SDCard bootable on your Nook Tablet.
INSTRUCTIONS:
This will only work with the provided CWM 6.0.2.9 because it contains fdisk with advanced options.
Format your SDCard with SDFormatter if you are on Windows and OSX. Linux? GParted.
Copy CWM 6.0.2.9 recovery (renamed the internal recovery img to recovery.img) to your SDCard.
Copy flashable_create_bootable_sdcard.zip to your internal storage.
if [ Stock_Rom ]; then
# If you are still on Stock Rom, you need to be rooted and have terminal installed.
# Open up terminal.
# Backup stock recovery
su
dd if=/dev/block/mmcblk0p3 of=/sdcard/stock_recovery.img
# Store the stock_recovery.img on your computer for future need.
# Install CWM 6.0.2.9 recovery
dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p3
# Boot to recovery. Power up device by holding Power + Home keys.
else
# If you already have previous CWM version of recovery installed, just flash the new one.
reboot recovery
fi
Insert formatted SDCard.
Make sure the USB cable is not plugged into your computer.
1) Install zip from sdcard
- choose zip from internal sdcard
- flashable_create_bootable_sdcard.zip
Ignored the "can't unmount /dev/block/mmcblk1p1".
Be patient with the loading bar. It's not frozen, just wait.
The larger the data1 size, the longer the process take.
Power off device and turn it on again.
If successful, it will boot into Cyanoboot.
Then you can install *SDC Rom.
The default data1 (Partition 3) size is 600MB in flashable_create_bootable_sdcard.zip.
My recommendation.
600MB is for 2GB SDCard
1000MB is for 4GB SDCard
2000MB is for 8GB SDCard
3000MB is for 16GB-64GB SDCard
To make data1 size larger, just rename the file 'createsd_*.sh' to 'createsd.sh' inside flashable_create_bootable_sdcard.zip.
createsd_600MB.sh
createsd_1000MB.sh
createsd_2000MB.sh
createsd_3000MB.sh
*added 4000MB and 5000MB scripts. Rename createsd_X000MB.sh.txt to createsd.sh.
Do test and tell. I've only tested on 2GB, 4GB, and 32GB sdcard.

I'm curious how I go about installing a rom onto the sd card after i have this?

Koneesha said:
I'm curious how I go about installing a rom onto the sd card after i have this?
Click to expand...
Click to collapse
There should be a guide on how to flash ROMs to SD somewhere in the forum...it was intended for making a triple boot Nook...although the scripts may not work for CM10/10.1 as they were for CM7/9
If you find it (back 1-2 pages) you could use it, if I find it I'll link you...

http://forum.xda-developers.com/nook-hd?nocache=1&z=7773671285249293
If you indeed have a Nook HDplus, then you are posting in the wrong forum. Try posting in a HD+ forum and perhaps someone might be willing to help, in spite of your rather abrasive attitude.

SD-based CM11 ROMs for HD+:
http://forum.xda-developers.com/showthread.php?t=2583952
http://forum.xda-developers.com/showthread.php?t=2600572
http://iamafanof.wordpress.com/2013/12/20/cm11-0-kitkat-android-4-4-2-for-nook-hd-xx-20dec2013/

Related

BCB, BootCnt, and the bootdata partition

Maybe some of you guys have figured this out already but it's probably important to note for people developing custom recovery or boot ROMs.
There is a partition on the internal flash named "bootdata" that stores a files named BCB and BootCnt. The secure bootloader updates BootCnt on every non-sdcard boot and if it gets too high it will automatically boot into the recovery partition instead of the boot partition. So, if you're making any custom ROM to be run from the internal flash then you'll want to reset that file in a boot script somewhere. The shell command "dd if=/dev/zero of=/bootdata/BootCnt bs=1 count=4" would do it (Assuming you've mounted the bootdata partition )
The BCB file is similar in that if the secure bootloader boots into the recovery partition for any reason, it will write to that file and will always boot into the recovery partition until that file is cleared. The shell command to clear that file is "dd if=/dev/zero of=/bootdata/BCB bs=1 count=1088"
The bootdata partition just contains a standard vfat filesystem so you just mount it normally.
And for the love of your god do not delete those files! If you do then booting from internal memory will continue to boot into the recovery partition until they are replaced. You would be able to boot from an SD card to replace them though.
bauwks said:
Maybe some of you guys have figured this out already but it's probably important to note for people developing custom recovery or boot ROMs.
There is a partition on the internal flash named "bootdata" that stores a files named BCB and BootCnt. The secure bootloader updates BootCnt on every non-sdcard boot and if it gets too high it will automatically boot into the recovery partition instead of the boot partition. So, if you're making any custom ROM to be run from the internal flash then you'll want to reset that file in a boot script somewhere. The shell command "dd if=/dev/zero of=/bootdata/BootCnt bs=1 count=4" would do it (Assuming you've mounted the bootdata partition )
The BCB file is similar in that if the secure bootloader boots into the recovery partition for any reason, it will write to that file and will always boot into the recovery partition until that file is cleared. The shell command to clear that file is "dd if=/dev/zero of=/bootdata/BCB bs=1 count=1088"
The bootdata partition just contains a standard vfat filesystem so you just mount it normally.
And for the love of your god do not delete those files! If you do then booting from internal memory will continue to boot into the recovery partition until they are replaced. You would be able to boot from an SD card to replace them though.
Click to expand...
Click to collapse
Yup. On the NookColor these had the same functions. Lived on /rom instead of /bootdata however.
Note: My CWM image doesn't probably handle BCB or bootcnt yet (I do in my CM9 image but that is another thing )
nemith said:
Yup. On the NookColor these had the same functions. Lived on /rom instead of /bootdata however.
Note: My CWM image doesn't probably handle BCB or bootcnt yet (I do in my CM9 image but that is another thing )
Click to expand...
Click to collapse
My Ubuntu image does not mount this partition.
bauwks said:
Maybe some of you guys have figured this out already but it's probably important to note for people developing custom recovery or boot ROMs.
And for the love of your god do not delete those files! If you do then booting from internal memory will continue to boot into the recovery partition until they are replaced. You would be able to boot from an SD card to replace them though.
Click to expand...
Click to collapse
Yep-- this is all taken care of in cm9
Update: I don't think you mentioned, but for completeness, there's also the serial file in /rom at devconf/DeviceId that will trigger a rom reformat if it goes missing. there are also some edge conditions that will trigger recovery/flashing such as the presence of certain update.zip files on SD. Also SD boots are treated differently by default, don't increase the boot count, etc. In short, this is very similar to how NookColor works with the added disadvantage of having to deal with, rather than simply ignore or remove, these various "go to recovery' conditions.
I can verify that Bauwks script works and allows internal booting without a bootloop.
Nemith, if you find the time can you add something like this to your CWM recovery.img? I think just adding the /bootdata mount and dd calls to the init.rc file should work. I was going to build my own CWM .img but figured you already had the source code handy.
I'de like to dabble in a CM7 port soon, while CM9 and Ubuntu ports are in-work
Thanks for all your hard work guys!
CWM recovery bootloop
bauwks said:
And for the love of your god do not delete those files! If you do then booting from internal memory will continue to boot into the recovery partition until they are replaced. You would be able to boot from an SD card to replace them though.
Click to expand...
Click to collapse
I flashed cm9 alpha 0.2 on my nook tablet using the nook tablet recovery apk. It booted into cyanoboot, however it had an error message that said disc majic error. I noticed I had put the wrong boot image on my sd card from the alpha 0.1. I rebooted 8 times and booted into cwm. Now in cwm I flashed a backup of my tablet. I then made the common mistake of clicking reboot recovery. Then trying to fix the bootloop into cwm recovery while unaware of the sevarity of what I was doing I went into mounts and storage and formated each bootdata, cache, data, emmc, rom, and system. I just restored my backup again and now I know what I need to do. My stock Nook recovery was overwriten when I clicked reboot recovery. Also I formated my rom folder and that might have contained my serial number and info.
I basicaly deleted my partions. while stuck in the cwm boot loop. Can you please send me or send me the link to a step by step way that I can get my nook tablet 16gb stuck in the cwm boot loop back to normal.
I tried using fastboot but I dont know the commands to open it. Also I dont know how to use adb either. I have a 2gig, and a 256 mb micro sd. I have a windows pc. Can you show me step by step how to restore those partions, how to do it on adb or fastboot, or the update zip method. I need help as soon as possible. Thanks.
Its similar to this
This seems like the only place folks are looking at bcb in much detail, so I thought I'd post an observation: on the simple touch, if you boot from noogie after issuing an "erase and deregister" command from the OS, the bcb file contains command strings.
I don't know what reads the strings, but after erase and deregister, bcb seems to be used to tell the device to run recovery:
recovery --wipe_data
is an ascii string from bcb on a deregistered and not yet rebooted glowworm - I put the noogie disk in, did the erase and deregister, then dumped the partitions once it came back up.
the command flags available in recovery as of cupcake are documented at
http://www.netmite.com/android/mydroid/cupcake/bootable/recovery/recovery.c
Just wanted to bump this so more people know about it, because I didn't and I reformat my /bootdata.
Can anyone make an image of it for restore purposes?
An image of /factory would be nice as well But less important as we're all (likely) using CM.
edit
Actually disregard this.. I have the nook hd+, but the /bootdata format info will probably be handy for any nook device.
Don't format bootdata or factory!
roustabout said:
This seems like the only place folks are looking at bcb in much detail, so I thought I'd post an observation: on the simple touch, if you boot from noogie after issuing an "erase and deregister" command from the OS, the bcb file contains command strings.
I don't know what reads the strings, but after erase and deregister, bcb seems to be used to tell the device to run recovery:
recovery --wipe_data
is an ascii string from bcb on a deregistered and not yet rebooted glowworm - I put the noogie disk in, did the erase and deregister, then dumped the partitions once it came back up.
the command flags available in recovery as of cupcake are documented at
http://www.netmite.com/android/mydroid/cupcake/bootable/recovery/recovery.c
Click to expand...
Click to collapse
pbassjunk said:
Just wanted to bump this so more people know about it, because I didn't and I reformat my /bootdata.
Can anyone make an image of it for restore purposes?
Click to expand...
Click to collapse
To fix the Recovery Boot Loop caused by invalid/missing BCB and BootCnt in /bootdata, flash Succulent's flashable_fix_bootloop.zip posted at his blog http://iamafanof.wordpress.com/2013...-1-jellybean-sdcard-img-for-nook-tablet-0110/ (see under heading "I am stuck in a recovery boot loop?").
An image of /factory would be nice as well But less important as we're all (likely) using CM.
Click to expand...
Click to collapse
/factory contains a backup copy of stock ROM as well as a backup copy of the device data in /rom partition (romdata.zip), the latter includes data that is unique to each Nook (such as MAC address, security certificate, etc.) and hence is not replaceable with a copy from another Nook.
...
Don't format bootdata or factory!
Click to expand...
Click to collapse
Nor /romdata. See http://forum.xda-developers.com/showpost.php?p=37515697&postcount=31 for more info.
I created a flashable zip as well, which should reset that partition to a stock (zero-count) state. Hopefully it's not unique per device (I don't think it is, as I've used this successfully on two distinct devices.)
Is a fix being baked into any official roms, CM and the like? I don't mind the workaround via scripting, but the two I bought and modded I gave as gifts, so when they break (they both have) I definitely hear about it and receive the units back again for fixing.
ZIP is attached. Please let me know if it works or doesn't work for you, should you end up using it.
weasel5i2 said:
I created a flashable zip as well, which should reset that partition to a stock (zero-count) state. Hopefully it's not unique per device (I don't think it is, as I've used this successfully on two distinct devices.)
Is a fix being baked into any official roms, CM and the like? I don't mind the workaround via scripting, but the two I bought and modded I gave as gifts, so when they break (they both have) I definitely hear about it and receive the units back again for fixing.
ZIP is attached. Please let me know if it works or doesn't work for you, should you end up using it.
Click to expand...
Click to collapse
Having trouble with the /bootdata/BCB/ and my nook hd+ booting into recovery. Am I just supposed to flash the fix to the SD card boot partition?
tinkering said:
Having trouble with the /bootdata/BCB/ and my nook hd+ booting into recovery. Am I just supposed to flash the fix to the SD card boot partition?
Click to expand...
Click to collapse
You might want to see leapinlar's tip #10 in his post http://forum.xda-developers.com/showpost.php?p=35811322&postcount=1 for the Nook HD/HD+.
digixmax said:
You might want to see leapinlar's tip #10 in his post http://forum.xda-developers.com/showpost.php?p=35811322&postcount=1 for the Nook HD/HD+.
Click to expand...
Click to collapse
Thanks for the link to leapinlar's post. That helps me to understand the problem and fix a bit better. I didn't see the zip that seemed to fit my situation on his post. I did a SD install non-rooted and I see only only emmc fixes on his post. I tried your fix with these steps and I must have done something wrong. Maybe you could point me in the right direction.
DL, unzip, write image to sd using PC(could only write the .img, don't know what to do with the folder) , put SD into nook HD+, try to boot= no boot
Does the device have to be rooted to flash the repair zip? I don't think I am utilizing the fix properly.
tinkering said:
...
DL, unzip, write image to sd using PC(could only write the .img, don't know what to do with the folder) , put SD into nook HD+, try to boot= no boot
Does the device have to be rooted to flash the repair zip? I don't think I am utilizing the fix properly.
Click to expand...
Click to collapse
No, the device does not have to be rooted to get flashed.
If this is your first time trying to boot off SD, it's possible that your HD+ is one of the units that have difficulty booting off SD card -- see http://forum.xda-developers.com/showthread.php?t=2288688.
Is your device still on stock ROM and stock Recovery?
digixmax said:
No, the device does not have to be rooted to get flashed.
If this is your first time trying to boot off SD, it's possible that your HD+ is one of the units that have difficulty booting off SD card -- see http://forum.xda-developers.com/showthread.php?t=2288688.
Is your device still on stock ROM and stock Recovery?
Click to expand...
Click to collapse
Sorry, I probably should have updated my last post. I was attempting to flash the repair incorrectly. Unfortunately, I have a new problem and have moved my question to the "[Q][Panic] HD+ won't boot, can access CWM SD but can't mount sdcard or emmc" thread.
The device would boot from SD. Was running CM10.2 and CWM recovery. The trouble I am having now is that I can't flash anything from the SD in CWM recovery because it wont mount the SD. (See details in thread referenced above.)
Thanks

My nook tablet is in CWM bootloop tried everything

Hey guys, today i was messing around with my nook tablet and i tried to restore it and i acidently deleted everything. now when ever i boot its goes straight to CWM recovery. ive tried to flash recovery and stock reboot and nothing worked. Is there anyway to restore it using usb or anything else? thanks.
I ran into similar difficulty with this earlier today. What worked for me eventually was using
the CMW Windows installer on my SD card, which nerfed it down from 32GB to 2GB,
formatted that 2GB partition,
put the "acclaim_update.zip" folder in the root,
inserted the sd card,
plugged the tablet into the charger,
power+n cycled once, then regular boot and it went it.
Your results may vary, though. It took a few tries before I finally got it to boot from SD
How exactly do i do that?
Fix for the Cyanoboot CWM bootlooping...
It could help someone, haven't seen this simple fix around so i decided to post it up here.
1. boot into CWM from sdcard, see here to download the sdcard version , instructions to burn the image to your sdcard are there too.
2. once you have finished burning the image into your sdcard you will see the size of your sdcard will be reduced to less than 50 MB, CLICK on your sdcard and you will see some files in there.
3. Download 8gb-16gb_cwm_internal.zip from my thread and copy-paste it to your sdcard so you can flash CWM internal using CWM sdcard version. HOPE YOU DONT GET CONFUSED.
4. Safely eject your sdcard from PC, power off your nook(long press power button), put the sdcard back into your nook, power on your nook.
5. It will boot into CWM sdcard then flash 8gb-16gb_cwm_internal.zip, reflash the ROM of your like (It should be on Internal sdcard, you can also swap to another sdcard containing the ROM while in CWM sdcard or resize CWM sdcard [50mb] with a partition tool software so you can copy a ROM to it).
6. Remove the sdcard from your Nook and select reboot system now from CWM
Done!
Your Nook tablet should now boot normally!!!
NOTE: the 8gb-16gb_cwm_internal.zip made by @succulent has few options missing so consider to install another internal CWM later. This process will just make you fix the bootlooping process and boot your device normally.
~ V
Flash "acclaim_update.zip"
I recently made a thread on how to flash "acclaim_update.zip" in CWM so head on over to it and see if it works for you and remember do a factory reset from CWM. http://forum.xda-developers.com/showthread.php?t=1762024

[Q] Can't install CM10.2 from TWRP??

THE PROBLEM: Can't get TWRP to install cm_acclaim_10.2_12NOV2013_HD.
So I am using the SD boot files (flashingb boot, MLO, u-boot, and recovery) with openrecovery-twrp-2.6.3.1-acclaim-sdcard.img renamed to altboot.img to try and install cm_acclaim_10.2_12NOV2013_HD and GAPPS (an October version?) to EMMC on my Nook Tablet. So what I've done:
SD Card:
1. Formatted card with SDFormatter
2. Partitioned 500MB space in FAT32, set to primary, set to active. Named partition "BOOT"
3. Put on the 4 SDBoot img files, cm_acclaim_10.2_12NOV2013_HD, AND GAPPS
Installing
1. Used recovery.img (pretty much stock recovery) to wipe cache/factory reset, wipe cache partition, wipe Dalvik.
2. Rebooted and opened altboot (TWRP), selected install >> external SD >> cm_acclaim_10.2_12NOV2013_HD
3. TWRP says it cannot install cm_acclaim_10.2_12NOV2013_HD (bad file). What gives?
I've tried several different zip ROMS, and I've tried reformatting the card several times. I'm stumped. Would really like to get this done and have 10.2 on eMMc. Any tips?
One more important thing, I am not burning the img onto the card with win32diskimager because I didn't think you could "burn" multiple images into one card. So I've been just dragging them in. Still takes me to boot screen, sooooo...........
I guess I am just stuck on how to get TWRP to accurately flash the ROM to eMMC. Should I move the CM10.2 to internal storage and point TWRP there to flash the system?
Is there a reason why that you opted to use TWRP v2.6.3.1?
I'd suggest that you try using CWM v6.0.2.8 (which should be available at http://goo.im/devs/succulent/acclaim/recovery), it's known to work: I used it successfully to flash 10.0 through 10.2 (see http://forum.xda-developers.com/showpost.php?p=43326042&postcount=123 for more info).

[Q] Space on SD card

Hi!
Partitioned my 32GB sdcard, and put CM10.2 on it, but when I check it I have only about 400mb of space or something like that. I had the same amount of space on a 4GB sdcard I used before. Why am I not able to use up the rest of the GB's?! Can someone tell me how to fix it, I don't know if I'm partitioning wrong or doing something wrong, but I want to be able to have lots of extra space for music, apps, etc. Please help! Thanks!!!
I believe you used a low level utility like dd or similar to flash an image onto a partition.
You need to run fsck on that partition, then run resize2fs to expand the ext2/3/4 partition.
Let's say your partition is /dev/block/mmcblk1p1
You would do (in a terminal):
adb reboot recovery
adb shell
# umount /dev/block/mmcblk1p1
# e2fsck /dev/block/mmcblk1p1
# resize2fs /dev/block/mmcblk1p1
After that, your partition will get expanded to whatever size you made it.
It takes a while so be patient. The larger the partition, the longer it will take.
Zenile said:
Hi!
Partitioned my 32GB sdcard, and put CM10.2 on it, but when I check it I have only about 400mb of space or something like that. I had the same amount of space on a 4GB sdcard I used before. Why am I not able to use up the rest of the GB's?! Can someone tell me how to fix it, I don't know if I'm partitioning wrong or doing something wrong, but I want to be able to have lots of extra space for music, apps, etc. Please help! Thanks!!!
Click to expand...
Click to collapse
if you got a prebaked image of a bootable cm card from somewhere, then it usually has 4 partitions on it that were set to the sizes the author of the card specified.
/boot
/system
/data
/sdcard
You would need to put the card in a PC, and use a disk partitioning utility to resize the partitions
some of the images include additional flash files that you install to expand the card's partitions for you. (succulent's), but
you have to do it as you install for the first time.
I prefer to build the card empty first, and load the boot files and zips manually.
linux tools like gparted, Parted Magic , booting from a live USB or CD work pretty well.
Windows based ones like Easus Partition master, or Paragon, not so good.
Mini Tool partition wizard (windows/free) sometimes works
this looks to be a decent write up
http://www.mobileread.com/forums/showthread.php?t=202660
mikeataol said:
...
I prefer to build the card empty first, and load the boot files and zips manually.
linux tools like gparted, Parted Magic , booting from a live USB or CD work pretty well.
Windows based ones like Easus Partition master, or Paragon, not so good.
Mini Tool partition wizard (windows/free) sometimes works
this looks to be a decent write up
http://www.mobileread.com/forums/showthread.php?t=202660
Click to expand...
Click to collapse
The write-up is also posted on XDA at http://forum.xda-developers.com/showthread.php?t=2098419. It was written back in the days of CM10.1, so to use it for CM10.2 or CM11:
Obtain the boot files: MLO, u-boot.bin, and flashing_boot.img -- as well as the files boot.img and recovery.img, from the /boot partition of the pre-made SD CM image. Make sure that MLO is the first file to copy to the freshly made /boot partition.
Substitute in the appropriate ROM and Gapps zip files corresponding to the particular CM build of interest.

[Sony Tablet S][CM9] Sys2sd - Start Android from the SD Card

This is a framework to help "boot" Android from the external SD card.
[size=+3]Motivation:[/size]
I started this because I would like to have Xposed Framework installed in my STS, but I do not want to take ANY risks of bootloop modifying internal system partition. This way I made this framework to allow me to "boot" a copy of Android resident in the external SD card, so that in case of bootloop, I simple eject the SD card and boot from internal Android.
[size=+3]News:[/size]
{new} - 2014/07/29 - New Sys2sdManager V2, supporting ROM ramdisks (custom ROMs), and some bugfixes. Please install, "unhook" and then "hook" again the sys2sd framework for the changes to take effect. There is a new recovery too, so choose the menu option to install the recovery package.
{new} - 2014/07/29 - First CM9 ROM for the STS (alpha stage). Please read the #2 topic for details.
{new} - 2014/07/28 - I am working on a port of CM9 for the Sony Tablet S using the sys2sd framework.
[size=+3]How it works[/size]
First, you must partition your external SD card, and then clone system and data from internal to external sdcard.
Next, during the normal boot process, the framework intercepts the process, test for the existence of the previously prepared external SD card, and if found it pauses the internal boot process, mounts /data and /system partition from the SD card, and then resumes the boot process.
[size=+3]Features[/size]
- Boot Android from external SD card (mount SYSTEM and DATA from external SD card).
- Functional recovery framework, using adapted TWRP from Motorola Xoom tablet.
- The recovery package can reside in internal or external storage.
- Recovery wait time with LED notification and triggering via hardware keypress.
- Can boot other versions of Android compatible with the stock STS ramdisk (custom ROMs).
- (work in progress): can boot other versions of Android with alternative ramdisk.
[size=+3]Bootloop Safety[/size]
- Only hook into 1 internal system script: /system/etc/install-recovery.sh (or install-recovery2.sh if present)
- With no external SD card present, the internal boot process takes precedence unmodified.
- /data and /system residing in external SD card, so if one mess the external /data ou /system directory, the bootloop will be limited to booting from the external sdcard.
- Working recovery: you can apply zip or backup and restore (tested!) your external SD card data and system partion. All modifications in data and system will be limited to the external SD card.
[size=+3]Limitations[/size]
- All modifications must work with the stock STS kernel. No custom kernels until kexec or unlocked bootloader.
- Write speed of the SD card.
[size=+3]Requisites[/size]
- Rooted Android 4.0.3 Sony Tablet S.
- busybox installed in /system/xbin, containing the functions: mount, tar, gzip, awk, sed. I recommend Stericson Busybox Installer on the Play Store. {new} If you do not have buysybox, the installer will install one for you.
- External SD card of size 8Gb or more, SD or Microsd. See the Drawbacks section for speed class information.
- Partitioning software to partition the external SD card. I recommend Mini Tool Partition Wizard for Windows, or GParted for Linux.
[size=+3]Drawbacks[/size]
[size=+2]Speed[/size]
Because the STS will be running Android from the external SD card (system and data), this framework heavly depends on the SD card read and write speed for disk IO.
I have tested the framework with the following SD card classes:
App loading, closing, and file IO:
Microsd class 4: damn slow browsing
Microsd class 6: slow
Microsd class 10: fast, like internal storage
Gaming:
Microsd class 4: slow loading times, gaming normal
Microsd class 6: slow loading times, gaming normal
Microsd class 10: normal
Boot process:
+20 to 40 seconds delay
[size=+3]How it works - Technical details[/size]
[size=+1]The framework executes the following steps during the boot from sd process[/size]
- Intercepts the internal Android boot process via the /system/etc/install_recovery script, then looks for the special partitioned external sdcard, and if not found resumes the normal Android boot process. Otherwise, keep executing.
- Stops the normal Android boot process, stopping all init services.
- Try to soft boot into recovery (explained bellow) if got user keypress. If the recovery process was not started, the framework resumes execution.
- Umount /data and /system from the internal flash storage.
- Mount /data and /system from the external SD card partitions.
- Restart all services and resume boot
[size=+1]The framework executes the following steps during the recovery start process[/size]
- Searches for a recovery package (recovery.tgz), in the external and internal storage system partition. If not found, cancels the recovery start process.
- If recovery package found, blinks the notification LED (blue color) and waits for user keypress to enter recovery. The recovery can also be triggered by a special recovery file present in the /cache/recovey directory (boot, command or extendedcommand files).
- If the user press some key in the wait interval or any special file are found then the recovery process continues. Otherwise, cancels the process.
- Stop all init services
- Decompress the recovery package, like a recovery ramdisk
- Umount all file systems, including internal and external storage, DM and Vold volumes.
- Soft boot the recovery Ramdisk using CHROOT busybox command
- Note: if you want to build your own alternative recovery package, special care must be taken for the /system and /data partitions in the /etc/recovery.fstab recovery file.
[size=+1]External SD card partitioning[/size]
- I recommend that the partitions in the external SD card be aligned to 4MB boundaries (8192 blocks).
- The internal /data and /system can be mirrored manualy using the following commands:
Code:
#### mount external /system in /mnt/newsys
#### mount external /data in /mnt/newdat
busybox mount -o remount,rw /
busybox mkdir -p /mnt/newsys
busybox mkdir -p /mnt/newdat
busybox mount /dev/block/mmcblk1p2 /mnt/newsys
busybox mount /dev/block/mmcblk1p3 /mnt/newdat
#### copy files
cd /system ; busybox cp -a * /mnt/newsys
cd /data ; busybox cp -a * /mnt/newdat
busybox umount /mnt/newsys
busybox umount /mnt/newdat
[size=+3]Getting started[/size]
1) Get an external SD Card and partition/format it
2) Install sys2sd into STS
3) Clone internal data and system to external SD card
4) Boot STS with external SD card inserted
5) Identify the internal and external system (important)
6) Install recovery in external SD card
[size=+1]1) Get an external SD Card and partition/format it[/size]
You must parition your external SD card before using this framework. I recommend you to use "Mini Tool Partition Wizard" for Windows, or "GParted" for Linux. I like to use fdisk for Linux, too.
I recommend that the partitions in the external SD card be aligned to 4MB boundaries (8192 blocks) for maximal write speed.
All partitions must be primary partitions. You must create 3 partitions:
- 1: Type fat32/vfat. This will be your "external sdcard" by the point of view of the Android or Recovery. The "internal sdcard" will stay the same, at the internal flash storage.
- 2: Type ext4 (without journal if you have the option). This will be your "/system" partition (system apps and Android core). For your information, the internal system for 4.0.3 Sony firmware takes about 300Mb, so this must be somewhat bigger, like 400Mb or more. I use 1Gb, in preparation for custom ROMs.
- 3: Type ext4 (without journal if possible). This will be your "/data" partition (user apps and data). Mine is 4Gb larger.
Do not forget to format the partitions after partitioning. Do not forget to save modifications in the Partitioning software (press the apply button).
Performance tips:
- If your Partitioning software has the option, use partitions starting/aligned in 4Mb boundaries (multiple of 8192 blocks), for maximal write speeds. In the Mini Tool Wizard, use MB alignment.
Code:
Disk /dev/block/mmcblk1: 15.9 GB, 15931539456 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk1p1 8192 2105344 1048576+ 83 Linux
/dev/block/mmcblk1p2 2113536 10510336 4198400+ 83 Linux
/dev/block/mmcblk1p3 10518528 12615680 1048576+ 83 Linux
- Avoid to use ext2, because it was so damn slow in my tests.
- If your Partitioning software has the option, disable ext4 journaling, because it makes the external SD card wears fast.
- If possible, mark the ext4 partitions with stripe-write=1024 blocks and stride=256 blocks.
In linux, you can use:
Code:
mkfs.ext4 -E stride=256,stripe-width=1024 -O ^has_journal /dev/mmcblk0p2
[size=+1]2) Install sys2sd into STS[/size]
Get the Sys2sd Manager, decompress it in a folder, put the partitioned SD Card in the tablet, and then run run_windows.bat (run_linux.sh is work in progress).
In the menu, choose:
- Install / Install Sys2sd and busybox
- Install / Unhook sys2sd (if previusly hooked)
- Install / Hook sys2sd into System
[size=+1]3) Clone internal data and system to external SD card[/size]
With the partioned SD Card inserted into the Tablet, enter the Sys2sd Manager, and choose:
- Clone / Clone System and Data
[size=+1]4) Boot STS with external SD card inserted[/size]
In the Sys2sd Manager, choose:
- Advanced / Reboot device
[size=+1]5) Identify the internal and external system[/size]
- If you successfuly cloned the internal Android to external SD card, it will be hard to guess if you are running the internal or external Android, because it will apear the same.
- The best way to avoid this is to change something (wallpaper, icons disposition, etc) to help identify internal and external SD card boot
- Boot into internal Android and take note of the changes (icons, wallpaper)
- Boot into external Android and compare the changes
- Take care to uniquely identify booth systems, to help prevent unwanted changes to the internal system
[size=+1]6) Install recovery in external SD card[/size]
Boot into the external Android, and in the Sys2sd Manager, choose:
- Recovery / Install Recovery
[size=+3]FAQ - Frequently Asked Questions[/size]
(Q) What is this?
(A) This is a framework to help soft boot Android from the external SD card on the Sony Tablet S (STS)?
(Q) What is soft boot?
(A) It means that it is a hook in the booting process of the internal Android, using the same Kernel e RAMDRIVE. It is not a "boot from the SD card" like supported on some devices.
(Q) How to unninstall?
(A) Remove /system/xbin/sys2sd file.
(Q) Can I boot a custom Kernel?
(A) No, until we have kexec, unlocked bootloader, or other way of executing/flashing a custom kernel.
(Q) Can I boot a custom ROM?
(A) Yes, but the ROM must be made compatible to the STS hardware, and use the stock Kernel. Simply flash the ROM into the external SD card system partition using recovery.
(Q) How secure is the Recovery module?
(A) Totaly secure. It is bounded to the external data and system partitions presents in the external SD card, so it is impossible to make changes to the internal data and system partitions. The cache, primary SD card and secondary SD card partitions will be shared between the Android versions.
(Q) How about the "Android SD card"?
(A) The "Android SD card" (do not confuse this with the internal or external storage), also know as /sdcard directory, will be the same for the internal and SD card Android versions. You can keep your books, music, videos and other data here, like you do now. Also you can place your Recovery backups here.
(Q) How about the "Android second SD card"?
(A) The "Android second SD card" will be stored on the first partition of the external SD card, and it will be visible to booth internal and SD card Android versions, depending of the Apps support for a secondary SD card. You can place your Recovery backups here also.
(Q) On Android, will apps transfered to SD card work?
(A) Probably not, because you will have two Android versions running on the same device using a shared "Android SD card". Keep the apps installed on the data partition of each Android version.
(Q) How about the Sony extra partitions?
(A) All the /configs, /dataapp, /vendor and other Sony partitions are necessary to boot the Internal stock Android. DO NOT wipe, format, clean, exclude none of the internal partitions, on the risk of a bootloop and device brick.
(Q) Can I copy the contents of the data and system in the external SD card back to the internal storage?
(A) No. It is too risk.
(Q) The Android running from the SD card is too slow.
(A) Take a faster, or class 10 SD card. Mine is running fine.
(Q) Your recovery sucks. Can I create an alternative recovery?
(A) Take my Recovery as a template.
(Q) Can I start recovery from the command line?
(A)
Code:
sys2sd recoveryctl start /path/to/recovery.tgz
(Q) Can I make a dual recovery?
(A) Yes.
Code:
File: /system/recovery/start_recovery
-----
#!/system/bin/sh
# $1 can be: vol_down, vol_up, power, internal
if [ "$1" = "vol_down" ] ; then
/system/xbin/sys2sd recoveryctl start /system/recovery/twrp.tgz
exit $?
fi
if [ "$1" = "vol_up" ] ; then
/system/xbin/sys2sd recoveryctl start /system/recovery/cwm.tgz
exit $?
fi
/system/xbin/sys2sd recoveryctl start /system/recovery/default.tgz
exit $?
(Q) How to enter Recovery?
(A) See the next question.
(Q) What is the blinking blue LED during boot?
(A) It is the notification to enter Recovery. During the blue LED blinking, press a key (volume or power) to enter Recovery - after this, the LED will pulse green to indicate it will enter Recovery, or pulse red to indicate it will NOT enter Recovery.
(Q) The clone command fails with a message of "target device not found"?
(A) Is the SD Card inserted into the tablet, partitioned and formated? Are the partitions primary partitions? Have you pressed the apply button on the partitioning software?
[size=+3]TODO[/size]
- run_linux.sh in the Sys2sd Manager
- Guide on how to make custom recovery module
- Guide on how to make custom ROM ramdisk and entry points
- (done) Guide on how to make a dual recovery
[size=+3]Introduction[/size]
This is an Unofficial CyanogenMod 9.0 port for the Sony Tablet S.
[size=+3]Working[/size]
- Display (hw accelerated)
- Touch screen
- Lock screen
- Power button
- Adjustable display brightness
- Settings App (some parts are not working)
- ADB
[size=+3]Not working[/size]
- Front camera
- Rear camera
- Volume buttons
- Audio
- GPS
- Sensors
- Wifi
- Internal SD Card
- External SD Card
- USB mtp / storage
- USB host
[size=+3]How to install[/size]
1) Install the latest sys2sd framework and get it working on an SD Card
2) Install the recovery on sys2sd
3) Download the latest flashable zip on this thread and put it on the Internal or External SD Card on the Sony Tablet S
4) Reboot into recovery (sys2sd Recovery, NOT Stock recovery)
5) {optional} Make a backup of system and data
6) Flash the downloaded zip
7) Wipe data
8) Reboot system
Please note that the changes will be limited to the Android present on the external SD Card. No changes will be made to the internal Android. Reboot and eject the SD Card to boot into internal Android.
[size=+3]Downloads[/size]
This is the flashable zip for the CM9 version:
{latest} cm9-20140729T212846.zip, 144MB
http://www.mediafire.com/download/9wha2vgie4cbqro/cm9-20140729T212846.zip
[size=+3]Warnings[/size]
DO NOT flash any of this zip using the Stock Recovery, on the risk of a device brick.
Use always the sys2sd recovery (press a key during the flashing blue LED).
RESERVED for future use 2
RESERVED for future use 3
RESERVED for future use 4
What does a blue flashing light mean?
I'm not sure but in apps it means Facebook notifications
KnightOdin said:
I'm not sure but in apps it means Facebook notifications
Click to expand...
Click to collapse
No its not even booted yet. the boot animation gets stuck, then this blue light apears
Jure220 said:
What does a blue flashing light mean?
Click to expand...
Click to collapse
The flashing blue light is the notification to press a key to enter Recovery.
Anyway, I am actually working on a port of CyanogenMod 9 using this framework.
Bazoocaze said:
Anyway, I am actually working on a port of CyanogenMod 9 using this framework.
Click to expand...
Click to collapse
Tell me if you need any help, I would be glad to help you I think we have the same goal we follow.
Edit: Check the PM
Sent from my Xperia Z2 using Tapatalk
Wow :good: This is great! Thank you so much
It really is slow with a class 4 sd card??
limax182 said:
...
Click to expand...
Click to collapse
Hi,
I am glad you are trying to use the framework.
1) "without journal" is only available if you format ext4 using the command line mkfs.ext4 on a Linux system. I am working on a way to format from the Sys2sdManager, so do not worry about this option for now.
2) Same problem. For now, choose to align to MB in the Mini Tool Parition Wizard and you will be ok.
Clone System:
Sorry for the incomplete instructions. The clone option expects the SD card to be inserted into the tablet sdcard slot.
ERROR: Target device /dev/block/mmcblk1p2 not found
Click to expand...
Click to collapse
- Is the SD Card inserted into the tablet?
- Is the SD Card really partitioned? Have you pressed the "apply" button in Mini Tool Partition Wizard?
Bazoocaze said:
Hi,
I am glad you are trying to use the framework....
Click to expand...
Click to collapse
Finally installed the external Android. The problem was I made all the 3 partitions as Logical but today I made them Primary and it worked!
Now when I tried to install Xposed it gives me this message:
View attachment 2874253
Thanks for your help!
Sorry for bad english
Oh, my. I completely forgot to say that the partitions need to be primary. I will update the first post. Thank you.
About the fault in the Xposed installer, that is a know issue in the Xposed FAQ.
This post have the workaround for that:
http://forum.xda-developers.com/showpost.php?p=52292102&postcount=7
limax182 said:
Finally installed the external Android. The problem was I made all the 3 partitions as Logical but today I made them Primary and it worked!
Now when I tried to install Xposed it gives me this message:
View attachment 2874253
Thanks for your help!
Sorry for bad english
Click to expand...
Click to collapse
Bazoocaze said:
Oh, my. I completely forgot to say that the partitions need to be primary. I will update the first post. Thank you.
About the fault in the Xposed installer, that is a know issue in the Xposed FAQ.
This post have the workaround for that:
http://forum.xda-developers.com/showpost.php?p=52292102&postcount=7
Click to expand...
Click to collapse
Totally awesome work, working on kexec to support your work.
Sent from my Sony Tablet S using Tapatalk
smgdev said:
Totally awesome work, working on kexec to support your work.
Sent from my Sony Tablet S using Tapatalk
Click to expand...
Click to collapse
Wow, man! Nice to know that.
Do you think it will soon be possible to put CM9 on the internal storage after getting kexec worked on with a few fixes? This is just way too awesome to handle and we're finally going somewhere.
Funny enough, this isn't in the development thread.
I've tried this framework but I seem to be getting issues.
I've got around some errors regarding mounting but it seems that the recovery can touch the /cache partition causing it to have the wrong permissions or something, I had to factory reset to get the /cache partition to be reformatted.
Anyway, after all of the things after and before, I've finally got this thing working, the only problem now is that the ROM is stuck in a bootloop or something (staying in the boot animation, I think it did dim slightly after 10-20 minutes).
I'm using an 8GB class 4 SD card.
@Bazoocaze let me know if anything has to be done. And also let me know if you have knowledge about kernels, I am already working on kexec.
Sent from my Sony Tablet S using Tapatalk

Categories

Resources