Post Reply

[Guide][Advanced][Linux] Compile Cm9 for Samsung Galaxy S

OP Perka

6th March 2012, 06:19 PM   |  #1  
Perka's Avatar
OP Senior Member
Thanks Meter: 3,136
 
3,596 posts
Join Date:Joined: Sep 2010
This is how I compiled cm9 for galaxysmtd.
For sure there are other ways but this is the only way I know, and it works for me.
I use Linux Mint 12.
Reading helps. http://git-scm.com/documentation
Follow this guide until you have synced source. (Step 4D)

Also check 4h. Your Final .bashrc
http://forum.xda-developers.com/show....php?t=1505006
2d. Add Extra Path For Device:

Code:
sudo gedit /etc/udev/rules.d/51-android.rules
Enter this in it:
Code:
#Samsung
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
4c should be this
Code:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b ics
setup ccache
http://source.android.com/source/initializing.html
Manifest
New terminal
Code:
cd ~/android/system
gedit .repo/local_manifest.xml
And add this to the file
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="CyanogenMod/android_device_samsung_galaxysmtd" path="device/samsung/galaxysmtd" />
  <project name="CyanogenMod/android_device_samsung_aries-common" path="device/samsung/aries-common" />
  <project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" />
  <project name="CyanogenMod/android_kernel_samsung_aries" path="kernel/samsung/aries" remote="github" revision="android-samsung-3.0-ics" />
</manifest>
Option 2: if you dont have cm9 installed look here <----Link

For the next step you need to have cm9 installed.
Connect you phone to pc and in terminal type
Code:
adb root
New terminal
Code:
cd ~/android/system/device/samsung/galaxysmtd/
./extract-files.sh
New terminal
Code:
cd ~/android/system/vendor/cm/
./get-prebuilts
New terminal
Code:
cd ~/android/system 
repo sync
New terminal
Code:
. build/envsetup.sh && brunch galaxysmtd
Should be it. Enjoy!

I can not give support on this. Sorry.

Code:
(Package complete: /home/perka/android/system/out/target/product/galaxysmtd/update-cm-9.0.0-RC0-galaxysmtd-KANG-signed.zip
31c9c1175132d005cc093679fc023067  update-cm-9.0.0-RC0-galaxysmtd-KANG-signed.zip)
Cherry picking here <---------Link
Here you can see how kasper_h pick his cherries thx for posting

Credit:
Cyanogen
TKGlitch
Smasher816
TeamHacksung
krarvind
blahbl4hblah
Faryaab
rtfpessoa
PaulForde
scheichuwe
kasper_h
lippol94
malcho
Google
Samsung?
Xda
did I forget you? tell me pls!
and all involved in Linux and Android
Last edited by Perka; 17th July 2012 at 10:04 PM. Reason: changed to : . build/envsetup.sh && brunch galaxysmtd
The Following 46 Users Say Thank You to Perka For This Useful Post: [ View ]
6th March 2012, 06:23 PM   |  #2  
mkalter's Avatar
Senior Member
Flag Winterswijk
Thanks Meter: 2,839
 
1,452 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Nice, thanks!
The Following User Says Thank You to mkalter For This Useful Post: [ View ]
6th March 2012, 06:33 PM   |  #3  
krarvind's Avatar
Recognized Contributor / Recognized Developer
Flag Saint John, NB
Thanks Meter: 12,726
 
5,883 posts
Join Date:Joined: Jun 2011
Donate to Me
More
@perka, forgot somebody in credits mate?

reason your boot.img didn't wokr is because of the ramdisks. you need special ones for SGS which has CWM recovery in it. Use the one from OneCosmic/Stratoksk/Zach/Tk-Glitch and compile boot.img from zImage/kernel.
The Following 3 Users Say Thank You to krarvind For This Useful Post: [ View ]
6th March 2012, 06:36 PM   |  #4  
Perka's Avatar
OP Senior Member
Thanks Meter: 3,136
 
3,596 posts
Join Date:Joined: Sep 2010
Quote:
Originally Posted by krarvind

@perka, forgot somebody in credits mate?

reason your boot.img didn't wokr is because of the ramdisks. you need special ones for SGS which has CWM recovery in it. Use the one from OneCosmic/Stratoksk/Zach/Tk-Glitch and compile boot.img from zImage/kernel.


Sorry now you are there
6th March 2012, 06:38 PM   |  #5  
rtfpessoa's Avatar
Senior Member
Flag Lisbon
Thanks Meter: 662
 
565 posts
Join Date:Joined: Dec 2010
Donate to Me
More
Perka check teamhcksung buildscripts and see how they do to build kernel and rom one after other, is very easy.
The Following 2 Users Say Thank You to rtfpessoa For This Useful Post: [ View ]
6th March 2012, 06:40 PM   |  #6  
Senior Member
happy place
Thanks Meter: 254
 
448 posts
Join Date:Joined: Sep 2009
Quote:
Originally Posted by Perka

...

New terminal
cd ~/android/system/device/samsung
git clone git://github.com/teamhacksung/android_device_samsung_galaxysmtd.git -b ics galaxysmtd

then
git clone git://github.com/teamhacksung/android_device_samsung_aries-common.git -b ics aries-common
go to android/system/vendor/cm
edit file vendorsetup.sh
add this in between any of the lines

add_lunch_combo cm_galaxysmtd-userdebug
...

You can use a local_maifest.xml instead of that, so these repos get synced, too.

Code:
<?xml version="1.0" encoding="UTF-8"?>
  <manifest>

    <project path="device/samsung/galaxysmtd" name="teamhacksung/android_device_samsung_galaxysmtd" />
    <project path="device/samsung/aries-common" name="teamhacksung/android_device_samsung_aries-common" />
    <project path="vendor/cm" name="teamhacksung/android_vendor_cm" />
    <project path="kernel/samsung-kernel-aries" name="teamhacksung/samsung-kernel-aries" remote="github" revision="android-samsung-3.0-ics" />

  </manifest>
I also made a very simple build script as I didn't know how to use teamhacksung's
It builds kernel and cm9-KANG

Code:
#!/bin/bash

repo sync -j`grep 'processor' /proc/cpuinfo | wc -l`
. build/envsetup.sh
cd kernel/samsung-kernel-aries
#make clean
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
make aries_galaxysmtd_defconfig
time make -j`grep 'processor' /proc/cpuinfo | wc -l`
cp -f ~/android/system/kernel/samsung-kernel-aries/arch/arm/boot/zImage ~/android/system/device/samsung/galaxysmtd/kernel
find . -name "*.ko" -exec cp -f {} ~/android/system/device/samsung/galaxysmtd/ \;
cd ../..
lunch cm_galaxysmtd-userdebug
#make clobber
time make -j`grep 'processor' /proc/cpuinfo | wc -l` otapackage
With the new builds /system only has limited space left, so you have to delete some files before flashing gapps. Otherwise you'll end up in android.process.acore fc's (that's what happened to me...).
The Following User Says Thank You to scheichuwe For This Useful Post: [ View ]
6th March 2012, 06:40 PM   |  #7  
Perka's Avatar
OP Senior Member
Thanks Meter: 3,136
 
3,596 posts
Join Date:Joined: Sep 2010
Quote:
Originally Posted by rtfpessoa

Perka check teamhcksung buildscripts and see how they do to build kernel and rom one after other, is very easy.

Forgot to put you also in credit.

Who else? Sorry!
6th March 2012, 06:44 PM   |  #8  
Perka's Avatar
OP Senior Member
Thanks Meter: 3,136
 
3,596 posts
Join Date:Joined: Sep 2010
Quote:
Originally Posted by scheichuwe

You can use a local_maifest.xml instead of that, so these repos get synced, too.

Code:
<?xml version="1.0" encoding="UTF-8"?>
  <manifest>

    <project path="device/samsung/galaxysmtd" name="teamhacksung/android_device_samsung_galaxysmtd" />
    <project path="device/samsung/aries-common" name="teamhacksung/android_device_samsung_aries-common" />
    <project path="vendor/cm" name="teamhacksung/android_vendor_cm" />
    <project path="kernel/samsung-kernel-aries" name="teamhacksung/samsung-kernel-aries" remote="github" revision="android-samsung-3.0-ics" />

  </manifest>
I also made a very simple build script as I didn't know how to use teamhacksung's
It builds kernel and cm9-KANG

Code:
#!/bin/bash

repo sync -j`grep 'processor' /proc/cpuinfo | wc -l`
. build/envsetup.sh
cd kernel/samsung-kernel-aries
#make clean
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
make aries_galaxysmtd_defconfig
time make -j`grep 'processor' /proc/cpuinfo | wc -l`
cp -f ~/android/system/kernel/samsung-kernel-aries/arch/arm/boot/zImage ~/android/system/device/samsung/galaxysmtd/kernel
find . -name "*.ko" -exec cp -f {} ~/android/system/device/samsung/galaxysmtd/ \;
cd ../..
lunch cm_galaxysmtd-userdebug
#make clobber
time make -j`grep 'processor' /proc/cpuinfo | wc -l` otapackage
With the new builds /system only has limited space left, so you have to delete some files before flashing gapps. Otherwise you'll end up in android.process.acore fc's (that's what happened to me...).

Great will give it a go and after update the OP.

Thanks for helping
6th March 2012, 06:49 PM   |  #9  
DaXmax's Avatar
Recognized Themer
Flag Singapore
Thanks Meter: 10,032
 
10,693 posts
Join Date:Joined: Sep 2008
More
Great job, u ketching up me lol.

Sent from my Nexus S using Tapatalk
The Following User Says Thank You to DaXmax For This Useful Post: [ View ]
6th March 2012, 06:50 PM   |  #10  
Perka's Avatar
OP Senior Member
Thanks Meter: 3,136
 
3,596 posts
Join Date:Joined: Sep 2010
Quote:
Originally Posted by DaxIΠFIΠITY

Great job, u ketching up me lol.

Sent from my Nexus S using Tapatalk

ohhhh Nexus S, freedom to aosp!!!

Post Reply Subscribe to Thread

Tags
compile cm9, galaxysmtd, perka
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Galaxy S I9000 Android Development by ThreadRank