This page documents the steps and current status of the porting effort of Ubuntu to the Samsung Galaxy SL (i9003) device.

Ubuntu This work wouldn't have been possible without the invaluable help and guidance of Dheeraj CVR (dhiru1602), a Recognized XDA Developer who created and maintains the CyanogenMod i9003 port. Thanks!

Environment setup

  1. Install the build tools:

    sudo apt-get install git gnupg flex bison gperf build-essential \
      zip bzr curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
      libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
      libgl1-mesa-dev g++-multilib mingw32 ubuntu-dev-tools tofrodos \
      python-markdown libxml2-utils xsltproc zlib1g-dev:i386 schedtool bsdiff
  2. Install the Java 6 JDK to build Android itself (the Java 7 SDK will not work)

    sudo apt-get install openjdk-6-jdk
  3. Install the phablet tools, which include repo to sync Android git repositories

    sudo add-apt-repository ppa:phablet-team/tools
    sudo apt-get update
    sudo apt-get install phablet-tools android-tools-adb android-tools-fastboot
  4. Install heimdall, a tool to flash Samsung phones. Not strictly necessary, but if something goes wrong or you need to flash images directly, it comes handy, as the i9003 does not seem to support ADB's fastboot mode

    sudo apt-get install heimdall-flash

Building Android for Ubuntu

Ubuntu on phones boots from an Ubuntu image, but we still require some bits of Android to be present to talk to some proprietary drivers. Android (without the UI) then runs in an LXC container that is set up during the Ubuntu boot.

These steps describe how to build this Android compatibility layer, and how to flash it on an i9003 along with the Ubuntu image.

  1. Initialise the Ubuntu CyanogenMod 10.1 Android repository

    repo init -u git://phablet.ubuntu.com/CyanogenMod/android.git -b phablet-saucy
  2. Sync the repository. Note: this step will download several GBs worth of code and can take quite long

    repo sync -j 8
  3. Create a local manifest folder

    mkdir .repo/local_manifests
  4. Create the local manifest for the galaxysl device (FIXME: investigate if the bluetooth bluedroid dependency can be dropped, as we're using bluez)

    echo '<?xml version="1.0" encoding="UTF-8"?>
    <manifest>
      <project name="dplanella/android_device_samsung_galaxysl" path="device/samsung/galaxysl" remote="github" revision="cm-10.1-ubuntu" />
      <project name="dhiru1602/android_vendor_samsung_galaxysl" path="vendor/samsung/galaxysl" remote="github" revision="cm-10.1" />
      <project name="dplanella/android_kernel_samsung_latona" path="kernel/samsung/latona" remote="github" revision="cm-10.1-ubuntu" />
    </manifest>' > .repo/local_manifests/roomservice.xml 
  5. Sync the new repositories added to the local manifest

    repo sync -j 8
  6. Add additional directories to build by including this snippet in build/core/main.mk, after the subdirs := lines

    ifeq ($(TARGET_PRODUCT), cm_galaxysl)
    subdirs += \
            external/wpa_supplicant_8_ti \
            external/bluetooth \
            libnativehelper
    endif
  7. Generate a version.h file manually for the kernel build to work (FIXME: find out why the version.h file is not generated during build as specified in the Makefile)

    cd hardware/ti/wlan/mac80211/compat_wl12xx/drivers/net/wireless/wl12xx
    echo 'static const char *wl12xx_timestamp = __TIMESTAMP__;
    static const char *wl12xx_git_head = "'$(git describe --dirty)'";' > version.h
    cd -
  8. Set up the build environment

    . build/envsetup.sh
  9. Build the image

    brunch galaxysl

Output

Where 20131113 is the date of the build

Flashing

  1. Have the device-specific image you created in the previous step ready, or alternatively download a pre-compiled image from here

  2. Download the Ubuntu image

  3. Connect your device to the computer via USB and reboot the device into recovery:

    adb reboot recovery
  4. From the recovery menu, wipe the device's data
  5. Copy the device-specific image to the device:

    adb push saucy-preinstalled-touch-armel+latona.zip /sdcard
  6. Once the copy is complete, select the .zip file from the recovery menu and install it
  7. Reboot into recovery again
  8. FIXME after flashing recovery does no longer work: the phone won't boot. Looking at the kernel log, it seems it cannot find the system partition for some reason. Specifying systempart in the kernel config does not seem to make a difference, either.

  9. Copy the Ubuntu image to the device:

    adb push saucy-preinstalled-touch-armhf.zip /sdcard
  10. Reboot
  11. FIXME the boot is stuck at the Samsung logo

    • I can use adb commands, but not adb shell

Building Android for CyanogenMod 10.1

This step is optional and only included here for reference purposes and to test that the upstream build works. At the end of these steps, you'll end up with a CyanogenMod 10.1 image for the Samsung Galaxy SL (i9003).

  1. Initialise the CyanogenMod 10.1 Android repository

    repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
  2. Sync the repository. Note: this step will download several GBs worth of code and can take quite long

    repo sync -j 8
  3. Create a local manifest folder

    mkdir .repo/local_manifests
  4. Create the local manifest for the galaxysl device

    echo '<?xml version="1.0" encoding="UTF-8"?>
        <manifest>
          <project name="dhiru1602/android_device_samsung_galaxysl" path="device/samsung/galaxysl" remote="github" revision="cm-10.1" />
          <project name="dhiru1602/android_vendor_samsung_galaxysl" path="vendor/samsung/galaxysl" remote="github" revision="cm-10.1" />
          <project name="dhiru1602/android_kernel_samsung_latona" path="kernel/samsung/latona" remote="github" revision="cm-10.1" />
          <project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="cm-10.1" />
        </manifest>' > .repo/local_manifests/roomservice.xml
  5. Sync the new repositories added to the local manifest

    repo sync -j 8
  6. Manually download some required pre-built packages

    sh vendor/cm/get-prebuilts
  7. Set up the build environment

    . build/envsetup.sh
  8. Build the image

    brunch galaxysl

Output

Touch/Devices/galaxysl (last edited 2013-11-22 23:33:07 by dpm)