yashsingh1/xdaforums huggingface dataset:
[Nook Color Android Development] polymath257:
I am probably being dense here, but which board do I 'make' for in this code?
[Nook Color Android Development] fattire:
For encore, it's make omap3621_evt1a I believe.
[Nook Color Android Development] steven676:
Along these lines: could someone with an M8G2FA eMMC part please boot into recovery and supply the output of running (# represents your prompt, not something you type)

# fdisk -ul /dev/block/mmcblk0

please? While you're at it, could you also look at /sys/block/mmcblk0/device/preferred_erase_size and provide the value reported there?
[Nook Color Android Development] polymath257:
# fdisk -ul /dev/block/mmcblk0

Here it is:

~ # fdisk -ul /dev/block/mmcblk0

Disk /dev/block/mmcblk0: 7734 MB, 7734296576 bytes
255 heads, 63 sectors/track, 940 cylinders, total 15106048 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 63 144584 72261 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p2 144585 289169 72292+ c Win95 FAT32 (LBA)
/dev/block/mmcblk0p3 289170 899639 305235 83 Linux
/dev/block/mmcblk0p4 899640 15101099 7100730 5 Extended
/dev/block/mmcblk0p5 899703 1831409 465853+ 83 Linux
/dev/block/mmcblk0p6 1831473 12273659 5221093+ 83 Linux
/dev/block/mmcblk0p7 12273723 12996584 361431 83 Linux
/dev/block/mmcblk0p8 12996648 15101099 1052226 c Win95 FAT32 (LBA)
~ #

root@android:/sys/block/mmcblk0/device # more name
M8G2FA
root@android:/sys/block/mmcblk0/device # more preferred_erase_size
524288
root@android:/sys/block/mmcblk0/device #
[Nook Color Android Development] steven676:
Good news: smaller eraseblocks ...

Bad news: smaller eMMC overall. Strangely, they elected to take the difference out of /data instead of /emmc.

Given that the M8G2FAs aren't the same size as the SEM08Gs, it's probably going to be easiest to do as DizzyDen suggests and create the partitions out of disk order, so that /data can take up whatever space is left after we create /system and /cache. 4MB alignment should be fine on both (aligning to a 4MB boundary is sufficient to ensure that every partition starts at the beginning of a 512KB eraseblock on M8G2FA, though we will waste a little disk space in doing so).
[Nook Color Android Development] polymath257:
I repartitioned by EMMC and aligned things along 4MB boundaries.

Here is a bit of data:

root@encore:/sys/block/mmcblk0/device # more name
SEM08G
referred_erase_size <
4194304
root@encore:/sys/block/mmcblk0/device # fdisk -ul /dev/block/mmcblk0

Disk /dev/block/mmcblk0: 7944 MB, 7944011776 bytes
255 heads, 63 sectors/track, 965 cylinders, total 15515648 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 63 144584 72261 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p2 144585 289169 72292+ c Win95 FAT32 (LBA)
/dev/block/mmcblk0p3 289170 899639 305235 83 Linux
/dev/block/mmcblk0p4 899640 15101099 7100730 5 Extended
/dev/block/mmcblk0p5 901120 2998271 1048576 83 Linux
/dev/block/mmcblk0p6 4046848 15101099 5527126 83 Linux
/dev/block/mmcblk0p7 3006464 4046784 520160+ 83 Linux

Partition table entries are not in disk order

BTW, I have two NC's, one is a SEM08G and one is a M8G2FA. The re-partitioned one is the SEM08G.

All seems to be working so far.
[Nook Color Android Development] WJThomas:
Not sure that it makes any difference, mine is partitioned slightly different.

Disk /dev/block/mmcblk0: 7734 MB, 7734296576 bytes
255 heads, 63 sectors/track, 940 cylinders, total 15106048 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 63 144584 72261 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p2 144585 289169 72292+ c Win95 FAT32 (LBA)
/dev/block/mmcblk0p3 289170 899639 305235 83 Linux
/dev/block/mmcblk0p4 899640 15101099 7100730 5 Extended
/dev/block/mmcblk0p5 899703 1831409 465853+ 83 Linux
/dev/block/mmcblk0p6 1831473 12675284 5421906 83 Linux
/dev/block/mmcblk0p7 12675348 13398209 361431 83 Linux
/dev/block/mmcblk0p8 13398273 15101099 851413+ c Win95 FAT32 (LBA)
[Nook Color Android Development] polymath257:
I noticed, as did DizzyDen, that fdisk did not like to make partitions adjacent to each other. It seems that it likes to leave a 64 sector difference between partitions (perhaps this is only for extended partitions?). That is why there is asuch a large gap between my re-partitioned p5 and p7. I was shooting for an exact 2^21 sectors in system. I may redo the partitioning and adjust p5 down 63 sectors and make p7 start where I originally wanted it.

Update: I re-re-partitioned so that /dev/block/mmcblk0p5 stops at sector 2998204 and /dev/block/mmcblk0p7 starts at 2998272. The rest are the same.

I was able to install CM11 nightly. The recovery complained about the absence of a cache partiton, but a factory re-set formatted both cache and data. The ROM install formatted the /system partition. I will try ART sson.
[Nook Color Android Development] boringuy:
No, you cannot fit extended partitions back to back because EACH exteneded partition has a boot record similar to the MBR in front of it. If you do fdisk -u, you will see that it will skip some sectors after the end of the previous partition when creating a new one.
[Nook Color Android Development] polymath257:
Does that mean the extended partitions have to start at 4MB boundaries plus 64 sectors?
[Nook Color Android Development] DizzyDen:
BTW... I created a 4MB mmclkk0p8 out of one of the gaps in the partition layout so TWRP don't complain about not being able to mount EMMC and can save its settings... I also am commenting the line in fstab.encore that mounts p8 for testing... ART is working very well with the new partition layout (even before I created p8)

I have noticed that ART is MUCH slower in optimizing apps than dalvik... but it runs very smooth once it completes.
[Nook Color Android Development] steven676:
Won't matter for purposes of actually doing the repartitioning, will matter for purposes of sanity checking.

No, that means you want to stick the gap into the last bit of the previous eraseblock -- it doesn't matter where that goes, whereas it matters a lot that the partition starts on an eraseblock boundary. (In other words, for optimal packing, partition sizes need to be (n * 4MB) - 64 sectors.)

This doesn't work -- the property is set as you'd expect, but the trigger doesn't seem to run early enough in the boot process to be useful for mounting /system.
[Nook Color Android Development] steven676:
This landed today and should also be part of the upcoming CM11.0-M3 milestone build for encore.

Anyone? I haven't come across any difficulties in my testing, so unless someone speaks up, these are going to go into the main CM tree this weekend.

There's a rough implementation of all of this (bootloader patch, utility to create the symlinks, integration into the system) up now in my source trees. (If you'd like to build to try it out, use branch cm-11.0-oneboot in my device/bn/encore tree.)
[Nook Color Android Development] sziggins:
Hi Steven,

I am building lately using roomservice.xml in local_manifests as:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="steven676/android_device_bn_encore" path="device/bn/encore" remote="github" revision="cm-11.0" />
<project name="steven676/ti-omap-encore-kernel3" path="kernel/bn/encore" remote="github" revision="encore-omap3-3.0.y" />
</manifest>

But I am using overclocking to 1200MHz, governors and a scheduler. It looks ok but I had once a frozen screen (I used power button to restart it...) and some FCs to stock browser but feels really smooth overall! Now I am trying to build it using latest Linaro toolchains. As my tests are not including only your changes are not accurate and reliable but I think you should go them into main CM tree.

In weekend (free time!) I might try this:

Looks interesting!

Thanks.
[Nook Color Android Development] steven676:
I wouldn't do this -- at least for CM11, the plan is to support both legacy and new partition layouts, and the most foolproof way of detecting a legacy partition layout appears to be checking for the presence of a partition 8 on the eMMC.

ART does a lot more work in the "optimization" stage -- I think dexopt just loads all the classes into memory (thus avoiding the expense of loading and verifying classes on app startup), but ART appears to compile the Dalvik bytecode into native code during this phase.
[Nook Color Android Development] WJThomas:
I use a bluetooth GPS with my nook. I currently use PA2.99 when I need the GPS. I have hopes of getting it to work with CM11. I wonder if not claiming a GPS will prevent the mapping software (Copilot) from installing. I have not yet tested this...
[Nook Color Android Development] DizzyDen:
Yeah... this is only a short term testing thing... I had originally left P8 off... but for the time being put it on to see if it cleared the settings issue in TWRP.

Was pointing that out so anyone else enabling ART didn't think it was a problem they were having... so everyone would know ART takes a LONG time to optimize apps.

One thing I would like to do, and you are definitely the man to ask... I would like to edit fstab.encore so it uses partition 1 on the SD as SD0... I have tried every combination I can think of on the line:

/devices/platform/omap/omap_hsmmc.1/mmc_host/mmc0	auto	vfat	defaults	voldmanaged=sdcard0:8,noemulatedsd

As I understand it my source sould be /devices/platform/omap/omap_hsmmc.0/mmc_host/mmc1 and voldmanaged should be sdcard0:1...

but I have not been able to get any combination to do what I want (or expect).

The only reason for this is that although I haven't booted dual boot forever... I have left the sdcard setup for it... thus I can have older recover and alt boots on SD and newer on EMMC. By using partition 4 by editing the sdcard1 line I can keep update files on partition 1 and not have them mixed in with other data. What I have been doing is mounting mmcblk1p1 to /sdcard/boot/ and putting files there... but since we're not going to use mmcblk0p8 any longer... I figure I could use sdcard0 for mmcblk1p1 and sdcard1 for the other partition. Will probably install CM11 on SD for testing when we get to that point and can modify it again at that point to use whatever partition.

I guess I just went a long way in asking... how can I set up two partitions on the same SD card as sdcard0 and sdcard1 with mmcblk1p1 being sdcard0?

I know this will become moot when we get to the point the new installer is location independent, but for now something to play with.
[Nook Color Android Development] boringuy:
So, I repo sync and got the change for the WPA_SUPPLICANT_VERSION. My question is that do you guys always "make clean" every time after a repo sync? I would do that if I have a fast computer but it takes hours to compile from scratch again.

Changing the BoardConfig.mk doesn't trigger the build system to rebuild the driver in out/target/product/encore/obj/EXECUTABLES/wpa_supplicant_intermediates/src/drivers/, so when it try to link wpa_supplicant, it failed.

I am still very new to the android build system. Is there a proper way to clean all the wpa_supplicant related object files. I am looking for some magic options in something like this running at the root directory: "make -C external/wpa_supplicant_8/wpa_supplicant ......... clean" or do I just nuke the wpa_supplicant_intermediates directory.

In general, the "brunch encore" command compiles many things at the same time and the output is hard to read because they are all jumbled together. When a compile error happens, how do you ask it to compile just the module it failed? When trouble shooting my first compile error, I had to trace down a lot of the files and final find this command to compile just the kernel module:

make -C "hardware/ti/wlan/mac80211/compat_wl12xx" KERNEL_DIR=/Volumes/Project/android/system/out/target/product/encore/obj/KERNEL_OBJ KLIB=/Volumes/Project/android/system/out/target/product/encore/obj/KERNEL_OBJ KLIB_BUILD=/Volumes/Project/android/system/out/target/product/encore/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE="/Volumes/Project/android/system/prebuilts/misc/darwin-x86/ccache/ccache /Volumes/Project/android/system/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.7/bin/arm-eabi-"

Is there a easier way to just compile one module? Sorry for the newbie question and if this doesn't belong to this thread, I apologize.
[Nook Color Android Development] Arbelzapf:
Is there any way to change these settings at runtime/via init.d?

I used to change it in my own build, but now I prefer to use the cm updater. There's the XUtilities module for the xposed framework that can do the job, but since I am currently giving ART a try, I need some other way to do it.

Can someone help me out, pleeease?:cyclops:
[Nook Color Android Development] polymath257:
Just saying that I am interested in the answer to this myself.
[Nook Color Android Development] Arbelzapf:
To answer my own question, it does not seem to be quite as easy:

http://xdaforums.com/showthread.php?t=2367412

http://xdaforums.com/showthread.php?t=2306
[Nook Color Android Development] steven676:
Nope, not necessarily. That said, if you have ccache set up and are building on an SSD, a full build doesn't necessarily take that long (~50 minutes for me, as opposed to ~170 minutes without help of ccache and 220+ without the SSD).

Look in the Android.mk files in that directory for all the LOCAL_MODULE lines, and for each module, delete out/target/product/encore/obj/*/$modulename_intermediates (replace $modulename with the appropriate module name, obviously). (There are some changes, notably to frameworks/base overlays, for which this isn't good enough, but that's sufficient to clean up build artifacts after most changes.)

Finding compile errors is easiest if you save the output from the build to a file (try something like "brunch encore 2>&1 | tee build.log", which will save all the build output to a file called build.log as well as display it to the screen). If there's an error, you can then look through the build log for "***", which make always emits when announcing a build error.

Go into the directory containing the module and use "mm" to build all the modules in that directory.

That's an excellent question -- if what you described (using the same sysfs path for two different entries with two different voldmanaged= values) doesn't work, it might be that vold needs to be extended to support your use case.
[Nook Color Android Development] meteorrock:
Hi steven. We are deleting our account in here. Have fun with the project, we are moving on. Make sure Mike Channon gets this. I want the account completely removed. Thank you. God bless. WE care.
[Nook Color Android Development] unibroker:
local_manifest

I would like to replace

<project name="NookieDevs/android_device_bn_encore" path="device/bn/encore" remote="github" revision="cm-11.0" />
<project name="CyanogenMod/android_kernel_bn_encore" path="kernel/bn/encore" remote="github" revision="encore-omap3-3.0.y" />

with

<project name="steven676/android_device_bn_encore" path="device/bn/encore" remote="github" revision="cm-11.0" />
<project name="steven676/ti-omap-encore-kernel3" path="kernel/bn/encore" remote="github" revision="encore-omap3-3.0.y" />

I must have missed that class because editing the local_manifest file directly is just giving me errors when I remove-project in the first and when I keep them all.
[Nook Color Android Development] DizzyDen:
That does not work.. I'm at a loss here.
[Nook Color Android Development] polymath257:
Just delete the first two entries completely.

I have found that doing the breakfast command will attempt to add in two lines for CyanogenMod to the roomservice. Just delete them again before you run brunch.
[Nook Color Android Development] unibroker:
I tried your suggestion but get the following when attempting breakfast:

including vendor/cm/vendorsetup.sh
Looking for dependencies
Adding dependencies to manifest
Adding dependency: CyanogenMod/android_kernel_bn_encore -> kernel/bn/encore
Syncing dependencies
fatal: duplicate path kernel/bn/encore in /home/jim/android/system/.repo/manifest.xml

In the past when I've made this modification to roomservice it failed at repo sync. Against my logic I made the substitution after repo sync but it failed at the breakfast command because it first re-adds the CM dependency. (EDIT) I did find a post by eyeballer where he instructs to repo sync first and then make the change to the local_manifest (note; this was relating to CM 10.1 before the roomservice.xml addition).

Now back to our regularly scheduled programming on partitioning and other advanced topics.
[Nook Color Android Development] polymath257:
For the stephen repos, I do a remove-project for the CyanogenMod packages, the include stephen's. Then I do a repo sync. After that, there appears to be a couple ways to proceed: 1) breakfast encore and then remove the lines in roomservice for CyanogenMod again. Then brunch encore. 2) lunch cm_encore-userdebug and then make.
[Nook Color Android Development] steven676:
As promised, all of this was merged -- again, please speak up if you come across problems with this.

I suspect you'll need to modify vold to get this to work, then (I suspect that vold currently assumes one volume per sysfs path).
[Nook Color Android Development] polymath257:
Repartition breaks SDcard installer

I repartitioned by emmc as stated in a previous post.

Since I did that, I have had some problems with SD card installs:

1. The installer recovery on the SD card refuses to do anything. By comparing the output with my non-re-partioned NC, it appears the installer checks for a standard B&N layout and aborts if such is not found, saying to report a bug.

2. An SD card with stock ROM refuses to boot, saying there is a problem and to contact customer service.

3. I am able to boot into a previous SD card install of CM11, but cannot update or make a new card because the installer fails.
[Nook Color Android Development] leapinlar:
Explain how you repartitioned, give the layout.

And yes, the SD installer does check first for a standard layout before it will work.

And as for the stock on SD, you must have messed with p2 and the data there since stock needs that data intact to operate properly.
[Nook Color Android Development] polymath257:
I used fdisk to change p5,p6,p7 and deleted p8. I aligned them on 4Gb boundaries.

root@encore:/sys/block/mmcblk0/device # fdisk -ul /dev/block/mmcblk0

Disk /dev/block/mmcblk0: 7944 MB, 7944011776 bytes
255 heads, 63 sectors/track, 965 cylinders, total 15515648 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 63 144584 72261 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p2 144585 289169 72292+ c Win95 FAT32 (LBA)
/dev/block/mmcblk0p3 289170 899639 305235 83 Linux
/dev/block/mmcblk0p4 899640 15101099 7100730 5 Extended
/dev/block/mmcblk0p5 901120 2998204 1048576 83 Linux
/dev/block/mmcblk0p6 4046848 15101099 5527126 83 Linux
/dev/block/mmcblk0p7 2998272 4046784 520160+ 83 Linux

Partition table entries are not in disk order

That I did *not* do. I left p2 alone. I did delete p8. Could that be the issue?
[Nook Color Android Development] DizzyDen:
I think you're talking about my post:

If you are, you have to reboot into recovery and format the partitions before anything else...

Additionally, make sure you comment out the line in fstab.encore that references /devices/platform/omap/omap_hsmmc.1/mmc_host/mmc0 since sdcard0 no longer exists.

I have a script that I use for making modifications that contains the following line to do this:

sed -i s'/devices/platform/omap/omap_hsmmc.1/mmc_host/mmc0'##/devices/platform/omap/omap_hsmmc.1/mmc_host/mmc0' fstab.encore

I also modify the reference to sdcard1 to use SD cards partition 4 for both internal and SD ROMs:

sed -i s/sdcard1:auto/sdcard1:4/ fstab.encore

Attached is the flashable zips I use to repartition and format the partitions created by my scheme:

If the SD installer looks for eMMC (/dev/block/mmcblk0p8) it is going to cause problems (TWRP also has issues saving settings, etc. because of this).

A short term workaround would be to create an extremely small p8 in one of the gaps as I had (but later deleted) until everything can get caught up. You can create this by:

fdisk /dev/block/mmcblk0

n

(accept both defaults (enter twice)... this is probably a very small partition... mine was about 1M so I created another...)

n

(accept both defaults (enter twice)... this one is about 4M... and would be the same for all others I created so I stopped here)

d

8

t

8

c

w

Then make sure you format is also...

busybox mkdosfs -n TMPPART /dev/block/mmcblk0p8

note: TMPPART is the volume label and can be changed to whatever.

Anyway... here's the two scripts I use for repartitioning (doing away with mmcblk0p8) and formatting.
[Nook Color Android Development] leapinlar:
Yes that is the issue. The SD card installer checks for the existence of p8 and aborts if it is not there. That is the test that verygreen put in to verify a standard layout.

Plus I'm pretty sure stock on SD is expecting that p8 is there so it can use it as emmc media storage.

So your solution is to make at least a small p8 if you want to run on SD.
[Nook Color Android Development] polymath257:
I have a slightly different layout than in your post. Same basic idea, though.

Actually, the ROM zip will format /system and if you do a factory reset, that will format /data and /cache, so these

do not need to be done in other ways.

I tend to do this when building my ROM.

From what leapinjar said, the installer looks for a standard B&N layout. I don't know if it helps to have a p8 for the stock ROM on sdcard.

---------- Post added at 12:07 PM ---------- Previous post was at 11:50 AM ----------

I verified that the existence of a p8 makes the sdcard installer work.

The stock sdcard install did *not* function, though. Perhaps stock is expecting more than the mere existence of p8. Does it check the size of the partitions at all?
[Nook Color Android Development] leapinlar:
I suspect that something you did messed with p2. That message is the exact message that stock gives with a bad p2. I suggest you run my repair p2 zip from my NC partition repair thread linked in my signature. It restores p2 from a backup in p3. It is safe to run. It will abort if the backup in p3 is not there.

Edit: but it is possible that stock checks the size of partitions.
[Nook Color Android Development] DizzyDen:
Stock may also be checking for the existence of a specific file... or require a size large enough for the stock media files... the safe workaround would be to create p8 at least 140M (144 if you want it to align on eraseblock) and copy the stock p8 files to it.
[Nook Color Android Development] steven676:
Having just looked into this, it looks like the test is for whether the eMMC device is being set up by the kernel as mmc0 or mmc1. There's a better way to do this that doesn't rely on the existence of a particular partition layout: look at /sys/class/mmc_host/mmc0/slot_name -- it'll report "internal" or "external" depending on whether it represents the eMMC or the SD card.

Given that you control the kernel in use for the SD card installer, you could also just hard-code this to whatever the kernel has it set up as.

To be clear: we are not going to support stock BN software at all on repartitioned layouts. That said, if you're already modifying stock to run off an external SD card, it might be possible to track down whatever checks it's making and delete them.