Adding an SD card to Glowlights (2, 3, 4) - Nook Touch General

This all started out in a Glowlight 4 (7.8", 2019) thread: https://forum.xda-developers.com/nook-touch/general/glowlight-plus-7-8-2019-t3934677
An SD card was soldered to test points on the circuit board of a Glow4 to allow for extra storage.
Since it looks like this same technique should work on Glow2 & Glow3 I've broken the thread out here.
The Glow4 has test points labelled by function and has been tested and proven to work with SD cards.
http://www.temblast.com/blogs/glow4/blog.htm#sdcard
The Glow3 has test points labelled by function and has not yet been tested.
The Glow2 has test points, but they are not labelled by function.
I will try to "wiggle" out the pinout soon.
Since the only difference between the models will only be wiring, I suspect that the bulk of this thread will be on configuration and use.

I wiggled the Glow2, the pinout for SD2 is:
TP159 D0
TP160 D1
TP161 D2
TP162 D3
TP163 Cmd
TP164 Clk
TP165 /CD
TP165 VDD
TP167 Gnd
The Glow3, while it's labelled, seems to be on SD3, which is not configured.
I'm still looking at this.

Thanks! I look forward learning more about mounting the sdcard and editing fstab etc.
One more question: Does this method have any restriction on the size of the sdcard and how it's formated? Many old(er) android devices with external storage can only take sdcard of size up to 32Gb, and (independent of that) sometimes people are told to format the sdcard using the device itself, but other times we're suppose to format it in advance (fat32? ext4?).
THANKS!

case-sensitive said:
Does this method have any restriction on the size of the sdcard and how it's formated?
Click to expand...
Click to collapse
This is not so much a method as simply putting in an option that they couldn't be bothered with.
I don't have anything bigger than 16GB on hand.
32GB is the limit for SD 2.0 spec.
Most of the 4GB to 16 GB cards that I have tried are SD 3.0 spec.
You can see this with mmcinfo in uboot.
Formatting things VFAT is only useful if you want to use UMS.
I wouldn't recommend that, VFAT is old and stupid and there are issues with timezones on timestamps.
ext2 is kind of the logical choice.
mkfs.ext2 is included in busybox for formatting.

TLDR: This works on the Glow2 & Glow4 relatively easily.
On the Glow3 you'd need to sacrifice the WiFi to make it work. This works on the Glow3, but you need a modified kernel and a hwcfg change.
http://www.temblast.com/blogs/glow2/blog.htm
http://www.temblast.com/blogs/glow3/blog.htm
http://www.temblast.com/blogs/glow4/blog.htm

Apparently there is already a default place for external SD cards: /mnt/media_rw/extsd
This has a link from /storage/extsd
Since the directory already exists you don't need to modify /init.rc
If you want to use vfat formatted disks and have them hot swappable you don't even have to modify /fstab.E70Q50
My choice is to use an ext2 formatted disk and since it will be internal and not swappable, I don't need or want vold, the volume daemon.
You need to tweak /fstab.E70Q50 (get rid of any line that mentions "extsd").
Code:
/dev/block/mmcblk1p1 /mnt/media_rw/extsd ext2 defaults defaults
You can split the SD card into separate partitions if you want.
You'd have to add some more entries in /fstab.E70Q50 and some mkdirs in /init.rc
For partitioning/formatting cards:
Code:
# busybox fdisk /dev/block/mmcblk1
d [color=red]<-- delete partition[/color]
n [color=red]<-- new partition[/color]
w [color=red]<-- actually write the changes[/color]
#busybox mkfs.ext2 /dev/block/mmcblk1p1
Be very careful when you are talking about mmcblk? and mmcblk?p?

case-sensitive said:
Many old(er) android devices with external storage can only take sdcard of size up to 32Gb...
Click to expand...
Click to collapse
Code:
[email protected]_6sl:/ # df
Filesystem Size Used Free Blksize
...
/mnt/media_rw/extsd 114.4G 20.0K 114.4G 4096
...
[email protected]_6sl:/ # mount
...
/dev/block/mmcblk1p1 /mnt/media_rw/extsd ext2 rw,relatime,errors=continue 0 0

On the Glow2 I ran into a hiccup.
I soldered some 30 gauge wire directly to the micro SD card.
The SD2 is there and fine, but the NtxHwCfg (at least on mine) had to be patched.
Code:
# dd if=/dev/block/mmcblk0 of=/sdcard/hwcfg skip=1024 count=1
This will get you a 512 byte file.
Look at the byte at hex address 0x4f
For the SD card to work this value must be 0x02 (it was 0x00 on mine)
Be very careful modifying the file and writing it back to the internal SD:
Code:
# dd if=/sdcard/hwcfg of=/dev/block/mmcblk0 seek=1024 count=1
Hey! It says "skip" in the first example and "seek" in the second. I warned you!

Well, more sloppiness on NTX/B&N's part.
*.rc files are organized by board names
Usually they shovel the files into the ramdisk.
This means that you have bunches of useless files that aren't used by your hardware.
The Glow2 is a E60QD0 board, the Glow3 is a E60QQ0 board, the Glow4 is a E70Q50 board.
The init.<board>.rc file should load the fstab.<sameboard> file.
On the Glow2 (at least mine) they did sloppy copy/paste and the init.E60QD0.rc loads fstab.E60Q50
I edited init.E60QD0.rc to load fstab.E60QD0
(Then made sure that fstab.E60QD0 had the correct contents.)
Likewise, init.<board>.usb.rc is sloppy.
They don't use the approved syntax of ${ro.serialno}, but instead use $ro.serialno
I get tired of the warnings in the console log.
Also, a lot of redundant junk (the VID/PID stuff can be moved to the "on boot" section).

If you are using a Glow2 and you just installed the 5.0 update and you had previously modified the hwcfg,
then you will have to set it back to the original version to allow the added SD card to work properly.
See: https://forum.xda-developers.com/showpost.php?p=80114208&postcount=623

I had previously said that an SD card and WiFi were not compatible on the Glow3.
It turns out that it's a bit more complicated.
SD2 is the WiFi interface.
SD3 goes to the test points.
The software currently has the WiFi enable/disable switching the SD3 interface, which is wrong.
I've got the hardware itself working
Code:
eBR-1A # mmcinfo
Device: FSL_USDHC
Manufacturer ID: 27
OEM: 5048
Name: SD32G
Tran Speed: 25000000
Rd Block Len: 512
SD version 3.0
Clock: 50000000
High Capacity: Yes
Capacity: 31104958464 Bytes
Bus Width: 4-bit
Boot Partition for boot: No boot partition available
Now I just have to fix the software.

Ok, so I've patched the kernel to make this work on the Glow3.
This also needs a change to the ntxcfg. You can do that with dd or some other tool.
Is anybody ready for this? Do you have the soldering iron warmed up?
Code:
/mnt/media_rw/extsd 28.5G 20.0K 28.5G 4096
I've got to make a version of the image without my stuff in it.
I usually don't like heavily modded images.
The one thing I put in is a rooted adbd.

So, who's ready for the glow3?
You need a new kernel.
If you have access to fastboot you can test drive it with "fastboot boot p1mod.img".
Later you can "fastboot flash boot p1mod.img" to make it permanent.
If you don't (and you're brave and have a good recovery) you can "dd if=p1mod.img of=/dev/block/mmcblk0p1"
You will need to patch the NTX hwcfg.
If this is patched but you are still running the old kernel the WiFi will probably not work, but the glow3 will still be functional.
Code:
# dd if=/dev/block/mmcblk0 skip=1024 count=1 of=/sdcard/hwcfg
[color=red]Use your favorite hex file editor either on of off the glow3 to change address 0x4f from 0x02 to 0x00.
modfile hwcfg 4f 00[/color]
# dd if=/sdcard/hwcfg seek=1024 count=1 of=/dev/block/mmcblk0
If you have access to the u-boot command line you can do it there instead:
Code:
eBR-1A # mmc read 910000 400 1
MMC read: dev # 0, block # 1024, count 1 ... 1 blocks read: OK
eBR-1A # mm.b 91004f
0091004f: 02 ? 00
00910050: 01 ? q
eBR-1A # mmc write 910000 400 1
MMC write: dev # 0, block # 1024, count 1 ... 1 blocks write: OK
eBR-1A #
So, if you get through with all this and reboot it should boot up just fine.
There is a rooted adbd in there so that should not be a problem.
The fstab has been modified to mount your new SD card.
Since that is probably still the original filesystem it will not mount correctly.
You can do an "ls -l /dev/block" and see both mmcblk1 and mmcblk1p1.
You probably noticed that your old /sdcard is empty.
This is an artifact of the fstab not finishing and therefore the nonencrypted is not triggered nor the late_start.
Just do a "start sdcard" and the /sdcard will populate.
So now, just do a "busybox fdisk /dev/block/mmcblk1" to repartition and a "busybox mke2fs /dev/block/mmcblk1p1".
The fstab presumes ext2, a reasonable choice for something used as big storage. If not, just change it.
Reboot and everything should be good.
Good luck.

I've been talking about the NTX hardware configuration, but I don't think that I mentioned or released the utility that I use to dump it.
Availible in the signature, there is NtxHwCfg which can dump or compare NTX configurations.
There is a version for Win32 and one for Android.
http://www.temblast.com/android.htm
It's interesting that the B&N updates don't modify the NTX config.
The Glow2 has version 2.5 vs. the Glow3 with 2.8 vs. the Glow4 with 3.1!
So that means that the u-boots all have to be different.
Code:
C:\>ntxhwcfg hwcfg3 hwcfg4
0b Version 2.8 3.1
0f Size 65 70
10 PCB E60QQ0 (69) E70Q50 (84)
12 AudioCodec No (0) ALC5672 (6)
14 Wifi RTL8189 (8) RTL8723DS (14)
15 BT No (0) RTL8723DS (8)
17 TouchCtrl neonode_v2 (8) ektf2132 (9)
...

Related

/system writable with unionfs

Hi,
I've followed the instructions on how to build froyo on Ubuntu 10.04 32Bit,
I had to disable gdb in /buildroot/local/g8_arm/g8_arm.config
or shot make -i world
make menuconfig breaks everything
....so edit configs by hand.....
then it builds fine.....
thanks to his patch:
www android-hilfe de /android-os-entwicklung-customize/4801-kernel-module-kompilieren-erster-versuch.html
it runs (else unionfs complains about missing symbols..)
Code:
adb push unionfs.ko /data/local/tmp
adb push ntfs.ko /data/local/tmp
I've created a second 2GB ext3 partition on my sdhc class6
Code:
insmod /data/local/tmp/unionfs.ko
mount /dev/block/vold/179:18 /data/newroot
mount -t unionfs -o dirs="/data/newroot/rootfs=rw:/system=ro" unionfs /system
and now i've things like a writeble host file .....
it runs since yesterday here - and is fine.
jens
jensbln said:
Hi,
I've followed the instructions on how to build froyo on Ubuntu 10.04 32Bit,
I had to disable gdb in /buildroot/local/g8_arm/g8_arm.config
or shot make -i world
make menuconfig breaks everything
....so edit configs by hand.....
then it builds fine.....
thanks to his patch:
www android-hilfe de /android-os-entwicklung-customize/4801-kernel-module-kompilieren-erster-versuch.html
it runs (else unionfs complains about missing symbols..)
Code:
adb push unionfs.ko /data/local/tmp
adb push ntfs.ko /data/local/tmp
I've created a second 2GB ext3 partition on my sdhc class6
Code:
insmod /data/local/tmp/unionfs.ko
mount /dev/block/vold/179:18 /data/newroot
mount -t unionfs -o dirs="/data/newroot/rootfs=rw:/system=ro" unionfs /system
and now i've things like a writeble host file .....
it runs since yesterday here - and is fine.
jens
Click to expand...
Click to collapse
For morons like me what does that mean....root access??
Sorry if that is a dumb question
@mothy
so far, temporary root with writable /system directory
So just to be clear. Do you replace the kernel at all?
And do you have to mount the sd partition every time you boot up?
It's for the original Archos Kernel 2.6.29-omap1
Code:
# lsmod
ntfs 213028 0 - Live 0xbf276000
unionfs 74364 1 - Live 0xbf211000
this means you have to
temproot+"re"mount
the writable places, maybe soft-reboot (i use LCDDensity, it's soft-rebooting) and all your're changes are magicly there
instead of using sd, you can just create /data/newroot and let the things go there
Code:
# df -h
/dev/block/mmcblk0p4 299.4M 205.1M 78.9M 72% /data
i don't see any new rom's soon, unless we get a new bootloader, Archos uses mmcblk0 (an SD-Card device) and not mtd, so i think we can forget all that fastboot, flash_unlock mtd stuff.
this is very annoying, maybe i'm wrong,
but it looks like they don't want us to reflash the device :-(
unionfs usually need a own kernel, but the "ugly patches" make it run with the archos gen8 kernel
So i use temproot, gscript, LCDDensity after each reboot - and have all my settings back, apps like adsfree runs...
jens
forgive my lack of knowledge but you keep mentioning ntfs in the code fragments but you havent actually said that this is giving you ntfs support. does your kernal changes allow for reading ntfs volumes?
yes, i hope so, but i havn't tested it until now, minimum is that you can mount ntfs volumes by hand - but maybe it's automounting....
i want test a HD movie from sd, but mine doesnt fit in 4Gig (fat)
jens
i've connected same ntfs disk and:
Code:
usb 2-1:1.0: uevent
usb-storage 2-1:1.0: usb_probe_interface
usb-storage 2-1:1.0: usb_probe_interface - got id
devdb: devpath usb-musb_hdrc-1 not found
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
/mnt/flash/releases/G8A/v2.0.53-r80341/arcbuild/linux/drivers/usb/core/inode.c: creating file '002'
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1 enable change, status 00000503
scsi 0:0:0:0: Direct-Access SAMSUNG HM160HI PQ: 0 ANSI: 2
sd 0:0:0:0: [sda] 312581808 512-byte hardware sectors: (160 GB/149 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 38 00 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] 312581808 512-byte hardware sectors: (160 GB/149 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 38 00 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
sd 0:0:0:0: [sda] Attached SCSI disk
usb-storage: device scan complete
FAT: bogus number of reserved sectors
VFS: Can't find a valid FAT filesystem on dev sda1.
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1, status 0100, change 0001, 12 Mb/s
usb 2-1: USB disconnect, address 2
usb 2-1: unregistering device
usb 2-1: usb_disable_device nuking all URBs
usb 2-1: unregistering interface 2-1:1.0
same things more need to be done, a trick could be having a small fat partition, so the system has it's sda1 as fas as expecting .....
jens

[Q] Semi-soft hard non-brick - just looking for ideas

Anyway, I was using Miui V3 2.4.20 [2.6.35], and Google maps wasn't very happy with it. So I decided it was time to move on to the .32 kernal version, since the developer was going that way too. Downloaded a stock rom with .32 kernal, went to the pink screen and flashed, and then boot loop.
Luckily, I'm awesome, so my phone won't die on me. Tried flashing some roms through clockwork, no bootloop, just stuck at huawei logo. Tried flashing some stock roms, and at about 98% done flashing it goes error. Some parts get flashed causing my recovery reverts to stock, but I'm still stuck at the huawei logo.
Also, in clockworkmod I get errors mounting data and emmc, so that might be a problem. Other partitions mount fine.
I'm sure I'll find a solution eventually, so there's no rush. I've been in similar situations before. Just wanted to see what other people had used for similar situations. So if you know of something that would help, please let me know.
Found these through search (I'll do a better search again later), i will try them tomorrow:
http://forum.xda-developers.com/showpost.php?p=18944228&postcount=4
http://forum.xda-developers.com/showthread.php?t=1683249
http://forum.xda-developers.com/showthread.php?t=1689469
http://forum.xda-developers.com/showthread.php?t=1682501
http://forum.xda-developers.com/showthread.php?t=1011527
After reading a lot of threads, attempting to flash a lot of roms (stock and others), replacing all kinds of images, and offering a sacrifice to the cellphone gods, still at the same problem:
To reiterate problem:
1) Stuck/reboots at Huawei logo
2) Flashing stock roms via pink screen never finish installing, get error message at ~95% finished (During install, unpacks fine)
3) Flashing roms via recovery say they installed, but still boot problem
4) This problem occurred while trying to downgrade from .35 to .32
My next step is to try using Linux to put the Dload folder on the internal SD card and try installing from there. I have a feeling it is related to the partitions having problems. I used both the "get back pink screen" and "data partition resize," maybe something went wrong with them that only appeared when I tried to go back to stock. I'll find out more when I install linux and can see if the partitions are OK or not.
I've always wanted to try linux, and now that my phone is broke I have found the motivation to do so. So a word of advice for people for people wanting to try linux but are too lazy to download the linux file: Soft-brick your phone, it gives you motivation.
UPDATE: I'm pretty sure my partition table is broke pretty bad. In adb shell, df gives me:
Filesystem Size Used Free
/dev 173M 64K 172M
/system 203M 200M 2M
/cache 127M 4M 123M
and that's it. No /HWUserData, /.cust_backup, /mnt/asec, /mnt/obb, or /data.
Would someone be as kind as to tell me how to fix the partition table? I've got a soldering iron, duct tape and super glue. Also, I'm not afraid to buy a "box" to do some Jtag stuff.
Anybody know what Blefish uses to format the phone memory? I read on his tumbler page and his github that he has altered the partition table (he split the /hwuserdata into three sections, which means he has the ability to create partitions) If I can get that tool, then I have a plan:
0) If my understanding is correct, the updates don't install because the needed partitions are missing, which causes an error. I guess the updates won't create partitions, just alter them.
1) Use the tool blefish used to setup the partition table as described in this thread: http://forum.xda-developers.com/showthread.php?t=1504488
2) Once the partitions are back, i should at least be able to get the blue screen, if I'm good, then I can put all right files in /dev/sdb1, which will get me the pink screen.
3) Using the blue/pink screen, I can install stock firmware, which should correct any problems that the partition table has. Maybe even install android.
4) Do the happy dance
5) ???
6) Profit
I've done my homework, searched the forums, made a plan, and cleaned my room. Someone please give me some feedback and at least let me know if I'm heading in the right direction.
typci said:
Anybody know what Blefish uses to format the phone memory?
Click to expand...
Click to collapse
I am using fdisk, the main partitioning tool for MBR table. You can check the table by doing fdisk /dev/block/mmcblk0 and then "p" which should print the current partition table. From there, you can also modify the partitions.
Sent from my U8800 using Tapatalk 2
Blefish said:
I am using fdisk, the main partitioning tool for MBR table. You can check the table by doing fdisk /dev/block/mmcblk0 and then "p" which should print the current partition table. From there, you can also modify the partitions.
Sent from my U8800 using Tapatalk 2
Click to expand...
Click to collapse
Awesome. I used to use fdisk back in the dos days, so I just need to brush up on my skills and learn the adb specifics. I really need to take the time to go learn all the commands associated with adb.
INTERESTING UPDATE: If I flash a rom with locked boot loader, I still get the pink screen but it doesn't work, i.e. I can't access the image folder via windows. If I flash a rom without a locked boot loader, pink screen works. Granted none of these roms actually fully flash, I still get the error near the end.
Fdisk = Permission denied, su = permission denied. Rooted boot image prevents me from getting into recovery, which means adb won't work. Any other way to get root? I'll try flashing a custom rom when I can get clockworkmod working again. For some reason I can't get recovery to load via vol+ & power.
Also something weird is going on. When it boots, it reboots once, then goes to stock recovery, tries to do a factory reset, gets errors on formating. Also in windows two removable disks appear, but I can access them. I take it that they represent the internal SD card and maybe the pink screen image folder partition. Tomorrow I'll try linux and see what happens.
UPDATE:
1) I can't use FDISK because SU won't work. I'm not sure how SU/root works on a software/partition bricked phone.
2) Rooted boot.img won't boot into recovery. SuperOneClick won't work because it can't find the data partition (probably because I don't have one).
3) I was going to try flashing a custom rom but for some reason I can't get clockworkmod working again. The phone will boot into stock recovery on it's own, after a couple of reboots. However, if I change the boot.img or recovery.img to anything else, it gets stuck at huawei logo or boot loop.
4) Unbuntu LiveCD won't work (says it can't find the kernal) even though I used the installer from the website and tried it both via cd and flash drive. Working on installing a dual-boot system now.
I'm really striking out here. Couple of questions if anyone would care to answer.
1) Besides recovery, how else can I establish an adb connection? Pink screen and huawei logo give me device not found.
2) Is there a root exploit available that doesn't require a data partition or is there a root exploit I can modify so it doesn't require a data partition? It's OK if it's a manual exploit, while I'm new with android/adb, I got plenty of experience with command prompt input from back in the dos days.
Also learned there is a HuaWei office in my town. Don't know what they do there, but if I don't make any progress after I couple more days, I'll go find out.
typci said:
UPDATE:
1) I can't use FDISK because SU won't work. I'm not sure how SU/root works on a software/partition bricked phone.
2) Rooted boot.img won't boot into recovery. SuperOneClick won't work because it can't find the data partition (probably because I don't have one).
3) I was going to try flashing a custom rom but for some reason I can't get clockworkmod working again. The phone will boot into stock recovery on it's own, after a couple of reboots. However, if I change the boot.img or recovery.img to anything else, it gets stuck at huawei logo or boot loop.
4) Unbuntu LiveCD won't work (says it can't find the kernal) even though I used the installer from the website and tried it both via cd and flash drive. Working on installing a dual-boot system now.
I'm really striking out here. Couple of questions if anyone would care to answer.
1) Besides recovery, how else can I establish an adb connection? Pink screen and huawei logo give me device not found.
2) Is there a root exploit available that doesn't require a data partition or is there a root exploit I can modify so it doesn't require a data partition? It's OK if it's a manual exploit, while I'm new with android/adb, I got plenty of experience with command prompt input from back in the dos days.
Also learned there is a HuaWei office in my town. Don't know what they do there, but if I don't make any progress after I couple more days, I'll go find out.
Click to expand...
Click to collapse
On pink screen, your device is just like any other mass storage device. So you can still use fdisk on ubuntu with the correct /dev/sdX path. You can also format the data/system/cache using other tools if you need to.
Sent from my U8800 using Tapatalk 2
Sweet, so I just need to get Unbuntu working. I still can't figure out why the live CD/flash drive didn't work. Oh, well. When I get off of work I'll get to installing the dual-boot system. Thanks for your help.
typci said:
Sweet, so I just need to get Unbuntu working. I still can't figure out why the live CD/flash drive didn't work. Oh, well. When I get off of work I'll get to installing the dual-boot system. Thanks for your help.
Click to expand...
Click to collapse
i actually understood nothing from your posts but i would like to congratulate you for being a user who does research before asking ppl something
and I gladly give you a bump
JaymzBond said:
i actually understood nothing from your posts but i would like to congratulate you for being a user who does research before asking ppl something
and I gladly give you a bump
Click to expand...
Click to collapse
Thanks. Unfortunately the project is on hold for a couple of days. My electric motorcycle has been having some problems and I've been repairing it. Also, I think I found out why linux wasn't working. Apparently the "alternative" downloads aren't useable as a live CD, which is why the kernal wasn't there. Anyway, it's been a great learning experience. Maybe after I "break" my phone enough times I'll learn enough to become a developer.
Doing some research before getting back to working on the phone.
Looks like Blefish is talking about using linux's fdisk, when I was trying to use adb's fdisk. That would certainly allow me to bypass the su problem with adb. I think I got all the correct files for my linux livecd, so that shouldn't be a problem. After I'm done with my workout, I'll try it out and see how it goes. It's time to learn how to use linux.
Update: Got unbuntu working. Storage devices are all /media instead of /dev like I was expecting. But I think I'm not looking in the right place.
Plugged in phone via pink screen and 3 drives came up:
System - has system stupp (app, bin, etc, fonts, ...) - sdb12
256 MB File system - image folder with all the .img and .mbn files - sdb1
136 MB File system - has fotapkg, lost+found, recovery folders- filesystem type ext3/ext4 - I'm not sure what this is, maybe sdb6? If it was data (sdb13) then I wouldn't get the error in recovery, If it was the internal SD card the filesystem should be vfat. If someone knows better, please let me know.
For some reason I don't have permission to access the lost+found folder, or so Unbuntu tells me.
Tried to used fdisk with system, got error: I don't know how to handle files with mode 40755
Also found some recovery log files in the fotapkg and recovery folders. I'll post it here incase someone can get some more useful information out of it. Does anyone know what all these (null) mean?
Tomorrow I'll get to work on learning how to use unbuntu and fdisk.
Starting recovery on Sun Jan 6 00:03:50 1980
can't open /dev/tty0: No such file or directory
framebuffer: fd 3 (480 x 800)
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null)
1 /boot vfat /dev/block/mmcblk0p1 (null)
2 /fat vfat /dev/block/mmcblk0p1 (null)
3 /cache ext4 /dev/block/mmcblk0p6 (null)
4 /data_pseudo ext4 /dev/block/mmcblk0p13 (null)
5 /misc emmc /dev/block/mmcblk0p7 (null)
6 /recovery vfat /dev/block/mmcblk0p1 (null)
7 /HWUserData vfat /dev/block/mmcblk0p14 (null)
8 /system ext4 /dev/block/mmcblk0p12 (null)
9 /sdcard vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1
I:cmdline: console=ttyDCC0 androidboot.hardware=huawei androidboot.localproppath=hw/default androidboot.emmc=true androidboot.image=recovery androidboot.mode=user androidboot.baseband=msm
Ita_move_command_file
I:Got arguments from boot message
Command: "recovery" "--wipe_data" "--wipe_cache"
Formatting /cache...
Creating filesystem with parameters:
Size: 136314880
Block size: 4096
Blocks per group: 32768
Inodes per group: 4160
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 33280
Block groups: 2
Reserved block group size: 15
Created filesystem with 11/8320 inodes and 1585/33280 blocks
E:failed to mount /data_pseudo (No such file or directory)
E:failed to mount /data_pseudo (No such file or directory)
Formatting /data...
Need size of filesystem
E:format_volume: make_extf4fs failed on /dev/block/mmcblk0p13
E:failed to mount /data_pseudo (No such file or directory)
E:failed to mount /data_pseudo (No such file or directory)
Formatting /cache...
Creating filesystem with parameters:
Size: 136314880
Block size: 4096
Blocks per group: 32768
Inodes per group: 4160
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 33280
Block groups: 2
Reserved block group size: 15
Created filesystem with 11/8320 inodes and 1585/33280 blocks
Data wipe failed.
wipe internal sdcard fail.
It could be that the data partition (originally mmcblk0p13) got wiped out and now mmcblk0p13 is internal sd card. Here's the original partition table:
Code:
Disk /dev/block/mmcblk0: 3959 MB, 3959422976 bytes
1 heads, 16 sectors/track, 483328 cylinders
Units = cylinders of 16 * 512 = 8192 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 30721 245760 b Win95 FAT32 CUST
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 * 30721 30783 500 4d Unknown SBL1
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 30783 31158 3000 46 Unknown TZ
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 31158 483328 3617363+ 5 Extended EBR
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 32769 34304 12288 59 Unknown OEMINFO/BOOTLOADER IMAGES
/dev/block/mmcblk0p6 40961 57600 133120 4c Unknown CACHE
/dev/block/mmcblk0p7 65537 65599 500 5a Unknown MISC
/dev/block/mmcblk0p8 73729 74112 3072 58 Unknown FSG?
/dev/block/mmcblk0p9 81921 82795 7000 50 Unknown ADSP
/dev/block/mmcblk0p10 90113 90496 3072 4a Unknown MODEM_ST1
/dev/block/mmcblk0p11 98305 98688 3072 4b Unknown MODEM_ST2
/dev/block/mmcblk0p12 106497 134656 225280 83 Linux SYSTEM
/dev/block/mmcblk0p13 139265 216064 614400 83 Linux USERDATA
/dev/block/mmcblk0p14 221185 483328 2097152 69 Unknown INTERNAL_SD
The sdb6 is indeed cache, and it is used for recovery communication between Android.
If everything would be ok, it would mount sdb1, sdb6, sdb12, sdb13 and sdb14 inside Ubuntu, so it seems that something is wrong at the end.
If you have 14 partitions, use disk utility from Ubuntu and try manually formatting the 13 for ext4 and 14 for vfat. Taking ownership is not needed, it should work either way.
Blefish, thanks for the help. Got unbuntu up and working along with fdisk and identified the phone.
I have 13 partitions (including one empty one) , not 14. Here's the print out:
[email protected]:~$ sudo fdisk /dev/sde
omitting empty partition (13)
Command (m for help): p
Disk /dev/sde: 3959 MB, 3959422976 bytes
1 heads, 62 sectors/track, 124729 cylinders, total 7733248 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sde1 1 491520 245760 b W95 FAT32
/dev/sde2 * 491521 492520 500 4d QNX4.x
/dev/sde3 492521 498520 3000 46 Unknown
/dev/sde4 498521 7733247 3617363+ 5 Extended
/dev/sde5 524288 548863 12288 59 Unknown
/dev/sde6 655360 921599 133120 4c Unknown
/dev/sde7 1048576 1049575 500 5a Unknown
/dev/sde8 1179648 1185791 3072 58 Unknown
/dev/sde9 1310720 1324719 7000 50 OnTrack DM
/dev/sde10 1441792 1447935 3072 4a Unknown
/dev/sde11 1572864 1579007 3072 4b Unknown
/dev/sde12 1703936 2154495 225280 83 Linux
Comparing with your partition table I see two differences:
1) the ending block of sde1 is 491520 on mine and on the original it is 30721, however the blocks are the same, so that is probably not a problem
2) sde13 is empty, and sde14 is missing.
This actually makes sense. When I was using MIUI, I reduced the size of the internal sd to near zero, since MIUI could only either the internal or external sd, not both. After trying to downgrade, I had a problem, so I tried to restore the internal sd card back to stock size, just to bring my phone back to stock. Something must have gone when I did that.
So if I understand the problem correctly, to fix this I need to:
1) Split sde13 into 2 partitions
2) Format sde13 to ext4 and sde14 to vfat
3) Try installing adroid again
Do I need to name the partitions a certain name or do anything else?
In the mean time I'll be looking into how to use disk utility and fdisk to deal with sde13 and sde14.
Had an idea that I only need sde13 (data) to get things working again, the system shouldn't need sde14 (internal sd) to work.
So I went to disk utility, found Qualcomm MMC storage and tried to format the free 2.9GB at the end. Got an error:
Error creating partition: helper exited with exit code 1: In part_add_partition: device_file=/dev/sde, start=1103101952, size=2856000000, type=0x83
Entering MS-DOS parser (offset=0, size=3959422976)
MSDOS_MAGIC found
looking at part 0 (offset 512, size 251658240, type 0x0b)
new part entry
looking at part 1 (offset 251658752, size 512000, type 0x4d)
new part entry
looking at part 2 (offset 252170752, size 3072000, type 0x46)
new part entry
looking at part 3 (offset 255242752, size 3704180224, type 0x05)
Entering MS-DOS extended parser (offset=255242752, size=3704180224)
readfrom = 255242752
MSDOS_MAGIC found
readfrom = 255243264
MSDOS_MAGIC found
readfrom = 255243776
MSDOS_MAGIC found
readfrom = 255244288
MSDOS_MAGIC found
readfrom = 255244800
MSDOS_MAGIC found
readfrom = 255245312
MSDOS_MAGIC found
readfrom = 255245824
MSDOS_MAGIC found
readfrom = 255246336
MSDOS_MAGIC found
readfrom = 1140842496
No MSDOS_MAGIC found
Exiting MS-DOS extended parser
Exiting MS-DOS parser
MSDOS partition table detected
containing partition table scheme = 1
got it
Error: Invalid partition table on /dev/sde -- wrong signature 0.
ped_disk_new() failed
So, my partition table is corrupt? I'll need to figure out how to fix this.
Here's some options I've found:
http://forum.xda-developers.com/showpost.php?p=21572216&postcount=12
ksatta mentions a couple of ideas:
1) If someone backed up their phone using dd, I could use that to restore my phone.
Here's a link on how to do it: http://linuxpoison.blogspot.com/2009/04/creating-backuprestore-images-using-dd.html
dd if=/dev/sdX | gzip > /home/sdX.bin.gz
where sdX is the U8800
2) I could clone someone's partition table. If someone could give me a copy of their MBR that should work.
Here's a link on how to do it: http://embraceubuntu.com/2005/10/20/backing-up-the-mbr/
Create a backup of your MBR by doing a:
dd if=/dev/sdX of=MBR-backup bs=512 count=1
That should read “create a disk dump of the input file, which is /dev/sdx (change to hda, or hdb or sda, depending on where the MBR is on your computer), and save it in the output-file MBR-backup in the directory from where the command is issued. Backup the first sector only, while you are at it”.
3) gparted - it's some kind of partition tool. Might be able to use it to fix the error. Not sure how to use it though.
For now I'm going to look into gparted for Ubuntu. If someone can help me out with a dd backup or cloning the partition table that would be awesome.
UPDATE: For people following this thread, and to keep me more organized, I'll start adding more of the important resources I find. They may one day help you fix your phone.
https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/434463
Seems a guy fixed his the same error with gparted. However it wasn't on a phone. Also I'm seem a lot of people refer to sfdisk. I'll need to learn more about it.
https://answers.launchpad.net/ubuntu/+question/113539
"I got an answer in a forum, which looks easy.
Do a
sudo fdisk /dev/sda
then type
w
to write partition table, without any modification of it.
The signature should be fixed."
Is this safe to do to my phone? I know I'll have to write the MBR eventually, but I have to get it right the first time. If I screw up, I may not be able to connect to ubuntu anymore. Anyway, the guy said it fixed the error with his harddrive, so it's worth a try.
http://www.thegeekstuff.com/2010/09/linux-fdisk/
How to use fdisk, in case anyone needs to know
So my new plan is to:
1) dd Backup and MBR backup - in case I break it worse than it is
2) try to fix with fdisk w or gparted
I think the change in start and end is caused by Ubuntu using cylinders/sectors/blocks. Should not too much difference though.
Using MBR restore would not work here, as it restores the main 4 partitions list. MBR uses EBR aswell, which is located at the beginning of every extended partition. So we would have to copy the EBR of every partition.
I'd suggest deleting sde13, adding sde13 and sde14.
When adding sde13, note that starting block should be at the end of sde12, so simply insert last block of sde12 there. If it gives error, simply press enter as it automatically finds free block after the last one. End block could be for example +500M so fdisk automatically finds the correct end block. Do the same for sde14, but note the start block again. sde14 end block should be the last block there is on the card.
After you've done that, do w to write and if it tells you to restart or something, unplug the phone, take out the battery and restart to pink screen again. Then try to use disk utility again or gparted (have not tested this) to reformat sde13 and sde14 to ext4 and vfat.
You should be safe until you don't mess with the primary partitions, especially the mmcblk0p2 and mmcblk0p3.
Thanks again for the reply, Blefish. I may have just fixed it. I'll know soon enough.
I did two things:
1) sudo fdisk /dev/sde12 followed by w
2) sudo fdisk /dev/sde followed by w
After that it enabled me to add the 13 and 14 partition. I used disk utility so I didn't have to worry about the blocks. Afterwards they mounted in ubuntu like they should.
UPDATE: Not quite fixed, but the rom installed without error. So I think the partition problem is fixed.
Now I just have a boot loop. I'll go back to ubuntu, clear the cache, and try installing from the internal sdcard
2nd UPDATE: Stock recovery gives and error about mounting the cache partition. However CWM mounts it fine. My partition problems may not be over.
3rd UPDATE: genokolar's "Custom you partition" file to return to stock file deletes my partition 13 and 14. Had 13 and 14 back working, used the file as per instructions, afterwards ubuntu drive utililty shows 13 and 14 as "free." So that is where part of my problem comes from.
4th UPDATE: Fixed the problem with stock recovery. Turns out froyo doesn't like ext4 partitions. Changed cache partition to ext3, no more error.
Here are some exerts from the CMW log when I tried to flash cyanongen. Can anyone tell me if any of these errors are problems, and if they are what they mean?
W:Unable to get recovery.fstab info for /datadata during fstab generation!
W:Unable to get recovery.fstab info for /sd-ext during fstab generation!
I:Checking for extendedcommand...
I:Skipping execution of extendedcommand, file not found...
failed to open /sys/class/android_usb/android0/state: No such file or directory
-- Installing: /sdcard/CM7-070512.zip
Finding update package...
I:Update location: /sdcard/CM7-070512.zip
Opening update package...
Installing update...
unmount of /system failed; no such volume
package_extract_file: no backup_initd.sh in package
set_perm: chown of /tmp/backup_initd.sh to 0 0 failed: No such file or directory
set_perm: chmod of /tmp/backup_initd.sh to 777 failed: No such file or directory
about to run program [/tmp/backup_initd.sh] with 2 args
run_program: execv failed: No such file or directory
run_program: child exited with status 1
Pass 5: Checking group summary information
/dev/block/mmcblk0p12: 11/56448 files (0.0% non-contiguous), 7142/225280 blocks
mount: failed to mount /dev/block/mmcblk0p12 at /system: Invalid argument
set_perm: chown of 0750 to 0 2000 failed: No such file or directory
set_perm: chmod of 0750 to 755 failed: No such file or directory
set_perm: chown of /system/etc/init.qcom.post_boot.sh to 0 2000 failed: No such file or directory
set_perm: chmod of /system/etc/init.qcom.post_boot.sh to 555 failed: No such file or directory
set_perm: chown of /system/xbin/apply_firewall to 0 0 failed: No such file or directory
set_perm: chmod of /system/xbin/apply_firewall to 6755 failed: No such file or directory
set_perm: chown of /system/xbin/apply_theme to 0 0 failed: No such file or directory
set_perm: chmod of /system/xbin/apply_theme to 6755 failed: No such file or directory
set_perm: chown of /system/xbin/dumplog to 0 0 failed: No such file or directory
set_perm: chmod of /system/xbin/dumplog to 6755 failed: No such file or directory
set_perm: chown of /system/xbin/mv2sd to 0 0 failed: No such file or directory
set_perm: chmod of /system/xbin/mv2sd to 6755 failed: No such file or directory
set_perm: chown of /system/xbin/ota to 0 0 failed: No such file or directory
set_perm: chmod of /system/xbin/ota to 6755 failed: No such file or directory
Updating BOOT Image...
about to run program [/tmp/backup_initd.sh] with 2 args
run_program: execv failed: No such file or directory
run_program: child exited with status 1
Installation complete!script result was [Installation complete!]
Install from sdcard complete.
failed to open /sys/class/android_usb/android0/state: No such file or directory
My phone is fixed. I have no idea how it became fixed, but it is fixed.
I placed b518 on the internal sd card, and installed it. Then bootloop. So I held both volume keys+power to try another rom. It installed again. Went to recovery, it did a factory reset. Bootloop. Went back to recovery to see if I could wipe the sd card. No option for it, so I did another factory reset and rebooted my phone. I left my phone bootlooping for a minute while I looked online for a Huawei service center, and then my phone booted. I gues it got scared and didn't want to go to a service center.
This been a great learning experience, although at times a major headaches. I want to thank blefish for all his help. Thanks to this, i've bee reading his blog and other stuff, and now will follow some of his other projects.
Now to downgrade back to 2.2!!!!
UPDATE: All official roms are working correctly (b136, b138, b518, b528), recovery (5.0.2.6) works. However I haven't been able to get a single custom rom to work. Tried a couple .32 MIUI and CM, but they all stick at the huawei logo. Did factory reset and dalvik wipe, get error can't mount /sd-ext during dalvik wipe, and still doesn't boot.
Maybe I need to try a newer verison of CWM? I tried the newer versions before, and I didn't like them. Buggy and often wouldn't find my sd card.
This thread must be made sticky because it consists of pure information about dealing with soft-bricks. Thanks a lot for your curiosity, you're my hero.

Resize sdcard partition on mac

I am trying to resize the sdcard partition on the bootable cm7 sd card image. I am able to resize it using Windows and Linux, but haven't found an easy way to do it via Mac OS using the built in sdcard reader. Does anyone know how to accomplish this?
Have you tried disk utility?
Sent from my NookColor using XDA
I have. It doesn't allow me to change the size of the last partition on the card.
You can use the Sudo command to format your card on the mac from the command line. Just type Type sudo or su -
fdisk /dev/sda
mkfs -t vfat /dev/sda1
That should format your card. Just partition with fdisk. Be sure to choose the whole device (/dev/sdc), not a single partition (/dev/sdc1).
fdisk is started by typing (as root) fdisk device at the command prompt. device might be something like /dev/hda or /dev/sda.
To check the list of devices available type fdisk -l
The basic fdisk commands you need are:
p – Print the partition table.
n – Create a new partition.
d – Delete a partition.
q – Quit without saving changes.
a – Make a partition bootable.
w – Write the new partition table and exit.
Changes you make to the partition table do not take effect until you issue the write (w) command. Here is a sample partition table:
Disk /dev/sdb: 64 heads, 63 sectors, 621 cylinders
Units = cylinders of 4032 * 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 184 370912+ 83 Linux
/dev/sdb2 185 368 370944 83 Linux
/dev/sdb3 369 552 370944 83 Linux
/dev/sdb4 553 621 139104 82 Linux swap

i9100 emulated sdcard, partition resizing and full disk encryption

I recently upgraded a Galaxy S2 to Cyanogenmod 12.1 / android 5.1. I also wanted to use full disk encryption with the device and being able to access the internal memory via MTP instead of having a mass storage device. The removable sd card may be accessed via MTP, too, but will not be encrypted. Updating the recovery images to reflect the changes in the storage configuration (in case this is necessary) is not in scope, either.
Cyanogenmod by default only encrypts the /data partition. Newer models emulate the sdcard storage and save the data to /data/media, so everything gets encrypted. However, being an older phone there is still a separate sdcard-partition on the phone which is physically and directly mounted and which will not be touched by encryption.
In order to achieve the goal of full disk encryption two steps are necessary:
1. Change storage configuration to emulated media
2. Shrink old /sdcard partition and grow /data partition
= Change storage configuration to emulated media =
Emulating the sdcard in /data/media instead of physically mounting it directly requires changes to fstab.hardware (fstab.smdk4210), storage_list.xml and init.hardware.rc (init.smdk4210.rc). These files have to be changed in the Cyanogenmod source code and compiled to a new image. The configuration is based on the "Emulated primary, physical secondary" example given in h t t p s : / / source . android . com / devices / storage / config-example.html (cannot properly post URL due to new user restriction).
Here are the relevant changes in init.hardware.rc (init.smdk4210.rc):
Code:
--- init.smdk4210.rc.bak 2015-11-22 23:01:49.259579157 +0000
+++ init.smdk4210.rc.final 2015-11-30 20:21:37.977943177 +0000
@@ -2,35 +2,47 @@
import init.gps.rc
on init
- export EXTERNAL_STORAGE /storage/sdcard0
+ export EXTERNAL_STORAGE /storage/emulated/legacy
+ export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
+ export EMULATED_STORAGE_TARGET /storage/emulated
export SECONDARY_STORAGE /storage/sdcard1
- mkdir /mnt/media_rw/sdcard0 0700 media_rw media_rw
- mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw
mkdir /mnt/media_rw/usbdisk0 0700 media_rw media_rw
- mkdir /storage/sdcard0 0770 root root
- mkdir /storage/sdcard1 0770 root root
+ mkdir /mnt/shell/emulated 0700 shell shell
+ mkdir /storage/emulated 0555 root root
+ mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw
+ mkdir /storage/sdcard1 0700 root root
+
mkdir /storage/usbdisk0 0770 root root
+ mkdir /storage/sdcard1 0775 system system
+
mkdir /efs 0771 radio system
mkdir /preload 0771 system system
mkdir /mnt 0775 root system
mkdir /mnt/.lfs 0755 root root
# for backwards compatibility
- symlink /storage/sdcard0 /sdcard
- symlink /storage/sdcard0 /mnt/sdcard
- symlink /storage/sdcard1 /extSdCard
- symlink /storage/sdcard1 /mnt/extSdCard
symlink /storage/usbdisk0 /usbdisk0
symlink /storage/usbdisk0 /mnt/usbdisk0
+ symlink /storage/emulated/legacy /sdcard
+ symlink /storage/emulated/legacy /mnt/sdcard
+ symlink /storage/emulated/legacy /storage/sdcard0
+ symlink /mnt/shell/emulated/0 /storage/emulated/legacy
+ symlink /storage/sdcard1 /ext_card
+ symlink /storage/sdcard1 /mnt/ext_card
+
+
+
# Disable CFQ slice idle delay
write /sys/block/mmcblk0/queue/iosched/slice_idle 0
on fs
mount_all /fstab.smdk4210
+ setprop ro.crypto.fuse_sdcard true
+
swapon_all /fstab.smdk4210
mkdir /efs/bluetooth
@@ -428,11 +440,10 @@
oneshot
keycodes 114 115 116
-service fuse_sdcard0 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard0 /storage/sdcard0
+service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated
class late_start
- disabled
-service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
+service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
class late_start
disabled
Here are the relevant changes in fstab.hardware (fstab.smdk4210):
Code:
--- fstab.smdk4210.bak 2015-11-29 23:52:30.652913883 +0000
+++ fstab.smdk4210.final 2015-11-30 20:20:23.513945994 +0000
@@ -11,8 +11,8 @@
/dev/block/mmcblk0p12 /preload ext4 noatime,nosuid,nodev,journal_async_commit wait
# vold-managed volumes ("block device" is actually a sysfs devpath)
-/devices/platform/dw_mmc/mmc_host/mmc0/mmc0* auto auto defaults wait,voldmanaged=sdcard0:11,nonremovable,noemulatedsd
-/devices/platform/s3c-sdhci.2/mmc_host/mmc1* auto auto defaults wait,voldmanaged=sdcard1:auto,noemulatedsd
+/devices/platform/dw_mmc/mmc_host/mmc0/mmc0* auto auto defaults wait,voldmanaged=sdcard0:11,nonremovable
+/devices/platform/s3c-sdhci.2/mmc_host/mmc1* auto auto defaults wait,voldmanaged=sdcard1:auto
/devices/platform/s3c_otghcd/usb* auto auto defaults voldmanaged=usbdisk0:auto
# recovery
Here are the relevant changes in storage_list.xml:
Code:
--- storage_list.xml.bak2 2015-11-30 21:38:14.565769302 +0000
+++ storage_list.xml.final 2015-11-30 21:43:21.697757684 +0000
@@ -1,16 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<StorageList xmlns:android="h t t p : / / schemas . android . com / apk / res / android "(cannot properly post URL due to new user restriction)>
- <storage android:mountPoint="/storage/sdcard0"
- android:storageDescription="@string/storage_internal"
- android:primary="true"
- android:removable="false"
- android:allowMassStorage="true" />
+ <storage android:storageDescription="@string/storage_internal"
+ android:emulated="true"
+ android:mtpReserve="100" />
<storage android:mountPoint="/storage/sdcard1"
android:storageDescription="@string/storage_sd_card"
- android:primary="false"
android:removable="true"
- android:allowMassStorage="true" />
+ android:maxFileSize="4096" />
<storage android:mountPoint="/storage/usbdisk0"
android:storageDescription="@string/storage_usb"
@@ -18,3 +15,4 @@
android:removable="true" />
</StorageList>
Compile Cyanogenmod and flash your phone. It should boot, but the amount of available storage should be significantly lower as the sdcard is emulated on the /data partition which has not been grown, yet.
= Shrink old /sdcard partition and grow /data partition =
Use PIT Magic to resize the partitions to an appropriate size. For a stock i9100 having 16GB of internal memory my configuration was as follows (according to the backup .pit-file downloaded via heimdall):
Code:
DATAFS:
start: 1,392,640
block count: 4,194,304
end: 5,586,943
UMS:
start: 5,586,944
block count: 24,133,632
end: 29,720,575
Hidden:
start: 29,720,576
block count: 1,048,576
end: 30,769,151
I changed the partition layout to the following sizes:
Code:
DATAFS:
start: 1,392,640
block count: 28,295,167
end: 29,687,807
UMS:
start: 29,687,808
block count: 32,768
end: 29,720,575
Hidden:
start: 29,720,576
block count: 1,048,576
end: 30,769,151
Deleting the UMS or hidden partitions or shrinking the hidden led to Cyanogenmod not booting. Upload the new .pit-file using heimdall and boot the modified Cyanogenmod. Reboot to Cyanogenmod recovery and wipe data. Formatting again using the Cyanogenmod recovery was required as apparently only this recovery honours the "encryptable=footer,length=-16384" option for the /data partition in fstab.hardware which directs the formatting tools to leave 16 kiB of space at the end of the partition for in-place encryption.
Is there a way to achieve emulated SD, without changing source code and recompiling?
Like editing fstab and other config files?
I run CM13 at the moment and would like to achieve full encryption through emulated SD.
I was playing around with the idea that i would resize the sdcard partition to 8mb and resize the /data partition (~14gb), so that applications have a hefty space and i would use the external sdcard (sdcard1) for storing data and media files. Would that be possible to with an emulated sdcard ? I was hoping that with the introduction of Android 6.0 it would allow me to merge (LVM?) the /sdcard0 and /sdcard1 but instead it merges /data and /sdcard1.
fireburner-de said:
Is there a way to achieve emulated SD, without changing source code and recompiling?
Like editing fstab and other config files?
Click to expand...
Click to collapse
I cannot prove that there is no way without having to recompile. However, I couldn't find storage_list.xml in the filesystem on my phone, so I assume that this file is only used during image compilation and therefore it's probably hard/impossible to achieve emulated SD without recompiling.
Maybe this configuration is easier to achieve using Cyanogenmod 13 / Android 6 as the storage_list.xml resource overlay has been removed.
PelzigesOhr, thank you sharing and documenting your experience so well, it has inspired me to try the same on Replicant 4.2 (distro based on CyanogenMod 10).
https:// github . com / GrimKriegor / replicant42-device_samsung_galaxys2-common / commit / 84c5a91a45b059a147921d0ea32367534904b314
However it seems the best way to create a partition table is using PitMagic, which seems to be proprietary software. Would you consider sharing your PIT file please?
Thank you for your time, all of this is greatly appreciated!
EDIT:
If you still have memory of the heimdall parameters used to flash this partition table, please do share as well.
EDIT2:
Managed to create a PIT file similar to yours, thanks for documenting it.
The following thread also includes a patch compatible with Replicant/Android 4.2.
Best of luck!
redmine . replicant . us / boards / 39 / topics / 13707
GrimKriegor said:
Would you consider sharing your PIT file please?
Thank you for your time, all of this is greatly appreciated!
EDIT:
If you still have memory of the heimdall parameters used to flash this partition table, please do share as well.
EDIT2:
Managed to create a PIT file similar to yours, thanks for documenting it.
The following thread also includes a patch compatible with Replicant/Android 4.2.
Click to expand...
Click to collapse
Thanks for the praise, I'm happy that the instructions are of use to someone else. Good to know that you managed everything yourself, I'll answer anyway: This forum doesn't seem to support attachments, so I haven't attached the .pit-file. Feeding the parameters I provided to PIT Magic should yield a good result, though. PIT Magic is indeed a proprietary Windows binary, but it runs fine using wine (at least that's the way I use it).
All the flashing has been done by loading clockworkmodrecovery (
Code:
heimdall flash --KERNEL clockworkmodrecovery.6050.i9100.touch.img
) and afterwards sideloading the compiled ROM.
PelzigesOhr said:
Thanks for the praise, I'm happy that the instructions are of use to someone else. Good to know that you managed everything yourself, I'll answer anyway: This forum doesn't seem to support attachments, so I haven't attached the .pit-file. Feeding the parameters I provided to PIT Magic should yield a good result, though. PIT Magic is indeed a proprietary Windows binary, but it runs fine using wine (at least that's the way I use it).
All the flashing has been done by loading clockworkmodrecovery (
Code:
heimdall flash --KERNEL clockworkmodrecovery.6050.i9100.touch.img
) and afterwards sideloading the compiled ROM.
Click to expand...
Click to collapse
Thanks for the reply sir.
Which partitions did you upload via Heimdall when you flashed the PIT file? I believe repartitioning could delete the contents of important partitions such as BOOT and MODEM, but I am unsure. Do you think maintaining their block boundaries would preserve the data in the respective partitions?
guy i can't mount /storage/sdcard0
i use Cyanogenmod 12.1 android 5.1.1
i need help guy
GrimKriegor said:
Which partitions did you upload via Heimdall when you flashed the PIT file? I believe repartitioning could delete the contents of important partitions such as BOOT and MODEM, but I am unsure. Do you think maintaining their block boundaries would preserve the data in the respective partitions?
Click to expand...
Click to collapse
The exact command I used for repartitioning with Heimdall-1.3.1 was as follows:
Code:
heimdall flash --repartition --pit <filename>
Data should be preserved and if you don't mess with the boundaries of partitions other than DATAFS, UMS and HIDDEN you should be fine. Before repartitioning I backed up all partitions as a precautionary measure, but I didn't have to restore any of them. See also http://forum.xda-developers.com/galaxy-s2/orig-development/guide-enlarge-datafs-partition-rid-t2353551
PelzigesOhr said:
The exact command I used for repartitioning with Heimdall-1.3.1 was as follows:
Code:
heimdall flash --repartition --pit <filename>
Data should be preserved and if you don't mess with the boundaries of partitions other than DATAFS, UMS and HIDDEN you should be fine. Before repartitioning I backed up all partitions as a precautionary measure, but I didn't have to restore any of them. See also http://forum.xda-developers.com/galaxy-s2/orig-development/guide-enlarge-datafs-partition-rid-t2353551
Click to expand...
Click to collapse
Ah! This is excellent, thanks for clarifying this! Just one last question if I may, how did you backup the partitions? Did you use Heimdall to download their contents as image files, did you use DD or maybe even ADB?
Thank you for your time!
GrimKriegor said:
Just one last question if I may, how did you backup the partitions? Did you use Heimdall to download their contents as image files, did you use DD or maybe even ADB?
Click to expand...
Click to collapse
Good guess, I used dd and adb. Get a shell on the phone with adb and dump the partitions to files using dd:
Code:
dd if=/dev/block/mmcblk0pX of=/sdcard/mmcblk0pX.bin bs=512
And then copy the files to your computer using adb pull. You may want to get the mountpoints of the partitions (e.g. using mount) so that you can associate them easily.
Read here for an easy way to switch to emulated storage. Thanks to @Lanchon
https://forum.xda-developers.com/galaxy-s2/orig-development/mod-switch-emulated-to-emulated-t3539651

Kobo Aura?

I know this forum is all things Nook, but maybe you die-hard Nookies might be interested...
(If it is interesting and it goes somewhere it should be a different forum.)
Walmart is selling the Kobo Aura (Edition 2) for $69.99
Yup, this is the same sort of antiquated, single core Freescale processor as used in all the Nooks.
This is using straight Linux with QT and Adobe RMSDK.
It is the nicest physical instantiation that I've seen, thin, light, not much of a border.
There are a few things that might make this Android-izable.
#1 it uses an 8GB removable SD card for the system (and books).
#2 it uses uboot
#3 it has a 3.3V UART connection plainly labelled on the inside. (It shows boot progress, but isn't responding as a console now.)and you can get a root console.)
#4 the back comes off easily with a fingernail or a guitar pick.
Code:
## Booting kernel from Legacy Image at 80800000 ...
Image Name: 68ec1f_#5030 Oct 25 10:25:24
Created: 2017-10-25 2:25:27 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2391300 Bytes = 2.3 MB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Code:
# Id Start End Size Label
── ── ───────── ───────── ───────── ────────────────
1 83 49152 573440 524289 rootfs
2 83 573441 1097729 524289 recoveryfs
3 0B 1097730 7711742 6614013
7711743 15523839 7812097
I'm going to solder in a connector first.
If you buy one, back up the UMS USB mounted disk first.
Then, go through the Boko desktop app and get an update.
Before you let it reset and process the updated stuff, do another UMS USB backup and you'll have the update to play with before it gets eaten.
Spacebar stops the uboot and gets you the uboot command line.
For Linux you have to login as "root", apparently I had too much garbage before and it locked out the login.
Code:
[[email protected](none) ~]# uname -a
Linux (none) 3.0.35+ #5030 PREEMPT Wed Oct 25 10:25:24 CST 2017 armv7l GNU/Linux
[[email protected](none) ~]# fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 769 8961 262144+ 83 Linux
/dev/mmcblk0p2 8961 17153 262144+ 83 Linux
/dev/mmcblk0p3 17153 120496 3307006+ b Win95 FAT32
[[email protected](none) ~]# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext4 (rw,noatime,nodiratime,user_xattr,barrier=1,data=ordered)
none on /proc type proc (rw,relatime)
none on /tmp type tmpfs (rw,relatime,size=16384k)
none on /dev type tmpfs (rw,relatime)
none on /var/lib type tmpfs (rw,relatime,size=16k)
none on /var/log type tmpfs (rw,relatime,size=16k)
none on /var/run type tmpfs (rw,relatime,size=128k)
none on /sys type sysfs (rw,relatime)
/dev/mmcblk0p3 on /mnt/onboard type vfat (rw,noatime,nodiratime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
I can get it to boot Neo-Noogie by pausing at uboot with a spacebar, going to fastboot, then fastbooting an image over USB.
I made a splash screen that is 1024x768 instead of the higher 1448x1072 that the newer Nooks use and it shows up fine.
I think with some fine-tuning of everything we should be able to get this to work.
I kind of missed the obvious, this device has only 256M RAM.
Renate NST,
how do you think - why Tolino Shine 3 sd image cannot be used on Kobo Clara HD and vice versa? Since hw is basically the same.
The only reason I see is that they may use different u-boot, so maybe it would be possible boot android on Clara using stock u-boot?
RyogoNA said:
Renate NST,
how do you think - why Tolino Shine 3 sd image cannot be used on Kobo Clara HD and vice versa? Since hw is basically the same.
The only reason I see is that they may use different u-boot, so maybe it would be possible boot android on Clara using stock u-boot?
Click to expand...
Click to collapse
There can still be a bunch of differences in the hardware.
Having a hardware (UART) console is very helpful (almost mandatory) for getting this stuff to work.
First, get uboot working to the point that you get a (uboot) command line and can stop the auto loading.
Second, get your kernel to load. Use fastboot so you don't have to constantly rewrite the SD card as you putter with things.
Third, get the whole system running.
Right now I'm scratching my head why the SDcard is not recognized in the Kobo with the Nook image.
Apparently the full price for the Kobo Aura at some Walmarts is $99.99
In others it is $69.96
I'm not sure that this is a good deal at either price.
With the lack of memory, it might just be easiest to keep this as a Linux toy.
Maybe write your own code and make it a time/weather station or something.

Categories

Resources