• Announcements

    • Reminder - MoDaCo position on illegal content   07/30/15

      ILLEGAL CONTENT I'd like to just reaffirm MoDaCo's position regarding piracy and illegal content in the light of some recent questions / postings. Posts will be censored by myself or my moderation team if the contain or link to: Illegal / pirated / cracked software or sites that host such softwareNintendo emulators / ROMs or sites hosting them (in light of Nintendo's legal stance)CUSTOM ROMS You may discuss and post links to custom device ROMs on MoDaCo, provided the following rules are adhered to: ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission)ROMs must give full credit to the original authorISSUES If you have any issues with this policy, please contact PaulOBrien directly via PM.
    • Reminder: Selling items on the forum directly is not allowed   07/30/15

      Please note that selling items on the forum directly is not allowed by the forum rules. There is a forum for eBay auctions whereby you can list the items on eBay and link to them there. This is the ONLY forum for this type of activity. You may also advertise links to the eBay forum in your signature. Please note that selling directly in contravention of these rules will result in a warning / suspension / ban.
Sign in to follow this  
Followers 0

Q&A regarding gellmar's notes on E400 development

86 posts in this topic

Posted

Do you think it's possible to join two consecutive partitions mmcblk0p20 and mmcblk0p21 in one mounted to /data? I think that i'd be a good idea to have 1GB for apps and leave the microsd slot for "external" /sdcard storage. I did it before myself without joining it (i did with dirty init.rc scripts) because i was scared of bricking my device if i change the number of partitions.

0

Share this post


Link to post
Share on other sites

Posted

I had such idea long ago, but I need to explore the bootloader code. Maybe we should leave number of partitions intact but the size of /data is to be adjusted to a bare possible minimum ext4 allows.

0

Share this post


Link to post
Share on other sites

Posted

wow!new development is here.uhm,can i request something about cm9?what i hate about cm9 is the unstable battery percentage.when you reboot or turn it off,later when you turn it on again,the battery sometimes increases or decreases like hell.that's so annoying.the battery percentage is really unstable.unlike in stock.you reboot or turn it off and on,the battery level is stable.stays the same or only drops 1%.is there any fix for that issue?i'm starting to love cm9 especially now that the usb mass storage is now working.no need to go to cwm.hehe.thanks!

0

Share this post


Link to post
Share on other sites

Posted

is UMS read only int-sd or ext-sd or both???

0

Share this post


Link to post
Share on other sites

Posted

yayakuya,both writable. I uploaded movies and music to external card, got screenshots from internal and pushed back a photo for test

0

Share this post


Link to post
Share on other sites

Posted

Maybe u know how made mass_storage in CM9/AOKP....?

0

Share this post


Link to post
Share on other sites

Posted

As soon as AOKP is based on CM9 kernel and framework the zip may be suitable for AOKP too.

0

Share this post


Link to post
Share on other sites

Posted

my AOKP bootloop after installing the zip :P

0

Share this post


Link to post
Share on other sites

Posted

I had such idea long ago, but I need to explore the bootloader code. Maybe we should leave number of partitions intact but the size of /data is to be adjusted to a bare possible minimum ext4 allows.

You could format the 1GB partition as EXT4 and mount in init.rc. What i did was:

1. Format 1gb partition to EXT4.

2. Write code for mounting it in init.rc as /data (runs in linux before android core startup)

3. Swap the internal emmc and the external sdcard device in fstab.vold (that makes android core to recognise the 1GB ext partition as secondary external storage and sdcard as primary sdcard that it's what we want)

The third step it's here for avoiding mounting errors in the notification bar. If Android framework detects an error while mounting the primary external storage it will show a error message asking to format the sdcard, also some apps like Gallery, will crash as they're using getExternalStorage() method which returns null if not available, BUT if the mounting error happens on the external storage partition android just ignore it and even don't show anything.

If only we could disable in the kernel the external storage option this dirty fix could be enough to achieve 1 gb of internal storage for apps and sdcard for external.

If you know how to do this in the kernel, i will help you with the rest.

0

Share this post


Link to post
Share on other sites

Posted (edited)

Ygreck, try changing only framework-res but not boot.img

crazybyte, the issue is about vold rather and storage_info.xml inside the framework-res.apk, but let me check your scenario. Can you PM your init.rc?

Here's what I plan to check:

1. The hecatae's swap scenario: format /dev/block/mmcblk0p20 as ext2fs and /dev/block/mmcblk0p21 as vfat, change the mtd@ mapping, leave init.rc intact to get sdcard of 157 MB and /data of 1 GB. This can eliminate the need to patch the kernel / bootloader.

2. If it works (and I think it works), investigate bootloader parts for partition table. If nothing, fdisk /dev/block/mmcblk0 and delete /data/ and /sdcard partitions and make a new one of 1.157 MB ext2fs, then change vold.fstab and recovery.fstab and disable the sd-ext in storage_info.xml and anywhere else (this is your question whether it needs to be disabled inside kernel some way)

About getExternalStorage() mess, it relies on kernel's sdcard mapping - now the mapping shows ext-sd as external, but if there is no ext-sd, the code will return the only sdcard as external, emulating the sdcard-less devices...

I am inspecting kernel sources for mmcblk0 - found in devices documentation and in lge/factory/lge_emmc_direct_access.c

The very interesting file is that direct access stuff... there are some hardcoded offsets for MBR/EBR and the names of all partitions :) I should deep into it and update the /dev/block post first.

Edited by gellmar
0

Share this post


Link to post
Share on other sites

Posted

Ygreck, try changing only framework-res but not boot.img

crazybyte, the issue is about vold rather and storage_info.xml inside the framework-res.apk, but let me check your scenario. Can you PM your init.rc?

Here's what I plan to check:

1. The hecatae's swap scenario: format /dev/block/mmcblk0p20 as ext2fs and /dev/block/mmcblk0p21 as vfat, change the mtd@ mapping, leave init.rc intact to get sdcard of 157 MB and /data of 1 GB. This can eliminate the need to patch the kernel / bootloader.

2. If it works (and I think it works), investigate bootloader parts for partition table. If nothing, fdisk /dev/block/mmcblk0 and delete /data/ and /sdcard partitions and make a new one of 1.157 MB ext2fs, then change vold.fstab and recovery.fstab and disable the sd-ext in storage_info.xml and anywhere else (this is your question whether it needs to be disabled inside kernel some way)

About getExternalStorage() mess, it relies on kernel's sdcard mapping - now the mapping shows ext-sd as external, but if there is no ext-sd, the code will return the only sdcard as external, emulating the sdcard-less devices...

I am inspecting kernel sources for mmcblk0 - found in devices documentation and in lge/factory/lge_emmc_direct_access.c

The very interesting file is that direct access stuff... there are some hardcoded offsets for MBR/EBR and the names of all partitions :) I should deep into it and update the /dev/block post first.

You're forgetting a step. If you change the partition layout you have to rebuild the recovery, otherwise when it will try to mount /data for installing a rom it will fail.

In the other hand what you says about getExternalStorage() it's true, that it's what i said that we have to "remove" the sd-ext option. I forgot a step my init.rc script relies on the previous format in the rom install script of the 1gb partition, saddly i removed the rom because it was unusable on my girlfriend phone because the charger and sudden reboot bugs... That was a pity because i never tought that somebody would fix it. :/

I can ask him to give me the phone leting me to "build" the modded rom again.

PS: Sorry about my English, i'm from Spain, i'm trying to do my best :)

0

Share this post


Link to post
Share on other sites

Posted

crazybyte, you are right about recovery. But I think I found the routine lge_mmc_scan_partitions with the list. Now trying to get a print from it

0

Share this post


Link to post
Share on other sites

Posted

my AOKP bootloop after installing the zip :P

wait a minute, i can't see any zip file here... :/

anyone wanna tell me?

0

Share this post


Link to post
Share on other sites

Posted

yayakuya, the e400-charger-mass-encryption from big topic...

0

Share this post


Link to post
Share on other sites

Posted (edited)

Watch out about changing the number of partitions(because if we mess the bootloader we will brick the device you already know!), we could do a first approach mounting only the bigger one and leaving the remaining intact.

Edited by crazybyte
0

Share this post


Link to post
Share on other sites

Posted (edited)

crazybyte, the hack works if make a correct combination of vold.fstab + storage_info.xml + build.prop. And of course recovery.fstab and init.rc. Let me show the screenshots.

But I need the dump of stock MBR because I was a dumb :(


su

dd if=/dev/block/mmcblk0 of=/mnt/sdcard/mbr.bin bs=1024 count=100

post-994615-0-77949400-1363211678.png

post-994615-0-74113600-1363211680.png

post-994615-0-84401000-1363211684.png

Edited by gellmar
0

Share this post


Link to post
Share on other sites

Posted

Please post any questions regarding E400 development here.

0

Share this post


Link to post
Share on other sites

Posted (edited)

That's cool, tomorrow at sunrise i will upload the mbr. Sorry about this but i my girlfriend now have the stock rom and i have to root it and i deleted the drivers from my pc hehe.

EDIT: Backup your MBR maybe it's easier to install in a script this patch. We can add to the install script some steps like 1. DD the new mbr, 2. Reload partition table 3. Format new partitions 4. Mount partitions and install. It should work because the start and the ends of the remaining partitions matches the original.

Edited by crazybyte
0

Share this post


Link to post
Share on other sites

Posted

crazybyte, you are reading my thoughts :D

0

Share this post


Link to post
Share on other sites

Posted

Here is the MBR of LG L3 V10N

mbr.rar

0

Share this post


Link to post
Share on other sites

Posted (edited)

crazybyte, thanks - but looks like mine and yours are identical. It means that MBR (the first part) is identical as expected and where is EBR - I need to reveal. Think we need an sfdisk command line tool to handle re-partitioning with partition lists from within script.

UPDATE: Grab file sfdisk from https://github.com/o...-arm/bin/sfdisk (it is a stripped static build for armv7l), place it to /system/bin/, assign 755 permissions and as root run:


/system/bin/sfdisk -d /dev/block/mmcblk0 > /sdcard/mmcblk0_stock.txt

and post a zipped file here. The best bet of sfdisk is that we can dump and restore the partition table in command-line with

sfdisk -d /dev/block/mmcblk0 > mmcblk0_merge.txt

and

cat mmcblk0_merge.txt > sfdisk /dev/block/mmcblk0

Edited by gellmar
0

Share this post


Link to post
Share on other sites

Posted

Try this, i don't have the phone here.

echo "l \n q \n" | fdisk /dev/block/mmcblk0[/CODE]

0

Share this post


Link to post
Share on other sites

Posted (edited)

It works, but fdisk does not allow to set non cylinder-boundary layout... So I guess we need a rooted but stock phone or at least a phone with recovery installed.

UPDATE: Stock KDZ reflasher rewrites partition table back so we can revert the mod by KDZ or from recovery if we have a full dump.

Edited by gellmar
0

Share this post


Link to post
Share on other sites

Posted

It works, but fdisk does not allow to set non cylinder-boundary layout... So I guess we need a rooted but stock phone or at least a phone with recovery installed.

Don't worry as i said this morning i rooted my girlfriend's phone and i gave you the mbr. Tomorrow you will have the stock partition layout. Using fdisk you could check in the install script if the device already has correct partition layout by counting the number of partitons. Maybe another user could do the same job if youre free to work now, if not we will have to wait until i see her.

0

Share this post


Link to post
Share on other sites

Posted

what do you need, and where do you need it?

anyone else seen the output if you

adb reboot bootloader

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2015. MoDaCo uses IntelliTxt technology.