maderschramm
01-21-2011, 05:27 PM
Wrote this up while doing it, so it's by no means my best work, but devs should love screwing around with this stuff anyway. Please don't pm me asking me for help because I probably can't help you... :S sorry.
Expect this to take ~3 hours
This is for ubuntu 11.04 64 bit. If you have a different version upgrade. It might work, I don't know. If you have 32-bit you need 64, sorry.
Directions are from here:
Get Android Source Code | Android Open Source (http://source.android.com/source/download.html)
But I made them work for me.
I use vim, you should too. If you'd rather use gedit, simply replace [vim] with [gedit] in the commands.
All these commands are run in a terminal window. When you're supposed to type something, I have it listed with brackets - [] - everything else is descriptive. NEVER INCLUDE BRACKETS UNLESS SPECIFIED (which is never, just fyi)!!!
I'm no expert, but this worked for me, so it should for you too, these are simply the way I did it so don't expect many updates or a lot of support, I just did it as a favor.
Good luck!
Note: All commands are run in a terminal window - if you don't know what that is, learn how to use linux before proceeding.
------------------
Set Up Machine
------------------
[sudo apt-get install vim]
[sudo vim /etc/apt/sources.list]
(opens sources for ubuntu)
press "insert" to allow inputting into the file
scroll to bottom
press "enter" to get a new line
add:
deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
to bottom of list
press "escape" to quit input mode
type ":w" "enter" to save
type ":q" "enter" to quit
[sudo aptitude update]
(update repository list)
[sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl sun-java5-jdk zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev]
(installs sh--)
[sudo update-java-alternatives -s java-1.5.0-sun]
(set java 1.5 default)
[sudo ln -s /usr/lib32/libX11.so.6 /usr/lib32/libX11.so]
(symlynk to workaround lack of packages for X11)
--------------------
Installing Repo
--------------------
you need to have a ~/bin/ file that is in your path. change to home dir
[cd ~]
[ls]
if you don't see a "bin" dir:
[mkdir bin]
[ls]
you should now see a "bin" dir
now type
[echo $PATH]
you should see "~/bin" somewhere in your path, if not:
[sudo vim /etc/profile]
press "insert" to switch to edit mode
scroll to bottom of the file
press enter to get to a new line
enter:
PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/bin/X11:/usr/games:~/bin"
press "esc" to get out of input mode
press ":" then "w" "enter" to save the file
press ":" then "q" "enter "to quit
run /etc/profile to make your changes
[. /etc/profile]
(note that there's a space character between "." and "/")
download the Repo and put it into /bin:
[curl http://android.git.kernel.org/rep > ~/bin/repo]
make it executable
[chmod a+x ~/bin/repo]
----------------------
Initializing Repo
----------------------
make a working directory somewhere on your computer, eg:
[mkdir mydroid]
change to the directory
[cd mydroid]
you can make it wherever you want however. Mine is:
"~/Documents/AOSP"
inside your directory, run repo init
[repo init -u git://android.git.kernel.org/platform/manifest.git]
this installs a master copy. if you want a different version, use the modifier -b, eg:
[repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake]
When prompted, configure Repo with your real name and email, make your email address your one that is associated with your google account if you plan to submit code
----------------------
Get ze Files!!!
----------------------
[repo sync]
now ve vait....a long time
----------------------
Verifying Git Tags
----------------------
[gpg --import]
paste the following into the terminal (ctrl + shift + v):
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
lFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7
8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu 5hOF9KXwCgkxMD
u4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEa UA6U90sEoVks0Z
wNj96SA8BL+a1OoEUUfpMhiHyLuQSftxisJxTh+2QclzDviDya TrkANjdYY7p2cq
/HMdOY7LJlHaqtXmZxXjjtw5Uc2QG8UY8aziU3IE9nTjSwCXeJn uyvoizl9/I1S5
jU5SA/9WwIps4SC84ielIXiGWEqq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
hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+Bmr EOeCUOAJ9qmR0l
EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KL M=
=Wi5D
-----END PGP PUBLIC KEY BLOCK-----to end input process, type
[ctrl + d]
Now you can validate anything by typing
[git tag -v (tagname)]
where (tagname) is defined by you
----------------
Build the Code
----------------
From within your working directory (eg mydroid), type:
[source build/envsetup.sh]
[lunch]
(you have some options here, press "enter" to select "full-eng")
[make]
I got an error telling me "Your version is: java version "1.5.0_19". The correct version is: 1.6."
Which means google lied, so now I set my java back to 1.6
[sudo apt-get install sun-java6-jdk]
(installs java 6 jdk)
and then re-ran the command to build
[make]
wait for awhile...
and you're done! congrats... maybe?
as I said, good luck!
edit: cleaned up the formatting a bit
Expect this to take ~3 hours
This is for ubuntu 11.04 64 bit. If you have a different version upgrade. It might work, I don't know. If you have 32-bit you need 64, sorry.
Directions are from here:
Get Android Source Code | Android Open Source (http://source.android.com/source/download.html)
But I made them work for me.
I use vim, you should too. If you'd rather use gedit, simply replace [vim] with [gedit] in the commands.
All these commands are run in a terminal window. When you're supposed to type something, I have it listed with brackets - [] - everything else is descriptive. NEVER INCLUDE BRACKETS UNLESS SPECIFIED (which is never, just fyi)!!!
I'm no expert, but this worked for me, so it should for you too, these are simply the way I did it so don't expect many updates or a lot of support, I just did it as a favor.
Good luck!
Note: All commands are run in a terminal window - if you don't know what that is, learn how to use linux before proceeding.
------------------
Set Up Machine
------------------
[sudo apt-get install vim]
[sudo vim /etc/apt/sources.list]
(opens sources for ubuntu)
press "insert" to allow inputting into the file
scroll to bottom
press "enter" to get a new line
add:
deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
to bottom of list
press "escape" to quit input mode
type ":w" "enter" to save
type ":q" "enter" to quit
[sudo aptitude update]
(update repository list)
[sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl sun-java5-jdk zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev]
(installs sh--)
[sudo update-java-alternatives -s java-1.5.0-sun]
(set java 1.5 default)
[sudo ln -s /usr/lib32/libX11.so.6 /usr/lib32/libX11.so]
(symlynk to workaround lack of packages for X11)
--------------------
Installing Repo
--------------------
you need to have a ~/bin/ file that is in your path. change to home dir
[cd ~]
[ls]
if you don't see a "bin" dir:
[mkdir bin]
[ls]
you should now see a "bin" dir
now type
[echo $PATH]
you should see "~/bin" somewhere in your path, if not:
[sudo vim /etc/profile]
press "insert" to switch to edit mode
scroll to bottom of the file
press enter to get to a new line
enter:
PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/bin/X11:/usr/games:~/bin"
press "esc" to get out of input mode
press ":" then "w" "enter" to save the file
press ":" then "q" "enter "to quit
run /etc/profile to make your changes
[. /etc/profile]
(note that there's a space character between "." and "/")
download the Repo and put it into /bin:
[curl http://android.git.kernel.org/rep > ~/bin/repo]
make it executable
[chmod a+x ~/bin/repo]
----------------------
Initializing Repo
----------------------
make a working directory somewhere on your computer, eg:
[mkdir mydroid]
change to the directory
[cd mydroid]
you can make it wherever you want however. Mine is:
"~/Documents/AOSP"
inside your directory, run repo init
[repo init -u git://android.git.kernel.org/platform/manifest.git]
this installs a master copy. if you want a different version, use the modifier -b, eg:
[repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake]
When prompted, configure Repo with your real name and email, make your email address your one that is associated with your google account if you plan to submit code
----------------------
Get ze Files!!!
----------------------
[repo sync]
now ve vait....a long time
----------------------
Verifying Git Tags
----------------------
[gpg --import]
paste the following into the terminal (ctrl + shift + v):
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuRO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xAmHYX79EMKHDSThf/8AAwUIAJPWsB/M
pK+KMs/s3r6nJrnYLTfdZhtmQXimpoDMJg1zxmL8UfNUKiQZ6esoAWtDg pqt7Y7s
KZ8laHRARonte394hidZzM5nb6hQvpPjt2OlPRsyqVxw4c/KsjADtAuKW9/d8phb
N8bTyOJo856qg4oOEzKG9eeF7oaZTYBy33BTL0408sEBxiMior 6b8LrZrAhkqDjA
vUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmU tkBszwo
G1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ
hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+Bmr EOeCUOAJ9qmR0l
EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KL M=
=Wi5D
-----END PGP PUBLIC KEY BLOCK-----to end input process, type
[ctrl + d]
Now you can validate anything by typing
[git tag -v (tagname)]
where (tagname) is defined by you
----------------
Build the Code
----------------
From within your working directory (eg mydroid), type:
[source build/envsetup.sh]
[lunch]
(you have some options here, press "enter" to select "full-eng")
[make]
I got an error telling me "Your version is: java version "1.5.0_19". The correct version is: 1.6."
Which means google lied, so now I set my java back to 1.6
[sudo apt-get install sun-java6-jdk]
(installs java 6 jdk)
and then re-ran the command to build
[make]
wait for awhile...
and you're done! congrats... maybe?
as I said, good luck!
edit: cleaned up the formatting a bit