Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,730,714 Members 41,225 Now Online
XDA Developers Android and Mobile Development Forum

[Guide]How to Compile PAC Rom

Tip us?
 
iurnait
Old
(Last edited by iurnait; 2nd March 2014 at 06:25 PM.)
#1  
Recognized Developer - OP
Thanks Meter 1055
Posts: 852
Join Date: Jun 2012
Location: Southern California
Default [Guide]How to Compile PAC Rom

Hey guys, so a lot of you have be eagerly anticipating the release of PAC-4.4. Others of you may be seeking pac for a device that is not supported at this moment. So I thought I would take this opportunity to write a guide on how to compile PAC.

In order to compile Android, I recommend that you use a Linux distro. For the purposes of this guide, I shall be using Ubuntu 13.10. It is pretty easy to set up, even as a dual boot with windows.

The first thing you need to do, once you have installed Ubuntu, is to set it up to be able to compile Android. There are a lot of guides that show you how to do this, and this guide has pretty clear instructions. Follow all of his directions until you reach the point where he tells you to initialize the repository (The command he has as an example there is repo init -u git://github.com/AOKP/platform_manifest.git -b jb-mr2. Do not run this command or you will have downloaded the AOKP sources instead of the PAC sources)

To download the pac sources, we need to initialize the repository first. For this guide, I will be downloading the pac source to ~/android/pac. Run:
Code:
mkdir -p ~/android/pac
cd ~/android/pac
repo init -u git://github.com/PAC-man/pacman.git -b pac-4.4
Now it is time to download the source itself. Keep in mind that the source is rather large (~10+ GB), so you might want to make yourself a cup of tea (or 10 cups if you have a crappy isp) while waiting. Run:
Code:
repo sync
Now, it is time to do the actually compiling. If your device is already supported by PAC, please skip directly to post 3. Else, go to post 2.
The Following 28 Users Say Thank You to iurnait For This Useful Post: [ Click to Expand ]
 
iurnait
Old
(Last edited by iurnait; 5th March 2014 at 04:26 PM.)
#2  
Recognized Developer - OP
Thanks Meter 1055
Posts: 852
Join Date: Jun 2012
Location: Southern California
Default Adding Support for a device

To add support for your device, the first thing you need to do is to hunt down your device tree. If you are not sure where your device tree is located, google it or ask in your device's subforum. Now, it is time to add the files required to build.

From the root of directory where you have downloaded the pac source (~/android/pac), go to the vendor/pac directory. This is where we will be making the changes necessary to build for your device. Here are the files that need to be modified/added. Obviously, substitute your devices codename for CODENAME.

1. dependencies/CODENAME.dependencies
This file grabs your device and kernel tree. Look at the dependencies file of a device that is similar to yours to figure out what you need to place in here. A list of all the devices we support and their respective codenames can be found here. Again, if you are unsure about what to place here, you may want to ask for help in your devices subforum. Whenever possible, try to use the CM device tree. For the vendor files, keep the account name as "Pinky-Inky-and-Clyde" but change the repository to the appropriate OEM (check here for repos). Do not worry if the vendor files for your device are not in that repository. We will be adding them later.

Here is a sample CODENAME.dependencies file for a Samsung device (note that the account names are case sensitive):
Code:
[
  {
    "account":      "Pinky-Inky-and-Clyde",
    "repository":   "proprietary_vendor_samsung",
    "target_path":  "vendor/samsung",
    "revision":     "cm-11.0"
    },
  {
    "account":      "CyanogenMod",
    "repository":   "android_device_samsung_CODENAME",
    "target_path":  "device/samsung/CODENAME",
    "revision":     "cm-11.0"
  },
  {
    "account":      "CyanogenMod",
    "repository":   "android_kernel_samsung_CODENAME",
    "target_path":  "kernel/samsung/CODENAME",
    "revision":     "master"
  },
  {
    "account":      "CyanogenMod",
    "repository":   "android_hardware_samsung",
    "target_path":  "hardware/samsung",
    "revision":     "cm-11.0"
  }
]
Once you have done this, go to the root of your pac source (~/android/pac for this guide), and run
Code:
./vendor/pac/tools/getdependencies.py CODENAME
This will attempt to create the file .repo/local_manifests/roomservice.xml and then sync up the sources. If you have to make changes to your dependencies, please remove the roomservice.xml file and re-run the script again to ensure that no incorrect repositories are left lingering.
Go to the vendor files directory (~/android/pac/vendor/YOUR_OEM), and search for the vendor files of your device. If they are not there, you will have to search for them online and copy them into the folder.
Alternatively, if your device has an extract-files.sh script, in the device tree (located in device/OEM/CODENAME), you can hook up your device via usb and run that command to grab the vendor files directly from your device. In this case, connect your device and run:
Code:
cd device/OEM/CODENAME
./extract-files.sh
2. products/pac_CODENAME.mk
Again, look at the same file for a device that is similar to yours and make the appropriate changes for your device.

Here is a sample pac_CODENAME.mk file for a hdpi device:
Code:
# Check for target product
ifeq (pac_CODENAME,$(TARGET_PRODUCT))

# OVERLAY_TARGET adds overlay asset source
OVERLAY_TARGET := pa_hdpi

# PAC device overlay
PRODUCT_PACKAGE_OVERLAYS += vendor/pac/overlay/pac/hdpi_480x800

# PAC boot logo
PRODUCT_COPY_FILES += \
    vendor/pac/prebuilt/common/bootlogo/pac_logo_480x800.rle:root/logo.rle

# Copy bootanimation
PRODUCT_COPY_FILES += \
    vendor/pac/prebuilt/480x800/bootanimation.zip:system/media/bootanimation.zip

# include PAC common configuration
include vendor/pac/config/pac_common.mk

# Inherit CM device configuration
$(call inherit-product, device/samsung/CODENAME/cm.mk)

PRODUCT_NAME := pac_CODENAME

endif
Note: for the PAC device overlay, look inside vendor/pac/overlay/pac for the available overlays. Likewise, for the bootanimation and boot logo, look in their respective directories for the available sizes.

3. vendorsetup.sh
Add a line that looks something like this in the appropriate area of this file (under the appropriate OEM, and in alphabetical order, please).
Code:
add_lunch_combo pac_CODENAME-userbebug
--- The below files are not necessary for successful compilation, but are required if you submit your device for official PAC support. ---
4. Contributors
5. Nightly.xml
6. XDAThreads
7. devices-breakdown.xml

For these files, follow the format of the other devices.
The Following 14 Users Say Thank You to iurnait For This Useful Post: [ Click to Expand ]
 
iurnait
Old
(Last edited by iurnait; 2nd March 2014 at 06:35 PM.)
#3  
Recognized Developer - OP
Thanks Meter 1055
Posts: 852
Join Date: Jun 2012
Location: Southern California
Default Building PAC

Now that we got all of the housekeeping out of the way, it is time to build the rom!

Open up a terminal and change directory to the base of where you downloaded the PAC source to begin compiling. Run (substitute your device's codename for CODENAME):
Code:
./build-pac.sh CODENAME
There are some additional options available in the build script. To see them all, simply run:
Code:
./build-pac.sh
If everything goes well, your build should be starting. Go take a walk or something while it is building. This may take a while if you have a computer with weak specs.
The Following 16 Users Say Thank You to iurnait For This Useful Post: [ Click to Expand ]
 
iurnait
Old
(Last edited by iurnait; 3rd March 2014 at 02:17 AM.)
#4  
Recognized Developer - OP
Thanks Meter 1055
Posts: 852
Join Date: Jun 2012
Location: Southern California
Default Submitting your device for official support

Once you have successfully built PAC for your device and tested it, you can submit your changes to our gerrit for official support and automatic nightly builds.

In order to do this, you need to first sign up on our gerrit and get your ssh keys set up. So head on over to http://review.pac-rom.com/ to register for an account. Next, we need to generate an ssh key pair in order to push changes to gerrit. To check if you already have a key pair generated, run
Code:
ls ~/.ssh
If it shows a id_rsa.pub, you already have your keys generated and you can skip to the adding your ssh key to gerrit part.

On the other hand, if there is nothing in your .ssh folder, run
Code:
ssh-keygen -t rsa -C "your_email@example.com"
When you run this command, it will ask you where you want to save this file. Just hit enter. Next, it will ask you for a passphrase for your private key. Enter a passphrase here that you can remember.

Now, it is time to add your public key to our gerrit. To copy your public key over, run:
Code:
sudo apt-get install xclip
xclip -sel clip < ~/.ssh/id_rsa.pub
(Alternatively, you can cat the file and just copy it, but the above mentioned way avoids any missing characters while copying.)

Now, login to our gerrit and go to your account settings > ssh public keys. Click on add, and paste the key and save.

It is time to upload your changes. We have a script to make this process easier. To grab the script, run:
Code:
cd ~/bin
wget http://pac-rom.com/downloads/pac-review
chmod a+x pac-review
Now, run:
Code:
cd ~/android/pac
cd vendor/pac
git add -A
git commit
This should open up a text editor (probably nano) where you can put a commit message. For our purposes, just write something along the lines of "Add support for ___." To save the file, hit Ctrl + o. To exit, hit Ctrl + x. Then, run:
Code:
pac-review -p
Follow the prompts and your changes should be automatically pushed and a link will show to your change on gerrit.

If you realize that you made a mistake in your commit, DO NOT submit a new change. Instead, make your changes, then run:
Code:
git add -A
git commit --amend
Update your commit message if necessary and then push with the pac-review script. This will create a new patchset on our gerrit instead of creating a new commit.

And that is all! If you have any questions, dont hesitate to ask them here. Ill try to get back to you as soon as possible
The Following 10 Users Say Thank You to iurnait For This Useful Post: [ Click to Expand ]
 
##W4TCH0UT##
Old
#5  
##W4TCH0UT##'s Avatar
Senior Member
Thanks Meter 597
Posts: 868
Join Date: Oct 2013
Location: Town of Kernels
Hey iurnait, I didn't find any instructions on pac's github on how to clone the entire trees. Please help.


Kernels are my speciality....

My Works:
Galaxy Grand Duos:
*DedS 4.4 Kernel
*DedS 4.2.2 Stock Kernel

Micromax Canvas 2:
*DedS 4.2.x Kernel

Galaxy Grand 2:
*DedS 4.3 JB Kernel

Motorola Moto X:
*Drool 4.4 KK Kernel
 
iurnait
Old
#6  
Recognized Developer - OP
Thanks Meter 1055
Posts: 852
Join Date: Jun 2012
Location: Southern California
Quote:
Originally Posted by Ateekujjawal View Post
Hey iurnait, I didn't find any instructions on pac's github on how to clone the entire trees. Please help.
cd into the directory where you are working, and then run
Code:
repo init -u git://github.com/PAC-man/pacman.git -b pac-4.4
then run
Code:
repo sync
The Following 3 Users Say Thank You to iurnait For This Useful Post: [ Click to Expand ]
 
##W4TCH0UT##
Old
#7  
##W4TCH0UT##'s Avatar
Senior Member
Thanks Meter 597
Posts: 868
Join Date: Oct 2013
Location: Town of Kernels
Quote:
Originally Posted by iurnait View Post
cd into the directory where you are working, and then run
Code:
repo init -u git://github.com/PAC-man/pacman.git -b pac-4.4
then run
Code:
repo sync
By doing this, will I get all the packages_apps_settings,frameworks_av etc.


Kernels are my speciality....

My Works:
Galaxy Grand Duos:
*DedS 4.4 Kernel
*DedS 4.2.2 Stock Kernel

Micromax Canvas 2:
*DedS 4.2.x Kernel

Galaxy Grand 2:
*DedS 4.3 JB Kernel

Motorola Moto X:
*Drool 4.4 KK Kernel
 
iurnait
Old
#8  
Recognized Developer - OP
Thanks Meter 1055
Posts: 852
Join Date: Jun 2012
Location: Southern California
Quote:
Originally Posted by Ateekujjawal View Post
By doing this, will I get all the packages_apps_settings,frameworks_av etc.
this will grab everything needed to compile
The Following 2 Users Say Thank You to iurnait For This Useful Post: [ Click to Expand ]
 
##W4TCH0UT##
Old
#9  
##W4TCH0UT##'s Avatar
Senior Member
Thanks Meter 597
Posts: 868
Join Date: Oct 2013
Location: Town of Kernels
How can I use linaro toolchain to compile pacman and where to download it.


Kernels are my speciality....

My Works:
Galaxy Grand Duos:
*DedS 4.4 Kernel
*DedS 4.2.2 Stock Kernel

Micromax Canvas 2:
*DedS 4.2.x Kernel

Galaxy Grand 2:
*DedS 4.3 JB Kernel

Motorola Moto X:
*Drool 4.4 KK Kernel
 
MetaIIica
Old
#10  
MetaIIica's Avatar
Senior Member
Thanks Meter 2131
Posts: 1,001
Join Date: Aug 2012
Location: Bückeburg

 
DONATE TO ME
Simplest Method you found here:

http://forum.xda-developers.com/show....php?t=2644910

You need only one a Machine with a Ubuntu ready,

  • Device: Samsung Galaxy S IV I9505
  • ROM: PAC Rom 4.4.4 Black Power Edition
  • Kernel: KT4 AOSP
  • Recovery: Philz CWM Recovery
  • Battery: ZeroLemon 7500mAh



The Following User Says Thank You to MetaIIica For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes