yashsingh1/xdaforums huggingface dataset:
[Galaxy Tab 10.1 Q&A, Help & Troubleshooting] dsafety:
I am not exactly sure what you mean by "sharing files" but there are a number of options. Dropbox, Minus and other similar services store files in the cloud, making them accessable from other devices.

If you want to be able to view your SD Drive on a PC with drag and drop capabilities, take a look at Samba File Sharing or Airdroid. Both allow you to easily move files back and forth.

I am sure that there are other apps that you can use as well. These work great for me.

Bob
[Galaxy Tab 10.1 Q&A, Help & Troubleshooting] slack04:
1) search the forums; 2) search the forums; 3) get ES File Explorer.
[G1 Android Development] Scrip:
reserved for extras

like editors, linux tipsntricks, github, eclipse
[G1 Android Development] Scrip:
moar extraz
[G1 Android Development] wergeld:
I was under the impression that 64-bit linux was required now to compile android from source.
[G1 Android Development] frankdrey:
I compiled AOSP froyo with the following specs fine:

Ubuntu 10.04 (tried both native and vm)

Pentium 4 3.20ghz Hyper-Threaded

32-bit of course

3.12 GB of RAM

It took about two hours but not as bad as I thought, and it worked

Anyways thank you Scrip for this wonderful guide (yes I'll thank you in a second).

I knew 70%ish of this, and you helped fill up the rest of the holes for me :D

Thanks a lot man.

I'm sorry for kinda yelling back at you earlier :)

One question: Is there any hope for grabbing the cm6 source? It's been broken with a lot of files missing for a while now.
[G1 Android Development] wergeld:
Tried this and no matter how many times I do it it still makes the entire 12GB sda partition the SWAP space.

EDIT: So solution is not to type in "555" but to use the arrow selection button to drop it down to "555".
[G1 Android Development] Scrip:
Pointless and inaccurate post

Come back when you can prove 32-bit won't compile Android

Post the appropriate errors and I will do my best to resolve it
[G1 Android Development] wergeld:
Woah, just asking. I saw this:

This is taken from http://source.android.com/source/initializing.html

I just wanted to make sure that yes, you can compile against 32-bit before I spend a while setting this up.
[G1 Android Development] Scrip:
no idea what is wrong there

try the other way round

with a clean 12gb partition

primary = < size - 555 >

use as = ext4

mount point = /

you could just let ubuntu set everything up

downside is

I will need to add instruction to mount the /Android drive

+ wasted diskspace

but again, I don't see why
[G1 Android Development] wergeld:
No worries on that. Ghost in the Machine maybe. Coming from TFS and VS2010 I have come accustomed to oddball things like this.

So far so good. Best part is the package script you have up there. Waiting to finish package installs...
[G1 Android Development] Scrip:
I can't say it will build

look at the repo init command

-b <branch>

so if you replace gingerbread with froyo you will checkout cm6

if you have already added the local_manifest then you need to delete that before a repo sync

I will probably cover this in post 2/3

post 1 is basic

my idea is to get people interested

posts 2 and 3 will deal with extras, in post 1 I skipped basics like text editing

mostly because I have no idea how to deal with that.

Personally I use vim or kate

But I plan (if there is interest) on adding eclipse, which would make a text editor redundant
[G1 Android Development] frankdrey:
Yes I have downloaded the source for froyo before

A lot of the files are missing and repo sync doesn't complete

I know that all alsa-related files are missing, but there is more that I might have forgotten by now
[G1 Android Development] Scrip:
if post (or better pastebin.com)

the errors I can look

I've not tested these instructions against froyo , but I did at least get a zip from froyo asop a while back

missing files stinks of a screwed up prop mk
[G1 Android Development] frankdrey:
Yes AOSP works fine

CM6 doesn't

I'll post the errors when I find the time to get it all set up.

That may not be for a while though :(.
[G1 Android Development] tvall:
I think cm6 still points to android.git.kernel.org (which is gone). I was gonna fork from cm and change it to the right place but I haven't got around to it yet....
[G1 Android Development] frankdrey:
Yes I fixed that part.

but there were a whole buncha repos missing, the alsa one is all i can remember right now
[G1 Android Development] Infinimint:
WOW! Very well done! I love how you cited your sources and everything.

I appreciate the time and effort you put into this. Definately makes for a great reference. :D
[G1 Android Development] AndDiSa:
Thank you very much for this great tutorial! Even if I knew already most of the things, it's very useful to have such a tutorial here. We will see if this tutorial helps to increase the number of active android developers ... ;)

Btw.: this thread should become sticky.
[G1 Android Development] Infinimint:
+1
[G1 Android Development] wergeld:
Left for work and set up the repo sync. Hopefully when I get home I can get a compile going. Thanks!
[G1 Android Development] Scrip:
posted a correction to the local_manifest

this is what it should be

Adding a local_manifest.xml

cat > /Android/CM/.repo/local_manifest.xml << "EOF"
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="Local"
fetch="file:///Android/my_git_repos/" />

<project path="device/htc/dream_sapphire" remote="Local" name="device_htc_dream_sapphire" revision="gingerbread" />
</manifest>
EOF
[G1 Android Development] wergeld:
Well a few hours of trying and I still cannot get CM to sync:

Fetching projects: 97% (238/245) fatal: Not a git repository: '/Android/CM/.repo/projects/external/lsof.git'

Going to try with straight AOSP.
[G1 Android Development] Scrip:
try

rm -rf /Android/CM/.repo/projects/external/lsof.git

and repo sync again

you can also try

repo sync -f

(see repo help sync)

This will get you past the error, but is only useful when you already have something
[G1 Android Development] wergeld:
Yep, that is next on the agenda.

Downloading AOSP now. Going to try an ENG build just to see if this will work. My main ubuntu machine is down because I can't be arsed to reconnect the HDDs after our move. Been jonesing for build box.

So far so good. Much less trouble than trying to follow a CM wiki. My main goal is to build for my Vibrant but using my old G1 as a learning device.
[G1 Android Development] Scrip:
looking at the repo help sync has inspired me.

I have amended the repo sync command to include -c

Which should result in a much faster download

Downside is you can't git diff against an older/newer branch

But there are ways around that
[G1 Android Development] wergeld:
Nice!

Wish this sync would finish up so I can start the CM one again. Network is maxed as it is right now.
[G1 Android Development] wergeld:
Well, my results so far:

1) Unable to sync any CM repo (froyo, gb, ics) - various errors even after completing nuking the VM and starting from scratch. Not write-up issues, I think it is a CM issue at this point.

2) AOSP: Can sync any branch. Unable to build any branch. End result is always something like

Followed the main AOSP build guide as well.

Ah well. I still think this a great write-up on how to set up a VM.
[G1 Android Development] AndDiSa:
Your problem is

Looks to me, as if you are compiling with the -Werror flag. This flag should be removed and everything should be fine. Unfortunately I don't know where you need to remove this flag ...

Edit: you need to modify build/core/combo/HOST_linux-x86.mk:

-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0

+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

(linenumber 59)

http://code.google.com/p/android/issues/detail?id=20795
[G1 Android Development] Scrip:
the sync errors are strange

I wonder if enabling promiscuous mode for the network bridge would help.

(it is under advanced settings)

I know that NAT doesn't work well for syncing git,

Has anyone else had problems getting the cm gingerbread?

on another note, the -c option for repo sync didn't work as well as I hoped

just getting the gingerbread branch only saved 2GB of diskspace

But Still 7GB is better than 9GB

And while on the subject of diskspace

ext{3,4} has a horrid default of 5% for reserved blocks

to reclaim some of that space

df -h
sudo tune2fs -m 1 /dev/sdb1
df -h

no need to unmount , it can be run against a live mounted fs

very useful in general, 5% of a 1TB drive is 50GB
[G1 Android Development] wergeld:
Okay, checking that now.

Also checking if my network bridge sleeps around...

Set it to VM promiscuity.

While checking I noticed something odd:

My /Android partition is ~31GB. I have 3 folders I made (+ the lost+found which is currently empty).

CM - currently empty even though I have tried syncing manually and also via CMCompiler app.

CMC - ~4MB

AOSP - 11.1 GB

But, here is the odd bit. for the AOSP it lists Total file size being equal to 11.1 GB and size on disk being 93.6 GB. What?

Is it using a compressed file system and if so it looks like it is compressing the wrong way. Under windows that Android VM file is only 31 GB. So....

Now, point number 2:

When I do df I see that I am using 24 GB on /Android and only have 7 GB free (after running the reserved block setup). How is that possible when the only two folders with data total only 11.1 GB (or 93.6 GB)?
[G1 Android Development] Scrip:
not sure what the 93.6 is ???

the 24 vs 11.1 I can probably explain

in the root of the repo is a .hidden dir called .repo that will be around 10GB (9gb with cm or 7gb for just cm7)

if you used a filemanager and selected all the folders and asked to check the size it will have missed the .repo dir

This might also explain the odd 93.6 number, there will be symlinks and it could be double/triple+ counting things
[G1 Android Development] wergeld:
With your info on the hidden .repo file I was finally able to get CM to sync. I nuked that hidden folder and resynced and all is good.

A suggestion for the part about changing the kernel:

Give a link to the ezgb kernel package needed. I had to do some hunting for it.

I am currently at the "mka bacon" step. let us see how long it takes. Only gave the VM 1 cpu and 1.5 GB ram. Time is not really important to me on this. I am heading out so the computer wont be used by much other than this and I am in no hurry.

EDIT -

Came back to find that the build failed:

Again, seems like a CM issue at this point.
[G1 Android Development] wergeld:
Well it appears that CM still will not build. Been 6 days of constant syncing yet getting same error as listed above. CM forums are of no use on this issue. Does no one build from source anymore?
[G1 Android Development] Scrip:
It might be a problem with the prop blobs

here are the ones I used to compile update-cm-7.2.0-RC0-dream_sapphire-KANG-signed.zip

Thinking about it

I didn't use ADS, that was just handy (first hit from a tabtab)

I'm 90% It was Firerat's magpie I used

vendor__htc__dream_sapphire.zip

contains a tarball of

vendor/htc/dream_sapphire

tar -tf vendor__htc__dream_sapphire.tar.xz

to look at the listing first
[G1 Android Development] Scrip:
Not certain how I missed this but I did

pushd device/htc/dream_sapphire
#awk '/adb pull/{sub(/adb pull/,"unzip '$ROM'")sub(/\.\./,"-o ..")};{print}' extract-files.sh | sh
# 2012-03-19 corrected the above script, it should be :
awk '/adb pull/{sub(/adb pull \//,"unzip -o '$ROM' ")sub(/.*/,"-d ../../../vendor/htc/$DEVICE/proprietary/",$NF)};{print}' extract-files.sh | sh
popd
[G1 Android Development] wergeld:
Okay, trying this again from the top of the instructions. That is the joy of VMs - you can go back to a particular state-of-system easily. Doing a repo sync now against CM gb.
[G1 Android Development] Scrip:
indeed you can

if you have plenty of diskspace you can create serveral snapshots and jump between them

that is what makes VMs ideal for development
[G1 Android Development] wergeld:
I was unable to finish the sync last night. Power decided it was tired and turned off. Will hit it today when I get in from work. Again, thanks for the scripts/tutorials!
[G1 Android Development] wergeld:
Came home to find the sync had "stopped" at 97%. Was just sitting there with no action on drives or ethernet.

I retried the sync and got these lovely errors:

So I nuked the entire directory and re-did all git repo setup from scratch. And again it hung at 97%. I give...
[G1 Android Development] Infinimint:
Did you delete the .git folder? Also, if it stops like that, press Ctrl+C on the keyboard and do repo sync again.
[G1 Android Development] wergeld:
I did delete the .git folder when I nuked. Ctrl+C did nothing.

/me kicks his computer
[G1 Android Development] Scrip:
It does seem to be a relatively common problem mentioned in mailing lists,blogs and on forums

I have added the Allow All promiscuous mode to the VM's network setup

that should help when hammering away at pulling git's down

Yes, I've seen Ctlr+c fail when python hangs

the trick is

Ctrl+z
for i in $( ps | awk '/python/{print $1}' );do kill $i;done
fg

fg should fail with `no such job'

if you are certain you don't have python running elsewhere

killall python

is quicker to type

I usually do a

ps -e | grep pyth

first to see if I forgot about something
​
[G1 Android Development] wergeld:
Well, I give.

I am by no means dumb and I do a lot of other types of software development (.NET webservices and other web-based applications). And yet this has beaten me. First there was the hanging repo sync, then the invalid git repo errors, then the undefined definitions (wut), and after several weeks I have gotten really no where.

I even fired up my old linux box and tossed in x64 Ubuntu 11.10 and followed every guide I could find and still ran in to some error with no ready solution that I could find.

This last time all I did was pull over the magpie proprietary files and try and build. Saving the kernel manipulation for another time in the hopes that a more straight up build would work. After several failed attempts to sync I finally got all files, pulled the prop files, and selected to build. After about 4 mintues I get:

So I give. Building Android has beaten me.

Every damn walk through I have ever done has failed. So maybe parts of it is PEBCAK-related but more often than not it is some arcane knowledge that was assumed from the beginning that those in the the know do not disclose (not out of malice or anything, but stuff that to them is so basic it is not worth mentioning). Hell, even the official Android build instructions assume you would know to turn off the "fail on warnings" config in the make file...who would know that if this is their first go-round with building from external sources. (As a side note - shouldn't the official Android repo "production" branch NOT throw warnings?)

I do appreciate your help, Scrip, and the others for their words of advice. But it seems like for each step I ask for help on that I do get great answers for there is another error that pops up and I feel I am wasting everyone's time here. Again, thanks.
[G1 Android Development] Scrip:
missing libgps is a problem with extracting the prop blobs

check device/htc/dream_sapphire/proprietary

since writing the guide I stumbled upon Koush's github

namely

https://github.com/koush/proprietary_vendor_htc/

if you add

<project path="vendor/htc" name="koush/proprietary_vendor_htc" />

to the local_manifest.xml

that should eliminate any extraction from zip problems you are having
[G1 Android Development] wergeld:
Yea, but the libgps.so IS there. It is in the path listed in the dream-sapphire- blob.mk file.

Will try the local_manifest update once I find that file. I see manifest.xml in .repo but no local_manifest.xml. I guess I would have to do the kernel change-over to get a loca_manifest?

EDIT - so I followed the full guide again and made the changes to the local_manifest and this is the outcome:

So, does not look like that actually fixes anything.
[G1 Android Development] Scrip:
I don't recall needing to cheat to get it to build :confused:

I will clobber everything and see if I can replicate

in the meantime

install -D $ANDROID_BUILD_TOP/vendor/htc/dream_sapphire/proprietary/libgps.so out/target/product/dream_sapphire/obj/lib/libgps.so

should get round it

but something is not quite right

thinking about it , did you redo the

. build/envsetup.sh

lunch

again?

can't remember if you need to do that to load the new makefiles correctly

edit

and no, local_manifest is not there by default

google included it in repo so people could easily pull in custom projects
[G1 Android Development] wergeld:
Yep, did the . build and lunch before re-running.

What I did not do was sync. Doing that again now and will try that. If that fails then I will try the INSTALL code.
[G1 Android Development] Scrip:
well if you have koush's htc vendor stuff in local_manifest it will pull what should be a working prop blobs setup

btw , I might have missed the remote="github"

but I think that is the default remote in the main manifest so it may work anyway

and since guthub is already setup as a remote there is not need to set it up in local_manifest

in fact if you do it will error

the install is just a super charged copy

the -D flag means it will create and needed dir before copying the file
[G1 Android Development] wergeld:
Okay so what I did here was add the entry to the local manifest, repo sync (no -c), . build, lunch, mka - and now it is rolling...it has not errored yet.

I had already clobbered build before changing manifest.

---------- Post added at 10:06 PM ---------- Previous post was at 09:58 PM ----------

Spoke too soon.

Build failed after a bunch of stuff with this:

So, a problem with local_manifest again?
[G1 Android Development] Scrip:
that does look odd

it is looking for kernel modules that have been squashed up

the gingerbread DS I was working with only had the one kernel module (wlan.ko) and it wasn't squished

wait

it looks like my sed may be messed up

device/htc/dream_sapphire/prebuiltmodules.sqf'

out/target/product/dream_sapphire/system/lib/modulesmodules.sqf'

should be

device/htc/dream_sapphire/prebuilt/modules.sqf'

out/target/product/dream_sapphire/system/lib/modules/modules.sqf'

edit full_dream_sapphire.mk

change

device/htc/dream_sapphire/prebuilt/wlan.ko:/system/lib/modules/wlan.ko \

to

sed -i -e $ANDROID_BUILD_TOP/device/htc/dream_sapphire/full_dream_sapphire.mk

device/htc/dream_sapphire/prebuilt/modules.sqf:/system/lib/modules/modules.sqf \

we can do this with a simple sed

[strike]sed -i -e 's/\/wlan.ko/modules.sqf/g' full_dream_sapphire.mk[/strike]

sed -i -e 's/\/wlan.ko/\/modules.sqf/g' full_dream_sapphire.mk

to fix yours

cd device/htc/dream_sapphire
sed -i -e 's[prebuiltmodules[prebuilt/modules[' -e 's[modulesmodules[modules/modules[' full_dream_sapphire.mk
git add full_dream_sapphire.mk
git commit -m "Scrip screwed up"
git push Local gingerbread

or manually edit full_dream_sapphire.mk

I wouldn't blame you for not trusting my seds

Edit:

I corrected the first post with this

sed -i -e 's[/wlan.ko[/modules.sqf[g' full_dream_sapphire.mk

I used [ so I don't have to escape the / with \

sed '@regexp@new@'

sed ',regexp,new,'

sed '~regexp~new~'

sed '¬regexp¬new¬'

all work

tbh I don't know why I still use / most of the time, since it is a pain when paths are involved
[G1 Android Development] wergeld:
Using your fixes all worked until

I am in /Android/CM/device/htc/dream_sapphire when I ran that. The other commands were successfull.

Went ahead and redid the build.

So far so good. Will check back in the am.

Thanks for the help on this!
[G1 Android Development] Scrip:
ahh

well that last one was to push the changes to the local file:///blahblah git

it's not important really
[G1 Android Development] wergeld:
Woke up this morning to good news!

Package complete. Going to try and install.

Let us hope all gremlins are gone.

Gremlins still here:

Checking my bootloader. Pretty sure if have 1.33.0013. Already was running CM 6.01.

---------- Post added at 10:44 AM ---------- Previous post was at 09:49 AM ----------

My bootloader is actually 1.33.2005. Will update that now!
[G1 Android Development] wergeld:
Success!

Follwed guide here to get the correct fastboot images and it booted up just fine!

Did I say "Success!"? I think I did!

Thansk, Scrip!
[G1 Android Development] Scrip:
Nice

And thank you for debugging my walk-through
[G1 Android Development] wergeld:
Not a problem.

Even though some of this was frustrating to set up it was very much worth it.

Now I can start messing around in the actual code to see what I can change knowing I have a working ROM to compare it to.

Thanks, again!
[G1 Android Development] Scrip:
Frustration? that is half the fun

just wrangled CM6

this should build and make people happy
[G1 Android Development] frankdrey:
Nice! Although my interests seem to have turned to Gingerbread by now

Ill try it out when (and if) I have the time

Also, since we remove alsa, will sound not work? Or just the DSP?
[G1 Android Development] wergeld:
But I have a vibrant and I want it to work! =)

I am working on setting up a flashable zip of just the apps I want. This will be a work in progress and a learning adventure. Frustration is fun when the payoff happens!

Once I get the G1 configuration down I will move on to my vibrant and try and work with it. Currently running ICS Passion but I have not found a repo for it...
[G1 Android Development] frankdrey:
Can someone tell me the exact sizes for each version of Android source?

I want to have 3 drives for Froyo, GingerBread, and ICS.
[G1 Android Development] Scrip:
I think it is just a missing .mk file

which can no doubt be found somewhere

but for what it's worth. The Froyo build is awful

very slow to compile and should it stop for what ever reason, like the kernel's COPYING file is missing, it seems to take almost as long to get back to where it ended.

but compiling just some apps shouldn't be too bad

instead of make otapackage just do make <package name>

repo grep "LOCAL_PACKAGE_NAME :="

will get you a full list

it will build frameworks etc as required, and only the once (unless you change its code)

The make otapackage seems to want to rebuild everything no matter what, gingerbread is much smarter here.

if building an apk then run opticharger on it

for i in out/target/product/dream_sapphire/system/app/Settings.apk;do stat -c %s $i; opticharger $i; stat -c %s $i; done
2837054
Optimizing Settings.apk...
1505548

it removes redundant pngs and runs pngcrush on the remaining

with CM6 opticharger gets put in the PATH during envsetup, but with CM7 it doesn't

it resides in vendor/cyanogen/tools/
[G1 Android Development] Scrip:
the exact size changes every day as they add code :rolleyes:

10GB as a raw repo

output from ncdu (recommended sudo apt-get install ncdu)

this is the froyo build

9.7GiB [##########] /.repo
3.9GiB [#### ] /out
1.1GiB [# ] /prebuilt
818.4MiB [ ] /external
474.2MiB [ ] /kernel-msm
303.8MiB [ ] /frameworks
128.4MiB [ ] /device
119.3MiB [ ] /packages
96.7MiB [ ] /dalvik
38.0MiB [ ] /development
29.1MiB [ ] /ndk
27.0MiB [ ] /hardware
26.0MiB [ ] /system
20.8MiB [ ] /vendor
13.5MiB [ ] /bionic
13.0MiB [ ] /sdk
5.8MiB [ ] /bootable
4.1MiB [ ] /build
40.0kiB [ ] /android
8.0kiB [ ] .classpath
4.0kiB [ ] .project
4.0kiB [ ] Makefile
[G1 Android Development] Scrip:
going to change the way we deal with the kernel in CM6

I forgot to fix the BOARD_KERNEL_BASE for 2708
[G1 Android Development] frankdrey:
Dang I guess ill need a bit more space

Or if Gingerbread is a lot better to build, I might just go ahead with Gingerbread.

Also, why do you recommend virtualbox?

Vmware player is a /lot/ faster

And it has some very useful features