MoDaCo is undergoing planned maintenance. Site functionality may be reduced - follow @modaco or @paulobrien on Twitter for updates.

  • Announcements

    • Reminder - MoDaCo position on illegal content

      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 software
      Nintendo 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 be hosted directly in topic via the MoDaCo attachment system
      ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission)
      ROMs must give full credit to the original author
      This decision has been taken in light of the huge amount of interest in this area of device customisation within the community, and member feedback! Please note that custom ROM discussion should be kept in specific device sub-areas, (e.g. Kaiser.MoDaCo.com for Kaiser based devices). ISSUES If you have any issues with this policy, please contact me directly via PM. P
    • Support MoDaCo by signing up to a MoDaCo Silver or Gold membership

      To sign up to an annual MoDaCo Silver subscription which will eliminate all ads from the site (as well as giving you access to the MoDaCo Online Kitchens for Android) for only £9.99 using PayPal, Credit or Debit Card, ensure you are logged in to the site, and then click the link below, which will take you directly to the subscription store! You can also sign up to an annual MoDaCo Gold subscription for £29.99, which adds the benefits listed below! PURCHASE A MODACO SUBSCRIPTION - FREE Titanium Backup Mobile for Android worth $5.99! - FREE 1 year PrivateInternetAccess.com worth $39.95! - FREE 1 year LastPass Premium worth $12! - FREE CalcConvert for Pocket PC from Binaryfish worth $17.95! - FREE Calendar Bar for Pocket PC from OmegaOne worth $9.99! - FREE CamerAware for Pocket PC and Smartphone from MoDaCo worth £19.99 / $30! - FREE Chronos for Pocket PC from ActiveKitten worth $14.95! - FREE CodeWallet Pro for Smartphone and Pocket PC from DeveloperOne worth up to $24.95! - FREE Concentrix for Pocket PC from eSoft Interactive worth $9.95! - FREE FlexMail for Pocket PC and Smartphone from WebIS worth up to $59.90! - FREE FTouchSL for Pocket PC from Vekoff s.r.o. worth 10 euro / $12.50! - FREE Jewel Challenge for Pocket PC from eSoft Interactive worth $9.95! - FREE John Cody's Alerts Pro for Smartphone from Omnisoft worth $14.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Dutch for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> French for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> German for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Italian for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Spanish for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Dutch for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> French for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> German for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Russian for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Turkish for Smartphone from Lingvosoft worth $49.95! - FREE Note2Self for Pocket PC and Smartphone from WebIS worth up to $19.90! - FREE Opera 8.60 for Pocket PC and Smartphone from Opera Software worth up to $48! - FREE Pocket Informant for Pocket PC and Smartphone from WebIS worth up to $59.90! - FREE Pocket Launcher for Pocket PC and Smartphone from Conduits worth $9.95! - FREE PTab for Pocket PC and Smartphone from z4soft worth up to $60! - FREE Resco Explorer for Pocket PC and Smartphone from Resco worth up to $49.90! - FREE Safemode for Pocket PC from monocube worth $12.95 - FREE SplashPhoto for Pocket PC and Smartphone from SplashData worth up to $59.90! - FREE Sprite Backup for Pocket PC and Smartphone from Sprite Software worth $29.95! - FREE Teksoft Glyphs UI for Pocket PC and Smartphone from Teksoft €9.95! - FREE Teksoft HeadsetRemote for Pocket PC and Smartphone from Teksoft €4.95! - FREE Traffic Jam for Pocket PC from eSoft Interactive worth $9.95! - FREE unlock (1 per year) from imei-check.co.uk - DISCOUNT of 10% at MoDaCo FairDeal - DISCOUNT of 10% at Semsons.com - FORUM - AD FREE SITE - FORUM - custom rank / title - FORUM - double competition entries - FORUM - double post attachment space - FORUM - no search flood control - FORUM - priority event registration - FORUM - triple PM space
    • Reminder: Selling items on the forum directly is not allowed

      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 / suspensions / ban.
Sign in to follow this  
Followers 0

Q&A regarding gellmar's notes on E400 development

86 posts in this topic

Posted · Report post

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 · Report post

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 · Report post

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 · Report post

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

0

Share this post


Link to post
Share on other sites

Posted · Report post

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 · Report post

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

0

Share this post


Link to post
Share on other sites

Posted · Report post

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 · Report post

my AOKP bootloop after installing the zip :P

0

Share this post


Link to post
Share on other sites

Posted · Report post

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) · Report post

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 · Report post

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 · Report post

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 · Report post

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 · Report post

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

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

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) · Report post

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 · Report post

Please post any questions regarding E400 development here.

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

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 · Report post

crazybyte, you are reading my thoughts :D

0

Share this post


Link to post
Share on other sites

Posted · Report post

Here is the MBR of LG L3 V10N

mbr.rar

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

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 · Report post

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

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

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

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 · Report post

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 · Report post

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.