Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Anyone building Cyanogenmod?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Tue Aug 19, 2014 12:43 pm    Post subject: Anyone building Cyanogenmod? Reply with quote

Late next month (after I get my new system) I'm looking at getting into building Cyanogenmod. In the meantime I've started reading the documentation. It's strongly oriented toward Ubuntu, and my problem is that it says to load a bunch of Ubuntu packages. Obviously they're not the same as Gentoo packages. In many cases it's easy enough to guess the Gentoo-equivalent names, in other cases not.

Other than installing icedtea and android-sdk (which installs Eclipse) does anyone have the Gentoo package list necessary to build Cyanogenmod?

I have a Galaxy S Relay 4G (the last good slider) and the last developer just bought a new phone. So if I want anything newer than CM11 M8, I'm going to have to do it myself. I suspect that counts double if I want to get to Android-L once that's out.

They've got a package list like:
Code:
For both 32-bit & 64-bit systems, you'll need:

bison build-essential curl flex git gnupg gperf libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre phablet-tools pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

Some packages like bison, curl, flex, etc work directly for Gentoo. The "*-dev" packages are probably unnecessary since practically everything is a dev package in Gentoo. The "build-essential" might just be there for Gentoo. The libesd0-dev is troubling, as ESD is long obsolete, and I'm not sure how to map their 32-bit stuff into gentoo emul-* packages.

Any guidance by experience would be appreciated.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Wed Aug 20, 2014 7:28 am    Post subject: Re: Anyone building Cyanogenmod? Reply with quote

depontius wrote:
Late next month (after I get my new system) I'm looking at getting into building Cyanogenmod. In the meantime I've started reading the documentation.
Could you please add a link pointing to that documentation?
So far, I've only used dev-util/android-tools and building CM from the sources will be the next step.
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Wed Aug 20, 2014 11:25 am    Post subject: Reply with quote

Here's the Cyanogenmod page on my phone : http://wiki.cyanogenmod.org/w/Apexqtmo_Info

and about halfway down the page is the "Build Guide" : http://wiki.cyanogenmod.org/w/Build_for_apexqtmo

and just under that is the "building Cyanogenmod in general" : http://wiki.cyanogenmod.org/w/Development#Learning_To_Build_CM

That's where I'm starting. I've also gotten links to and joined the xda-developers forums : http://forum.xda-developers.com/

Again, my phone is here, kind-of well hidden because it's an older phone : http://forum.xda-developers.com/galaxy-s-relay-4g

I had the android sdk installed on the dead system sitting in the basement, but only ever used it to install new ROMs with adb. (I didn't know it could just get adb from android-tools instead of the whole sdk.)
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Wed Aug 20, 2014 1:12 pm    Post subject: Reply with quote

depontius wrote:
I had the android sdk installed
Where did you get the sdk? Or did you mean dev-util/android-studio instead of sdk?
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Wed Aug 20, 2014 6:21 pm    Post subject: Reply with quote

dev-util/android-sdk-update-manager

Note that somewhere in here you'll have to ~arch the icedtea-7 ebuilds also, because doing the newer Android builds requires Java 7 instead of the default Java 6. CM11 is KitKat, needing the newer Java, and no doubt Android-L will also. My phone has been quite mysteriously inconsistent in its battery life, so I'm looking forward to the improved diagnostics of Android-L. OTOH, my one experiment with ART was an utter disaster, so I hope that's fixed.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
svantoviit
n00b
n00b


Joined: 12 Jun 2010
Posts: 13

PostPosted: Wed Aug 20, 2014 9:21 pm    Post subject: Re: Anyone building Cyanogenmod? Reply with quote

depontius wrote:
The "build-essential" might just be there for Gentoo.

build-essential provides just a list of packages needed for building Debian packages and works as a meta package itself.

build-essential-11.5/list
Code:
                   List of Build-Essential packages
                    as of 2010-03-14, Debian sid

This file lists the non-essential packages that are build-essential.
The list is not closed under the "depends on" relation, so one will
usually need to install more packages than given here.

This list attempts to document the set of build-essential packages as
well as possible.  However, it is not authoritative (actually, there
is no authoritative list at all); the definition of the
"build-essential" class of packages given in Debian Policy Manual
(version >= 3.6.1.1), section 4 "Source packages" (more precisely
subsection 4.2 "Package relationships") is the definitive answer.
Here's the definition (as of Policy 3.6.1.1):

    It is not necessary to explicitly specify build-time relationships
    on a minimal set of packages that are always needed to compile,
    link and put in a Debian package a standard "Hello World!" program
    written in C or C++.  The required packages are called
    _build-essential_, and an informational list can be found in
    `/usr/share/doc/build-essential/list' (which is contained in the
    `build-essential' package).

The list is given below in a format which is readable by both humans and
programs.  The format is described at the end of this file.

BEGIN LIST OF PACKAGES
libc6-dev [!alpha !ia64 !hurd-i386] | libc0.3-dev [hurd-i386] | libc6.1-dev [alpha ia64] | libc-dev
  Provides the ISO C standard library
  Indirectly depended on by g++, but we'll ignore
  it since libc6-dev is used for non-C++ programs too.

libc6-dev-sparc64 [sparc]
  Used only on the sparc architecture.

gcc (>= 4:4.4.3)
g++ (>= 4:4.4.3)

  NOTE:
  The libstdc++ -dev library is not needed, as g++ depends on it

make
  Also depended on by dpkg-dev, but make does warrant its own
  dependency since debian/rules will need it even if dpkg-dev
  stopped depending on it

dpkg-dev (>= 1.13.5)
  Provides dpkg-genchanges and other scripts.  Versioned, because
  of support for the build-time dependency fields in /debian/control
  and dpkg-architecture support for OS and CPU information.

  NOTE:
  Although this list does not contain them, all `Essential: yes'
  packages are build-essential as well.  A list of such packages
  can be found by executing the following command
     `grep-status -FEssential -sPackage -ni yes'
  when the `grep-dctrl' package is installed and in its default
  configuration.  Such list is installed with this package as
  the file
     `/usr/share/doc/build-essential/essential-packages-list'
 
hurd-dev [hurd-i386]
  Provides libpthread.so (and other such essential components).

END LIST OF PACKAGES

Here's the format definition:

   - First line is the following, without any leading or trailing
     whitespace:
        BEGIN LIST OF PACKAGES

   - Last line is the following, without any leading or trailing
     whitespace:
        END LIST OF PACKAGES

   - A line with leading whitespace is a comment.

   - Other lines are joined with end-of-line replaced by comma, and
     the result is parsed like the body of the Build-Depends field.
     The list of build-essential packages for a particular
     architecture is constructed from the result list by ignoring all
     the package name - package version pairs which would be ignored
     if we were building for that architecture and then removing the
     architecture specifications.

The Python program list2depends parses stdin as if it were this
file and outputs one line that is suitable for use in a dependency
field body of a Debian binary package.

Local Variables:
mode: text
End:


the lists for i386 and amd64 are the same
build-essential-11.5/essential-packages-list-amd64
Code:
This list was generated on Sun Mar 14 21:48:29 UTC 2010 for amd64
It contains a list of essential packages (which are also build-essential).

base-files
base-passwd
bash
coreutils
dash
debianutils
diffutils
dpkg
e2fsprogs
findutils
grep
gzip
hostname
ncurses-base
ncurses-bin
perl-base
sed
login
sysvinit-utils
sysvinit
tar
bsdutils
mount
util-linux


for more info check the package at https://packages.debian.org/wheezy/build-essential
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Wed Aug 20, 2014 10:24 pm    Post subject: Reply with quote

So it's kind of as I thought... the stuff in build-essentials looks like pretty much part of a standard Gentoo install already.

The package that worried me out of that list was something to do with ESD, (Enlightenment Sound Daemon) which I thought was long obsolete. I've seen one report suggesting that it is for Android too, and that's a stale list.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
forrestfunk81
Guru
Guru


Joined: 07 Feb 2006
Posts: 565
Location: münchen.de

PostPosted: Thu Aug 21, 2014 10:11 am    Post subject: Reply with quote

I'm building CM on my desktop. There was only one package to install additionally. But it was obvious from the build error I got. I'm currently not sitting in front of my system, so I can't tell you which package this was. But I will supply that later.

[edit]
The missing package was sys-process/schedtool
There is no ESD installed on my system, but pulseaudio as a gnome dependency.
_________________
# cd /pub/
# more beer
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Fri Aug 22, 2014 8:28 pm    Post subject: Reply with quote

I decided I couldn't wait, and started installing on my wife's computer. Then I started hitting snags/questions. Too bad I didn't save the link to the instructions I used for the dead computer, because that worked.

However I understand I need Java-7 or 1.7 in order to build KitKat, so maybe the last installation was insufficient. At any rate, I did the right stuff and have android-sdk-update-manager installed with icedtea-7. Here's where it gets murky.

Some instructions say to install eclipse, some don't. Some say to install it from a tarball, others from an overlay, and it's sitting in portage. But the one in portage ends up installing Java 6 / 1.6 in a different slot, so I'm sure it won't build KitKat. As far as I can tell, the blame falls on icu4j - eclipse wants >=icu4j-4.0.1.4:4, but in order to get Java 7 / 1.7 I need >=icu4j-49.1:49 - completely different slot.

How did you do this, which CM are you successfully building?
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
forrestfunk81
Guru
Guru


Joined: 07 Feb 2006
Posts: 565
Location: münchen.de

PostPosted: Sat Aug 23, 2014 1:12 pm    Post subject: Reply with quote

You don't need Eclipse to build CM. But you can install it and import the CM sources to Eclipse. Then you can browse the code in a convenient way. I always download the Eclipse tarball, because the portage version is to old.

I'm using dev-java/icedtea-7.2.4.7 to build CM version 11. You need to download the repo script and execute it (only works with python 2.x). This synchronizes the CM11 sources. To build CM execute:
Code:
$ source build/envsetup.sh
$ breakfast  <your_device_code_name>
$ croot
$ brunch <your_device_code_name>


I used this howto to build it for my HTC One m7.
_________________
# cd /pub/
# more beer
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Thu Aug 28, 2014 9:49 pm    Post subject: Reply with quote

forrestfunk81 wrote:

I used this howto to build it for my HTC One m7.


Which HowTo did you use to get Gentoo ready to start building cyanogenmod? I know that there's a clue in that you used a tarball for Eclipse. I take it that Eclipse installs in /opt, in that case? (Or does it mess itself in /usr and give Portage a headache?)
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
forrestfunk81
Guru
Guru


Joined: 07 Feb 2006
Posts: 565
Location: münchen.de

PostPosted: Mon Sep 01, 2014 11:46 am    Post subject: Reply with quote

I'm building CM on my normal desktop system, which is about 5 years old. I did not follow any HowTo to prepare gentoo for building CM. Just followed the CM docs and started building.

Eclipse does not come with an installer. It is just a plain tarball containing the eclipse installation. Unpack it in any directory you want (I use /opt/eclipse/), and start the executable.
_________________
# cd /pub/
# more beer
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Tue Sep 02, 2014 12:18 pm    Post subject: Reply with quote

So last night I built my first ROM image. Unfortunately I know up-front it's not going to work, because there are two commits upstream that are incompatible with my phone, and those need to be reverted. Last night was just a pipe-cleaner to see if I could get a minimal process running. Apparently I did, at least I presume that the process contains sufficient internal checks that if something had really gone wrong, it would have died before completing.

Which brings me to the next point - ccache. I don't normally run ccache for Gentoo - for my normal usage there's just too much flowing through gcc for any sort of caching to be effective. The phone however is a different issue. They also suggest a very large (50G vs Gentoo's 2G) cache, which makes me believe that they can cache the entire build. Given the amount of time this build took, I'm definitely interested in ccache. Do I have to install the ccache package, add it to the path, etc, or is that stuff built into the android development system?

Also, I have no practical experience with git. All of my usage has been under-the-covers with other packages, and the git interface has been completely hidden Now I need to use it, at the very least to reverse the two previously-mentioned commits. Do you have a preferred git gui? For the two commits, command-line is probably the way to go, but I also have a repository out there that I know nothing about, and would like to be able to browse it, and a gui is probably best for that.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
forrestfunk81
Guru
Guru


Joined: 07 Feb 2006
Posts: 565
Location: münchen.de

PostPosted: Tue Sep 02, 2014 2:59 pm    Post subject: Reply with quote

ccache is included in the CM build tools. It should be in <your CM directory>/prebuilts/misc/linux-x86/ccache/
For gentoo I don't use it neither. But I am using it for building CM with the suggested cache size of 50G.

For revision control I would try to use the repo tool. As the docs state "there are several dozen git repositories that come together to form the full CyanogenMod source code base". You can find the description of these repositories in <your CM directory>/.repo directory. I have not tried to use the git command directly.
_________________
# cd /pub/
# more beer
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Tue Sep 02, 2014 4:32 pm    Post subject: Reply with quote

forrestfunk81 wrote:
ccache is included in the CM build tools. It should be in <your CM directory>/prebuilts/misc/linux-x86/ccache/
For gentoo I don't use it neither. But I am using it for building CM with the suggested cache size of 50G.

Found it. At first I was looking in "prebuilt", not recognizing that both "prebuilt" and "prebuilts" were in there. I'll activate and rerun.
forrestfunk81 wrote:

For revision control I would try to use the repo tool. As the docs state "there are several dozen git repositories that come together to form the full CyanogenMod source code base". You can find the description of these repositories in <your CM directory>/.repo directory. I have not tried to use the git command directly.

I guess I'll have to rtfm on "repo".

Misc... I see a note about "However, as of 10.1 CyanogenMod does not build with 64bit host binaries on some systems. You will have to set something like BUILD_HOST_32bit=1 in your environment when building on such 64bit system." It looks like it's only needed "on some systems", and I've already successfully built, but haven't tried booting it yetl (as previously mentioned) Is this something I need to do also for 110.?

And another... I presume that this builds a "Nightly" as of the date when I did the last "repo sync", or does it really build a "trunk"? (In svn-speak) For better W.A.F. I'd rather stick to Milestones, at least for her phone.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
forrestfunk81
Guru
Guru


Joined: 07 Feb 2006
Posts: 565
Location: münchen.de

PostPosted: Tue Sep 09, 2014 12:59 pm    Post subject: Reply with quote

Building on amd64 works for me without setting any variables. And yes, if you followed the CM howto, this will build nightlies of the cm11.0 branch. Because you checked out the cm-11.0 branch:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0

The nightly builds are working for me and atm I don't have time to dig depper into the repo command. So if you know how to check out and build milestone tags/branches please let me know.
_________________
# cd /pub/
# more beer
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Tue Sep 09, 2014 2:55 pm    Post subject: Reply with quote

Incidentally, I forgot to post that I've gotten the build process running - I'm able to build nightlies, too.

Fun little aside - when you run "source build/envsetup.sh" more than setting any environment variables, it defines functions that are then available to your command prompt. Things like "breakfast" and "brunch" (the ones I've used) are not shell scripts, their bash functions defined in envsetup.sh. As near as I can tell, if I wanted to build Milestone-10 in a few days, I would say "breakfast apexqtmo-M10" followed by "brunch apexqtmo-M10".

First problem is that all of the CM11 developers for my phone have bought new phones and left. That's why I'm looking into becoming one.

Second problem is that there were two end-of-July commits that broke CM11 on my phone - there hasn't been a bootable build since, and others have tried. There is another ROM derived from CM11 called "FatToad", and they have been working by reverting the two commits.

I don't really know spit about git, so I can't figure out how to revert the commits:
Code:
~/android/system/vendor/samsung $ git revert -m 1 187689ea76effd42b680a147d080512ac62a0fed
error: Mainline was specified but commit 187689ea76effd42b680a147d080512ac62a0fed is not a merge.
fatal: revert failed

That big long handle is the only name I have for something to revert. So I did a little google and found "git log 187689ea76effd42b680a147d080512ac62a0fed" that gives me:
Code:
commit 187689ea76effd42b680a147d080512ac62a0fed
Author: Ethan Chen <intervigil@gmail.com>
Date:   Mon Jul 28 12:36:03 2014 -0700

    apexqtmo: Inherit from common msm8960 proprietary files

commit aecee5463eeb1e78001c9b386553f5a47cb981ae
Author: Ethan Chen <intervigil@gmail.com>
Date:   Mon Jul 28 11:23:12 2014 -0700

    d2lte: Move common d2lte libs into msm8960-common
   
    * Allow apexqtmo and expressatt to inherit these as well

commit d2fdc56232745b32aca5fee7cc0fcb3511a9a503
Merge: 9338358 399f67a

So maybe it wants a "merge number" instead of a "commit number", and maybe "9338358" is the right number. I saw "399f67a" being used or referenced in earlier commits. Thus:
Code:
~/android/system/vendor/samsung $ git revert -m 1 9338358
error: Mainline was specified but commit 933835865d048a653979cd7a66df7320779e94cc is not a merge.
fatal: revert failed

So for the moment I'm stuck until I can find the right handle or syntax to revert these commits. I posted basically the same info over on xda-developers last night and haven't gotten any answer yet there.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum