5,598,980 Members 31,446 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
Perka
Old
(Last edited by Perka; 17th July 2012 at 10:04 PM.) Reason: changed to : . build/envsetup.sh && brunch galaxysmtd
#1  
Perka's Avatar
Senior Member - OP
Thanks Meter 3122
Posts: 3,585
Join Date: Sep 2010
Angry [Guide][Advanced][Linux] Compile Cm9 for Samsung Galaxy S

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
The Following 44 Users Say Thank You to Perka For This Useful Post: [ Click to Expand ]
 
mkalter
Old
#2  
mkalter's Avatar
Senior Member
Thanks Meter 2837
Posts: 1,439
Join Date: Mar 2011
Location: Winterswijk

 
DONATE TO ME
Nice, thanks!
Quote:
Phone: 2x iPhone 5s 16GB Black SPRINT
ROM: 7.1
Quote:
iPhone 5 16GB SPRINT Black (Unlocked)
Phone: HTC One 32GB (Unlocked)(S-OFF)
Galaxy Note (N7000) Black 16GB
Galaxy Nexus 32GB 4G LTE [SPRINT]
2x Galaxy S GT-I9000 16GB/8GB
2x HTC One X Grey 32GB
Galaxy S3 i9300 BLUE

Acer A200 16GB
Nexus 7 16GB
Please consider a donation, to support my work I really appreciate it

The Following User Says Thank You to mkalter For This Useful Post: [ Click to Expand ]
 
krarvind
Old
#3  
krarvind's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 12721
Posts: 5,883
Join Date: Jun 2011
Location: Saint John, NB

 
DONATE TO ME
@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.

Twitter
Google+
Facebook
USB Debugging:Here

NOTE: Search, Read, Produce a Logcat then report any Stock Slim Issues
The Following 3 Users Say Thank You to krarvind For This Useful Post: [ Click to Expand ]
 
Perka
Old
#4  
Perka's Avatar
Senior Member - OP
Thanks Meter 3122
Posts: 3,585
Join Date: Sep 2010
Quote:
Originally Posted by krarvind View Post
@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
 
rtfpessoa
Old
#5  
rtfpessoa's Avatar
Senior Member
Thanks Meter 652
Posts: 562
Join Date: Dec 2010
Location: Lisbon

 
DONATE TO ME
Perka check teamhcksung buildscripts and see how they do to build kernel and rom one after other, is very easy.
Phones:
  • Google Nexus 5
  • Xiaomi Mione Plus
Tablet:
  • Google Nexus 7 (2013)
The Following 2 Users Say Thank You to rtfpessoa For This Useful Post: [ Click to Expand ]
 
scheichuwe
Old
#6  
Senior Member
Thanks Meter 251
Posts: 445
Join Date: Sep 2009
Location: happy place
Quote:
Originally Posted by Perka View Post
...
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: [ Click to Expand ]
 
Perka
Old
#7  
Perka's Avatar
Senior Member - OP
Thanks Meter 3122
Posts: 3,585
Join Date: Sep 2010
Quote:
Originally Posted by rtfpessoa View Post
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!
 
Perka
Old
#8  
Perka's Avatar
Senior Member - OP
Thanks Meter 3122
Posts: 3,585
Join Date: Sep 2010
Quote:
Originally Posted by scheichuwe View Post
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
 
DaXmax
Old
#9  
DaXmax's Avatar
Recognized Themer
Thanks Meter 10020
Posts: 10,692
Join Date: Sep 2008
Location: Singapore
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: [ Click to Expand ]
 
Perka
Old
#10  
Perka's Avatar
Senior Member - OP
Thanks Meter 3122
Posts: 3,585
Join Date: Sep 2010
Quote:
Originally Posted by DaxIΠFIΠITY View Post
Great job, u ketching up me lol.

Sent from my Nexus S using Tapatalk
ohhhh Nexus S, freedom to aosp!!!

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

Advanced Search
Display Modes