Aosp Crave Tutorial-3
Aosp Crave Tutorial-3
– Megh
So, you just got added to the team, and want to build your rom on crave, this is the correct place to
come.
This is a tutorial assuming that you know the basics of rom building and have built a working rom
before. This also assumes that you have a set of trees ( device tree, vendor tree, kernel) and know
what dependencies your device needs.
Currently, Windows and Linux is supported, support for android may be added in the future.
```
cd ~/Downloads
mv crave-* crave
sudo cp crave /usr/bin/
```
This is just shortening the file name, and moving it to a place in path, so you can directly run crave.
For windows, obv the instructions would be different, but you would have to add it to path like you
would do anything else, tons of instructions online, or you can skip this step :smile
now run
```
crave -c crave.conf devspace
```
This will be only needed the first time, the next time you’ll only have to run crave devspace
after running, this is the screen you should see.( this is your devspace, each user has their own
devspace, and is private to some level, but dont enter nuclear launch codes here maybe.)
now run crave list
below, is what you should see
( or atleast something similar)
Now, let’s say you want to build one of these two roms ( more on building roms except this later)
Now, here, building with crave is somewhat different that what you would do on a regular server.
Essentially, right now we are in the “devspace”, which has limited hardware, which cannot build
aosp. But what can build aosp, is their servers, currently having 64gb of ram. So you would have to
write a command to run your build enclosed by crave run.
Now, there are 2 methods of running builds, i prefer the second one, but you should select whatever
feels easy.
1.
crave run --no-patch --clean “ \
rm -rf .repo/local_manifests && \
git clone https://github.com/username/yourlocalmanifest .repo/local_manifests && \
repo sync --force-sync -c -j $(nproc) && \
source build/envsetup.sh && \
lunch rom_device-userdebug && \
mka bacon”
Note, the above is just a template, feel free to modify it yourself. Now what does each of these do?
Crave has a feature, which would let you make changes to your devspace, and that changes get
applied to the source in the server automatically, without even commiting or pushing them to git.
But currently that is broken for aosp, so we specify that we dont want to patch the rom directory.
Running clean is just a way of having a fresh image of the source to build on, you shouldnt need to
do this many times. But in the case you mess up the source very badly ( happens to everyone) you
would run clean.
Then it is just a matter of ensuring there are no left over files in local_manifests, syncing your own,
and then building.
repo sync
lunch rom_device-userdebug
mka bacon
```
now, either upload this script to github, to git clone this repo, or upload to github gist.
```
crave run –no-patch --clean “git clone https://github.com/username/scripts . && bash script.sh ”
```
or, if you prefer github gists,
```
crave run --no-patch --clean "wget -O a37.sh
https://gist.github.com/Meghthedev/1cf556f04cb6752c295447e22bd7bc76/raw/
2d0eff7a442b2ba54cb45e736e5c33b598e21c25/a37.sh && chmod +x a37.sh && ./a37.sh"
```
( just wget the build script and then running it after making it executable.)
Here is the script i made, which was slightly more complex, which basically shows you could do
quite a lot on crave
https://gist.github.com/Meghthedev/6314eb98ff1d2fb8b7e03769a739a101
Once you have run the command, your build will be added to the queue, the queue isnt much long,
For now the method is, for example you want to build crdroid, now crdroid shares a lot of common
repos with los, so you clone los, and in your build script, you add
```
repo init -u https://github.com/crdroidandroid/android.git -b 13.0 --git-lfs
```
before doing repo sync, note, it is recommended you do same android version re syncs, ie android
13 rom on top of android 13. you may face problems otherwise.
Now, what to do if your build succeeded, well the method is to first pull that build to your devspace,
so go to romfolder/repo and do
```
crave pull out/target/product/*/*.zip
```
and that would pull the zip to your devspace, from there, it is just a matter of uploading.
Whether you use github releases, or ksau, or sourceforge, or devuploads, its your choice, you can
ask about these methods in the discord server.