[Tutorial] How to build a ROM?

Search This thread

eagleeyetom

Retired Senior Mod & DC Lead - Active Pole Dancer
Jan 22, 2011
7,709
14,677
37
Gdańsk
xda-developers.com
Samsung Galaxy Watch 4
Hello everybody. After many attempts to build a ROM I decided to share my knowledge with you :)
I'm going to show you how to build CM7 for X8 using official CM sources.

As the result you will have:

CyanogenMod in version 2.3.7 for X8 aka Shakira. You need to have unlocked bootloader and flash FXP kernel to use this ROM.

WARNING: This may brick your device. You have been warned!

What are the requirements?

0. A smart head, and being willing to learn something new.
1. A PC featuring a dual-core CPU (the more, the merrier) and at least 1.5GB RAM. Having a CPU that supports 64-Bit Mode (Intel EM64T / AMD64) and Paravirtualization (Intel VT-x / AMD-V) is required if you are planning to run a 64-Bit distribution.
2. A Linux based system such as Ubuntu or Linux Mint. My guide should work on any other Ubuntu based distribution as well, though you need to adapt commands in case you're running a RPM based Red Hat/Fedora/openSUSE distribution. To make things easier if your main OS is Windows you better consider using Linux in a Virtual Machine (VirtualBox recommended).
3. Speedy internet connection so the download of the CyangogenMod sources don't take forever.
4. About 50GB of FREE disk space.
5. Ability to access to Internet in Linux / your Virtual Machine so you can access Google and XDA to search for help, because everything that can go wrong will go wrong ;P
Shall we dance? :)

1. Download and install Linux. Linux is perfectly legal free opensource software; you won't go to jail for downloading it. I prefer Ubuntu 10.10 or Linux Mint 10 (which I'm using). The best choice is to use the respective 64-Bit edition. You may find links in next post.
2. There is a tool called "Terminal" - it's your new best friend. Create a shortcut in desktop.

How Linux look like
attachment.php


Just like Windows, but better ;)

Paste this into terminal:

For Ubuntu below 11.04 use this:

Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jdk pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib

NOTE: As for Ubuntu 11.04+ (also applies to Linux Mint 11+) see what Novek posted in the CMCompiler thread.

lib32readline5-dev has been replaced by lib32readline-gplv2-dev on 11.10
And "gcc-4.3-multilib g++-4.3-multilib" aren't used from 11.04 and up - not needed, so use this code:
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jdk pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev

You may want to add that piece of intel.

This will install required packages. If you'll receive errors try to delete packages from above code.

After this you'll need to create folders for CM repo.
Type:
Code:
mkdir -p ~/bin 
mkdir -p ~/android/system
PATH=~/bin:$PATH
You could name second folder as you want.

Next step: Repo installation

Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo 
chmod a+x ~/bin/repo

chmod is a very important command. It's allows you to give permissions for specific files/folders.

Next step: Downloading the beast ;)

Remember to type correct folder name!

Code:
cd ~/android/system/ 
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread 
repo sync -j10

-j attribute is responsible for number of processes taken in single action. If you have powerful PC you could use -j16 or even -j32. Bigger number - quicker extraction of files.

Get the ROM Manager just in case;)

Code:
~/android/system/vendor/cyanogen/get-rommanager

Next step: Download Android-SDK to make ADB work

Extract this to home directory, then
Code:
cd ~/android-sdk-linux/tools
 ./android

Just do what is shown in this movies:


Download all files and get ready.

Next step: Copy proprietary files (you need to have phone connected in debugging mode) - For proprietary files use stock ROM or official CM 7.1.

Type in terminal:
Code:
cd ~/android/system/device/semc/shakira/ 
./extract-files.sh
If you have problems copy adb file to this directory and edit extract-files.sh to have something like this:

./adb pull instead of adb pull

If you have troubles do this:

After installation open terminal and type:

Code:
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools

Put correct path to your adb.

Type
Code:
./adb devices
if you'll receive such line
Code:
"List of devices attached
 ???????????? no permissions"
do specific thing.

Code:
sudo touch /etc/udev/rules.d/51-android.rules && sudo sh -c "echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", SYSFS{idProduct}=="612e", MODE="0666"' >> /etc/udev/rules.d/51-android.rules" && sudo chmod 644 /etc/udev/rules.d/51-android.rules

If something goes wrong type
Code:
lsusb
to see which devices are connected and change code.

Then

Code:
sudo restart udev
sudo ./adb kill-server
sudo ./adb start-server

And it's ready to action.

Next step: Setting build environment

Type in terminal:
Code:
cd ~/android/system/
. build/envsetup.sh && breakfast shakira

You'll see the list of CM devices
Shakira is number 136 (right now is #144)
- It won't work due to changes in CM device tree.

attachment.php


So use:

Code:
lunch cyanogen_shakira-eng
or
breakfast shakira

Next: Step - build!

All you need to do right now is type magic command "make"
Add -j4 to make it much quicker

To obtain update.zip file type
Code:
make -j4 bacon

attachment.php


Now wait patiently and fight errors :)

I'm glad if I helped somebody to build his/her first ROM.
If I made any mistakes feel free to correct me.

Thanks to B.Jay for help.

I spent some time to write this, so hit thanks button ;)
You can also donate me. All donations are highly appreciated :beer: ;)
 

Attachments

  • Ubuntu-2012-01-20-08-44-36.png
    Ubuntu-2012-01-20-08-44-36.png
    84.3 KB · Views: 49,563
  • Ubuntu-2012-01-20-10-48-42.jpg
    Ubuntu-2012-01-20-10-48-42.jpg
    23.2 KB · Views: 46,916
  • Ubuntu-2012-01-20-10-55-14.jpg
    Ubuntu-2012-01-20-10-55-14.jpg
    33.4 KB · Views: 44,591
Last edited:
B

B.Jay

Guest
Okay, since eagleeyetom decided to make his research about how to build CM7 public, here are a few thoughts of my own to accompany his guide...

If you're a Windows user and don't want to go through the hassle of dual-booting Linux with Windows XP/Vista/7 it's highly recommended that you install VirtualBox as your virtualization software (also download and install the Extensions Pack if you want to connect to your phone through USB right out of the VM!). Stay clear from VMware Player or VMware Workstation. Things like 3D acceleration will not work with VMware! A important aspect if you're opting to install a Gnome3/GTK3 based distribution release, or you simply want the eye-candy to make work more fun.

This means ... the specs of your system should be above "average". Since the Virtual Machine, into which you're going to install Linux, will need some RAM for its own don't even think about this approach if your system is at, or well below, 3GB RAM. Especially with Windows Vista or Windows 7 being your OS upon which VirtualBox will run you will find yourself in the situation very quickly that Windows sucks up a good Gigabyte of RAM just for itself - and keep in mind that VirtualBox will need a wee bit more than just the 1.5GB RAM (or whatever you're going to assign) + 8MB VRAM to run.

Of course you also need some spare space on your hard drive(s) as you need to create a Virtual Hard Drive for the Virtual Machine. 80GB should be considered the minimum here as you're going to need quite some space for the source, the temp files that get created during the compile, and the finalized ROM.

I'd recommend you partition your virtual hard drive this way...

~1GB ext4 as /boot
2* the amount of RAM you assigned to your VM as swap (3GB swap if your VM runs on 1.5GB RAM)
The rest ext4 as /

Stay away from btrfs as it will give terrible performance in a VM.

A better partitioning would be to keep / and /home separated in case you plan to upgrade the Linux installation in your VM...

~1GB ext4 as /boot
2* the amount of RAM you assigned to your VM as swap (3GB swap if your VM runs on 1.5GB RAM)
~10-15GB ext4 as /
The rest ext4 as /home

That way you won't lose your stuff in /home in case things go wrong at an dist-upgrade.

Once you got Linux Installed install the Guest Additions ... it'll make working with your Virtual Machine and switching back and forth between the host OS and your VM way easier. In case the build of the kernel modules bombs out with a error message open a terminal and issue "sudo apt-get install build-essentials" ... that should solve the problem.

While you should get by with 1.5GB RAM to build CM7 (aka "Gingerbread") Google specifies the use of a 64-Bit Linux Distribution and at least 8GB RAM to tinker around with Ice Cream Sandwich. If you want to play around with the CM9 sources once they become available to the masses you better keep the aforementioned system requirements in mind.

If you happen to have questions about setting up VirtualBox feel free to post.

Value added Links:

Linux Mint 10 (as used by eagleeyetom)
Download here
Linux Mint 12 (latest version at the time of writing)
Download here

Ubuntu Linux 10.04 LTS or 11.10
Download here
 
Last edited:

harishrohaj

Senior Member
Nov 7, 2011
94
26
Mohali, Punjab
Thanks for the nice tutorial. Will try it.

I think I need to update my laptop as well because I will like to try it for the ICS also.

Any ways thank you very much for the tutorial.
 

brunodmsa

Senior Member
Jan 5, 2011
90
2
Valongo
adb is givin me error and i do the second step "./adb pull instead of adb pull" it givis device not found....

what do i do?
 

eagleeyetom

Retired Senior Mod & DC Lead - Active Pole Dancer
Jan 22, 2011
7,709
14,677
37
Gdańsk
xda-developers.com
Samsung Galaxy Watch 4
After installation open termina and type:
Code:
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
Put correct path to your adb.

Type ./adb devices if you'll receive such line "List of devices attached
???????????? no permissions" do specific thing.

Code:
sudo touch /etc/udev/rules.d/51-android.rules && sudo sh -c "echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", SYSFS{idProduct}=="612e", MODE="0666"' >> /etc/udev/rules.d/51-android.rules" && sudo chmod 644 /etc/udev/rules.d/51-android.rules

If something goes wrong type lsusb to see which devices are connected and change code.

Then
Code:
sudo restart udev
sudo ./adb kill-server
sudo ./adb start-server

And it's ready to action.
 
  • Like
Reactions: brunodmsa
B

B.Jay

Guest
Allow me to add the following piece of intel about the "51-android.rules" file in /etc/udev/rules.d/

For Ubuntu 10.04 LTS / Ubuntu 10.10 / Linux Mint 9 / Linux Mint 10

The better format of the file would be...
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", SYSFS{idProduct}=="612e", SYMLINK+="android_adb", MODE="0666", GROUP="plugdev"

Starting with Ubuntu Linux 11.04 / Linux Mint 11 the format of the file has changed and needs to be written as...

Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce:612e", SYMLINK+="android_adb", MODE="0666", GROUP="plugdev", TEST=="/var/run/ConsoleKit/database", RUN+="udev-acl --action=$env{action} --device=$env{DEVNAME}"

Just in case anyone following the guide doesn't run Lucid/Isadora or Maverick/Julia.
 
B

B.Jay

Guest
Leave out the ./ in front of adb

One you exported the path to where adb is located it will be found automatically.

./adb means that "adb" is located in the current directory you're in (./)

Also make sure that adb itself is executable!

---------- Post added at 03:02 PM ---------- Previous post was at 02:55 PM ----------

Also, to make the path thing permanent ...

- Open a terminal
- touch ~/.bashrc (in case the file doesn't exist)
- gedit ~/.bashrc
Insert ...
Code:
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
- Save the file.

Now, every time you log in the path with automatically be added to the path search tree.
 

brunodmsa

Senior Member
Jan 5, 2011
90
2
Valongo
its done

brunosa@brunosa ~/android/system/device/semc/shakira $ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0bda:8197 Realtek Semiconductor Corp. RTL8187B Wireless Adapter
Bus 002 Device 002: ID 0fce:2149 Sony Ericsson Mobile Communications AB Xperia X8 (debug)
brunosa@brunosa ~/android/system/device/semc/shakira $ ./extract-files.sh
19 KB/s (822 bytes in 0.040s)
6 KB/s (281 bytes in 0.040s)
21 KB/s (896 bytes in 0.040s)
21 KB/s (896 bytes in 0.040s)
358 KB/s (31712 bytes in 0.086s)
remote object '/system/bin/port-bridge' does not exist
468 KB/s (23516 bytes in 0.049s)
109 KB/s (9260 bytes in 0.082s)
1550 KB/s (185892 bytes in 0.117s)
213 KB/s (17904 bytes in 0.081s)
158 KB/s (13336 bytes in 0.082s)
322 KB/s (29872 bytes in 0.090s)
749 KB/s (93940 bytes in 0.122s)
517 KB/s (54364 bytes in 0.102s)
480 KB/s (50364 bytes in 0.102s)
590 KB/s (66844 bytes in 0.110s)
892 KB/s (62692 bytes in 0.068s)
116 KB/s (9300 bytes in 0.078s)
797 KB/s (93004 bytes in 0.113s)
278 KB/s (25784 bytes in 0.090s)
716 KB/s (86708 bytes in 0.118s)
62 KB/s (5008 bytes in 0.078s)
remote object '/system/lib/libuim.so' does not exist
1784 KB/s (808160 bytes in 0.442s)
698 KB/s (78940 bytes in 0.110s)
391 KB/s (37856 bytes in 0.094s)
1561 KB/s (483024 bytes in 0.302s)
1064 KB/s (163608 bytes in 0.150s)
1910 KB/s (576104 bytes in 0.294s)
112 KB/s (9412 bytes in 0.081s)
573 KB/s (71700 bytes in 0.122s)
209 KB/s (17636 bytes in 0.082s)
1064 KB/s (171904 bytes in 0.157s)
400 KB/s (38372 bytes in 0.093s)
212 KB/s (17836 bytes in 0.081s)
400 KB/s (38396 bytes in 0.093s)
398 KB/s (38452 bytes in 0.094s)
1116 KB/s (190020 bytes in 0.166s)
448 KB/s (46856 bytes in 0.102s)
399 KB/s (38372 bytes in 0.093s)
1033 KB/s (183460 bytes in 0.173s)
673 KB/s (42492 bytes in 0.061s)
235 KB/s (22160 bytes in 0.091s)
327 KB/s (30144 bytes in 0.089s)
327 KB/s (30144 bytes in 0.089s)
1627 KB/s (590324 bytes in 0.354s)
27 KB/s (1156 bytes in 0.041s)
109 KB/s (9220 bytes in 0.082s)
19 KB/s (820 bytes in 0.040s)
17 KB/s (745 bytes in 0.040s)
15 KB/s (635 bytes in 0.040s)
31 KB/s (1297 bytes in 0.040s)
184 KB/s (15513 bytes in 0.081s)
412 KB/s (21613 bytes in 0.051s)
1033 KB/s (84571 bytes in 0.079s)
114 KB/s (9640 bytes in 0.082s)
158 KB/s (13340 bytes in 0.082s)
1314 KB/s (271892 bytes in 0.201s)
remote object '/system/etc/wifi/softap/tiwlan_ap.ini' does not exist
remote object '/system/etc/wifi/softap/tiwlan_firmware_ap.bin' does not exist
371 KB/s (34308 bytes in 0.090s)
1086 KB/s (162880 bytes in 0.146s)
1183 KB/s (210640 bytes in 0.173s)
694 KB/s (75656 bytes in 0.106s)
2024 KB/s (1746564 bytes in 0.842s)
393 KB/s (33514 bytes in 0.083s)
174 KB/s (287 bytes in 0.001s)
982 KB/s (95456 bytes in 0.094s)
91 KB/s (3823 bytes in 0.040s)
170 KB/s (13836 bytes in 0.079s)
119 KB/s (9640 bytes in 0.078s)
114 KB/s (9292 bytes in 0.079s)
69 KB/s (5576 bytes in 0.077s)
290 KB/s (26852 bytes in 0.090s)
210 KB/s (17780 bytes in 0.082s)
65 KB/s (5252 bytes in 0.078s)
114 KB/s (9172 bytes in 0.078s)
remote object '/system/app/AntHalService.apk' does not exist
4 KB/s (189 bytes in 0.040s)
20 KB/s (842 bytes in 0.040s)
remote object '/system/lib/libanthal.so' does not exist
brunosa@brunosa ~/android/system/device/semc/shakira $ . build/envsetup.sh && lunch
bash: build/envsetup.sh: No such file or directory
brunosa@brunosa ~/android/system/device/semc/shakira $ ./extract-files.sh19 KB/s (822 bytes in 0.040s)
6 KB/s (281 bytes in 0.040s)
21 KB/s (896 bytes in 0.040s)
21 KB/s (896 bytes in 0.040s)
358 KB/s (31712 bytes in 0.086s)
remote object '/system/bin/port-bridge' does not exist
468 KB/s (23516 bytes in 0.049s)
115 KB/s (9260 bytes in 0.078s)
1665 KB/s (185892 bytes in 0.109s)
223 KB/s (17904 bytes in 0.078s)
166 KB/s (13336 bytes in 0.078s)
337 KB/s (29872 bytes in 0.086s)
830 KB/s (93940 bytes in 0.110s)
563 KB/s (54364 bytes in 0.094s)
479 KB/s (50364 bytes in 0.102s)
636 KB/s (66844 bytes in 0.102s)
957 KB/s (62692 bytes in 0.063s)
115 KB/s (9300 bytes in 0.078s)
823 KB/s (93004 bytes in 0.110s)
291 KB/s (25784 bytes in 0.086s)
769 KB/s (86708 bytes in 0.110s)
62 KB/s (5008 bytes in 0.078s)
remote object '/system/lib/libuim.so' does not exist
2042 KB/s (808160 bytes in 0.386s)
752 KB/s (78940 bytes in 0.102s)
427 KB/s (37856 bytes in 0.086s)
1854 KB/s (483024 bytes in 0.254s)
1188 KB/s (163608 bytes in 0.134s)
2126 KB/s (576104 bytes in 0.264s)
117 KB/s (9412 bytes in 0.078s)
682 KB/s (71700 bytes in 0.102s)
208 KB/s (17636 bytes in 0.082s)
1178 KB/s (171904 bytes in 0.142s)
434 KB/s (38372 bytes in 0.086s)
222 KB/s (17836 bytes in 0.078s)
433 KB/s (38396 bytes in 0.086s)
434 KB/s (38452 bytes in 0.086s)
1267 KB/s (190020 bytes in 0.146s)
485 KB/s (46856 bytes in 0.094s)
433 KB/s (38372 bytes in 0.086s)
1293 KB/s (183460 bytes in 0.138s)
740 KB/s (42492 bytes in 0.056s)
447 KB/s (22160 bytes in 0.048s)
340 KB/s (30144 bytes in 0.086s)
340 KB/s (30144 bytes in 0.086s)
1983 KB/s (590324 bytes in 0.290s)
27 KB/s (1156 bytes in 0.040s)
114 KB/s (9220 bytes in 0.078s)
19 KB/s (820 bytes in 0.040s)
17 KB/s (745 bytes in 0.040s)
15 KB/s (635 bytes in 0.040s)
31 KB/s (1297 bytes in 0.040s)
193 KB/s (15513 bytes in 0.078s)
435 KB/s (21613 bytes in 0.048s)
1140 KB/s (84571 bytes in 0.072s)
120 KB/s (9640 bytes in 0.078s)
166 KB/s (13340 bytes in 0.078s)
1490 KB/s (271892 bytes in 0.178s)
remote object '/system/etc/wifi/softap/tiwlan_ap.ini' does not exist
remote object '/system/etc/wifi/softap/tiwlan_firmware_ap.bin' does not exist
388 KB/s (34308 bytes in 0.086s)
1183 KB/s (162880 bytes in 0.134s)
1334 KB/s (210640 bytes in 0.154s)
721 KB/s (75656 bytes in 0.102s)
2401 KB/s (1746564 bytes in 0.710s)
393 KB/s (33514 bytes in 0.083s)
6 KB/s (287 bytes in 0.040s)
844 KB/s (95456 bytes in 0.110s)
91 KB/s (3823 bytes in 0.040s)
172 KB/s (13836 bytes in 0.078s)
120 KB/s (9640 bytes in 0.078s)
115 KB/s (9292 bytes in 0.078s)
69 KB/s (5576 bytes in 0.078s)
303 KB/s (26852 bytes in 0.086s)
221 KB/s (17780 bytes in 0.078s)
65 KB/s (5252 bytes in 0.078s)
114 KB/s (9172 bytes in 0.077s)
remote object '/system/app/AntHalService.apk' does not exist
4 KB/s (189 bytes in 0.040s)
19 KB/s (842 bytes in 0.041s)
remote object '/system/lib/libanthal.so' does not exist
brunosa@brunosa ~/android/system/device/semc/shakira $ .build/envsetup.sh && lunch
bash: .build/envsetup.sh: No such file or directory

then it shows this... what to do???
 
B

B.Jay

Guest
brunosa@brunosa ~/android/system/device/semc/shakira $ .build/envsetup.sh && lunch
bash: .build/envsetup.sh: No such file or directory

then it shows this... what to do???

I think you typoed, if that's a direct copy/paste.
There should be a space between the dot and build.

. build/envsetup.sh && lunch
NOT
.build/envsetup.sh && lunch
 

Top Liked Posts

  • There are no posts matching your filters.
  • 189
    Hello everybody. After many attempts to build a ROM I decided to share my knowledge with you :)
    I'm going to show you how to build CM7 for X8 using official CM sources.

    As the result you will have:

    CyanogenMod in version 2.3.7 for X8 aka Shakira. You need to have unlocked bootloader and flash FXP kernel to use this ROM.

    WARNING: This may brick your device. You have been warned!

    What are the requirements?

    0. A smart head, and being willing to learn something new.
    1. A PC featuring a dual-core CPU (the more, the merrier) and at least 1.5GB RAM. Having a CPU that supports 64-Bit Mode (Intel EM64T / AMD64) and Paravirtualization (Intel VT-x / AMD-V) is required if you are planning to run a 64-Bit distribution.
    2. A Linux based system such as Ubuntu or Linux Mint. My guide should work on any other Ubuntu based distribution as well, though you need to adapt commands in case you're running a RPM based Red Hat/Fedora/openSUSE distribution. To make things easier if your main OS is Windows you better consider using Linux in a Virtual Machine (VirtualBox recommended).
    3. Speedy internet connection so the download of the CyangogenMod sources don't take forever.
    4. About 50GB of FREE disk space.
    5. Ability to access to Internet in Linux / your Virtual Machine so you can access Google and XDA to search for help, because everything that can go wrong will go wrong ;P
    Shall we dance? :)

    1. Download and install Linux. Linux is perfectly legal free opensource software; you won't go to jail for downloading it. I prefer Ubuntu 10.10 or Linux Mint 10 (which I'm using). The best choice is to use the respective 64-Bit edition. You may find links in next post.
    2. There is a tool called "Terminal" - it's your new best friend. Create a shortcut in desktop.

    How Linux look like
    attachment.php


    Just like Windows, but better ;)

    Paste this into terminal:

    For Ubuntu below 11.04 use this:

    Code:
    sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jdk pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib

    NOTE: As for Ubuntu 11.04+ (also applies to Linux Mint 11+) see what Novek posted in the CMCompiler thread.

    lib32readline5-dev has been replaced by lib32readline-gplv2-dev on 11.10
    And "gcc-4.3-multilib g++-4.3-multilib" aren't used from 11.04 and up - not needed, so use this code:
    Code:
    sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jdk pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev

    You may want to add that piece of intel.

    This will install required packages. If you'll receive errors try to delete packages from above code.

    After this you'll need to create folders for CM repo.
    Type:
    Code:
    mkdir -p ~/bin 
    mkdir -p ~/android/system
    PATH=~/bin:$PATH
    You could name second folder as you want.

    Next step: Repo installation

    Code:
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo 
    chmod a+x ~/bin/repo

    chmod is a very important command. It's allows you to give permissions for specific files/folders.

    Next step: Downloading the beast ;)

    Remember to type correct folder name!

    Code:
    cd ~/android/system/ 
    repo init -u git://github.com/CyanogenMod/android.git -b gingerbread 
    repo sync -j10

    -j attribute is responsible for number of processes taken in single action. If you have powerful PC you could use -j16 or even -j32. Bigger number - quicker extraction of files.

    Get the ROM Manager just in case;)

    Code:
    ~/android/system/vendor/cyanogen/get-rommanager

    Next step: Download Android-SDK to make ADB work

    Extract this to home directory, then
    Code:
    cd ~/android-sdk-linux/tools
     ./android

    Just do what is shown in this movies:


    Download all files and get ready.

    Next step: Copy proprietary files (you need to have phone connected in debugging mode) - For proprietary files use stock ROM or official CM 7.1.

    Type in terminal:
    Code:
    cd ~/android/system/device/semc/shakira/ 
    ./extract-files.sh
    If you have problems copy adb file to this directory and edit extract-files.sh to have something like this:

    ./adb pull instead of adb pull

    If you have troubles do this:

    After installation open terminal and type:

    Code:
    export PATH=${PATH}:~/android-sdk-linux/tools
    export PATH=${PATH}:~/android-sdk-linux/platform-tools

    Put correct path to your adb.

    Type
    Code:
    ./adb devices
    if you'll receive such line
    Code:
    "List of devices attached
     ???????????? no permissions"
    do specific thing.

    Code:
    sudo touch /etc/udev/rules.d/51-android.rules && sudo sh -c "echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", SYSFS{idProduct}=="612e", MODE="0666"' >> /etc/udev/rules.d/51-android.rules" && sudo chmod 644 /etc/udev/rules.d/51-android.rules

    If something goes wrong type
    Code:
    lsusb
    to see which devices are connected and change code.

    Then

    Code:
    sudo restart udev
    sudo ./adb kill-server
    sudo ./adb start-server

    And it's ready to action.

    Next step: Setting build environment

    Type in terminal:
    Code:
    cd ~/android/system/
    . build/envsetup.sh && breakfast shakira

    You'll see the list of CM devices
    Shakira is number 136 (right now is #144)
    - It won't work due to changes in CM device tree.

    attachment.php


    So use:

    Code:
    lunch cyanogen_shakira-eng
    or
    breakfast shakira

    Next: Step - build!

    All you need to do right now is type magic command "make"
    Add -j4 to make it much quicker

    To obtain update.zip file type
    Code:
    make -j4 bacon

    attachment.php


    Now wait patiently and fight errors :)

    I'm glad if I helped somebody to build his/her first ROM.
    If I made any mistakes feel free to correct me.

    Thanks to B.Jay for help.

    I spent some time to write this, so hit thanks button ;)
    You can also donate me. All donations are highly appreciated :beer: ;)
    5
    This ROM will be for FXP kernel.

    Sent from my X8 using xda premium
    4
    It's 2.3.7. The same as the latest nightly for Shakira. Good luck:)

    Sent from my X8 using xda premium
    3
    tips & trick

    Tips & trick :
    1.reduce download size -3G :D
    - after you write "repo init -u git://github.com/CyanogenMod/android.git -b gingerbread " go to your working folder and press ctrl+h ( it will show hidden file)
    - go to folder .repo/manifests
    - open default.xml with text editor
    - delete other device what you not need (if you want build shakira then you just need shakira and msm7x27-common)You also can delete some app what you not need
    - save and exit
    2. proprietary file (why you need extract-files.sh if you can just download and update auto?) :confused:
    - open default.xml with text editor (see point 1)
    - add this line
    Code:
    <project path="vendor/semc" name="koush/proprietary_vendor_semc" />
    - save and exit (with this you not need doing extract-files.sh anymore )
    (if you was doing extract-files.sh ,delete vendor/semc folder before you sync)
    Now time to repo sync

    CMIAW
    3
    Let us know of results of building your ROMs. If you have any questions or can't solve errors, post it here - maybe we will be able to handle them ;)