SlideShare a Scribd company logo
The Path to SURFDROID

 An Android Rom Building Journey

               By

           Paul Dutot
The Path to SURFDROID
    Where did I get the idea to built a rom ?

    Android Internals by Marko Gargenta at
●   http://www.youtube.com/watch?v=1_H4AlQaNa0


    Google Android Source Page
●
    http://source.android.com/source/index.html
The Path to SURFDROID
               What do you need ?
●   Python 2.4 – 2.7
●   Java Development Kit (JDK) 6 for
    Gingerbread or JDK 5 for Froyo
●   Git 1.5.4 or newer
●   Dependencies listed on source.android.com
●   Correct usb access for adb
The Path to SURFDROID
           Update.zip Contents
Bootloader.bin – initial bootloader code
Boot.img – contains kernel and ramdisk
System.img – android system image
Recovery.img – system recovery image
Google directory containing update script &
binary
The Path to SURFDROID
  Update.zip Structure ( Type 1)
The Path to SURFDROID
  Update.zip Structure ( Type 2)
The Path to SURFDROID
       The Type 1 Updater Script Function
●   Mount the system Partition
●   Copy the files into system
●   Make symbolic links to xbin
●   Set correct permissions on files and
    directories
●   Flash the boot.img file
The Path to SURFDROID
       The Type 2 Updater Script Function
●   Flashes the bootloader.bin
●   Flashes the boot.img file
●   Flashes the system.img file
●   Flashes the recovery.img file
The Path to SURFDROID
   Development Environment
The Path to SURFDROID
  Notion Ink Partition Information
                2               7
              BCT              MSC
           Boot Config         data

                  3               8
                 PT             SOS
          Partition Table       data
                            recovery.img
                 4                9
               EBT              LNK
            bootloader          data
          bootloader.bin      boot.img
                 5               10
               NVC              APP
            bootloader          data
          microboot.bin      system.img
                 6               11
               MBT              CAC
               data             data
           mbtdata.img
The Path to SURFDROID
     The NVFlash Utility & Recovery Modes
●   Utility for directly flashing all partitions used
              with forced recovery mode
●   Use with care – only for advanced users
●   Vol and + - normal recovery
●   Vol and - - forced recovery mode
The Path to SURFDROID
             Building Android Source
●   Setup PATH variable
●   Pull Down repo command and make
    excutable
●   Sync repo ….wait...wait
●   Source build/envsetup.sh
●   lunch full-eng
●   make
The Path to SURFDROID
             Android Source Directories
●   Build – build system
●   Device – device specific files
●   Prebuilt – Prebuilt stuff including toolchains
    and kernel
●   Out – compilation output directory
●   Vendor – vendor specific information
The Path to SURFDROID
The Path to SURFDROID
    The Next Stage... So What Do We Need ?
●   Kernel – Prebuilt or Compiled
●   A supported CM7 device
●   Device dependant proprietary binary files
●   Working boot.img and system.img
●   Packaged Update.zip file
The Path to SURFDROID
                   Building the kernel
●   Download the NI sources from
    https://github.com/notionink/adam-kernel.git
●   Get running config from tablet
    sudo ./adb shell then cat /proc/config > config.gz
    .sudo /adb pull <path to config file>/config.gz
    unzip config.gz then rename .config in kernel directory
●   Setup path variable then make ARCH= arm
    CROSS_COMPILE=<path to cross compiler
    toolchain>
The Path to SURFDROID
    The Next Stage... So What Do We Need ?
●   Kernel – Prebuilt or Compiled
●   A supported CM7 device
●   Device dependant proprietary binary files
●   Working boot.img and system.img
●   Packaged update.zip file
The Path to SURFDROID
                                  Compile CM7
    Main guide is here
●   CyanogenMod Wiki
    http://wiki.cyanogenmod.com/wiki/Viewsonic_G_Tablet:_Compile_CyanogenMod_%28Linux%29
The Path to SURFDROID
    The Next Stage... So What Do We Need ?
●   Kernel – Prebuilt or Compiled
●   A supported CM7 device
●   Device dependant proprietary binary files
●   Working boot.img and system.img
●   Packaged Update.zip file
The Path to SURFDROID
          Copy Proprietary Binary Blobs
●   Download CM7 source
●   Start ADB server as root
●   Connect tablet via USB
●   Navigate to smb_a1002 directory
●   Run ./extract-files.sh
●   Files are copied into the vendor directory
    and makefiles built
The Path to SURFDROID
    The Next Stage... So What Do We Need ?
●   Kernel – Prebuilt or Compiled
●   A supported CM7 device
●   Device dependant proprietary binary files
●   Working boot.img and system.img
●   Packaged update.zip file
The Path to SURFDROID
                Compile CM7 stages
●   install ADB via Android SDK
●   Create directory and pull down CM7 repo
●   Get proprietary blobs
●   Download rom manager
●   Install kernel in source tree
●   Source build/envsetup.sh
●   Brunch – choose option 36
The Path to SURFDROID
The Path to SURFDROID
     Building & Installing the update.zip file
●   Copy the boot.img and system.img to
    nvflash directory.
●   Use the mkupdatezip.sh script to create
    update.zip
●   Copy update.zip to device internal or
    external sd card. Flash via recovery mode
The Path to SURFDROID
         Flashing the rom with NVflash
●   Copy the boot.img and system.img to
    nvflash directory.
●   Use NVFLASH utility in forced recovery
    mode to reflash entire device.
The Path to SURFDROID
                   Android Build Versions
●   Build 1 – CM7 V.2.3.4 -broken wifi & rotation
●   Build 2 – CM7 V.2.3.4 - wifi ok , rotation still broken
●   Build 3-9 – CM7 V2.3.5 - libstagefrighthw.so included – all
    build ok but boot loop on tablet at netrunner or
    mediaservice start
●   Build 10 - CM7 V.2.3.5 – libstagefrighthw.so working –
    wifi,video,hdmi playback, rotation and working flash
●   Build 11 – Build 10 plus custom splash screen
●   Build 12 (in progress) – Build 11 plus titanium backup
    preinstalled
The Path to SURFDROID
          Common Rom Builders Tasks
●   Fixing the 'broken' WIFI / Bluetooth
●   Add Additional Apps
●   Custom Splash Screen
●   Custom Boot Animation
●   Android Market
The Path to SURFDROID
            Fixing the 'broken' WIFI
●   Recompile Kernel module bcm4329.ko
    against kernel in source tree
●   Use compatible bcm4329.ko with associated
    files
The Path to SURFDROID
           Add Additional Applications
●   Put Additional apk's in out directory
●   Start brunch then crtl 'c'
●   Make snod
●   Copy system.img
The Path to SURFDROID
              Custom Splash Screen
●   Create your image at correct resolution-
    1024 x600 in raw format
●   Unpack Boot.img
●   Convert image to rgb255 using to565
●   ./to565 -rle < splash.raw > initlogo.rle
●   Put initlogon.rle in ramdisk root directory
●   Repack boot.img
The Path to SURFDROID
             Custom Boot Animation
●   Create your images at correct resolution-
    1024 x600 in raw format
●   Replace bootanimation.zip in source
The Path to SURFDROID
                 Android Market
●   Modified Notion Hacks – Root and Market
    Access script
●   Apply as update.zip in recovery mode
The Path to SURFDROID
                    Last Things to Do
●   Test it with some apps notably flash
●   Release it !!!!!!!!!!!!



    Thanx to all at tabletroms.com including
    Blazingwolf, RaYmAn,Thinkdevoid in the irc
    for their help

More Related Content

PDF
Getting started with LinuxBoot Firmware on AArch64 Server
PDF
Creating new Tizen profiles using the Yocto Project
PDF
Android On Development Boards at AnDevCon3
PDF
Scheduling in Android
PPTX
Android build on windows
PDF
Working with the AOSP - Linaro Connect Asia 2013
PDF
Scheduling in Android
PDF
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Getting started with LinuxBoot Firmware on AArch64 Server
Creating new Tizen profiles using the Yocto Project
Android On Development Boards at AnDevCon3
Scheduling in Android
Android build on windows
Working with the AOSP - Linaro Connect Asia 2013
Scheduling in Android
Android Hacks, Variants, Tricks and Resources ESC SV 2012

What's hot (20)

PDF
Android Things Internals
PDF
Building Emmbedded Linux with Yocto project
PDF
Android Security, From the Ground Up
PDF
Embedded Android Workshop part I ESC SV 2012
PDF
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
PDF
Android Variants, Hacks, Tricks and Resources
PDF
Angelo Compagnucci - Upgrading buildroot based devices with swupdate
PDF
Android Jumpstart ESC SV 2012 Part I
PPT
Learning AOSP - Android Booting Process
PDF
Leveraging Android's Linux Heritage at AnDevCon3
PDF
Android Custom Kernel/ROM design
PDF
Inside Android's UI at AnDevCon VI
PDF
Memory Management in Android
PDF
Android Internals at Linaro Connect Asia 2013
ODP
The ABC of Linux (Linux for Beginners)
PDF
BeagleBoard Workshop ESC Boston 2011
PDF
Headless Android at AnDevCon3
PDF
Linux fundamental - Chap 16 System Rescue
PDF
Headless Android
PPTX
MVUG Webcast Slide:- From Zero to Hero on Hyper V R2- Part 2
Android Things Internals
Building Emmbedded Linux with Yocto project
Android Security, From the Ground Up
Embedded Android Workshop part I ESC SV 2012
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources
Angelo Compagnucci - Upgrading buildroot based devices with swupdate
Android Jumpstart ESC SV 2012 Part I
Learning AOSP - Android Booting Process
Leveraging Android's Linux Heritage at AnDevCon3
Android Custom Kernel/ROM design
Inside Android's UI at AnDevCon VI
Memory Management in Android
Android Internals at Linaro Connect Asia 2013
The ABC of Linux (Linux for Beginners)
BeagleBoard Workshop ESC Boston 2011
Headless Android at AnDevCon3
Linux fundamental - Chap 16 System Rescue
Headless Android
MVUG Webcast Slide:- From Zero to Hero on Hyper V R2- Part 2
Ad

Similar to Path to Surfdroid (20)

PDF
Android for Embedded Linux Developers
PDF
Build and Run Android N Source Ccode on NXP SABRESD platform
PDF
Security Issues in Android Custom Rom
PDF
Security Issues in Android Custom ROM
PDF
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
PDF
Introduction to Modern U-Boot
PDF
Booting Android: bootloaders, fastboot and boot images
PDF
Embedded linux build systems
PDF
Introduction and course Details of Embedded Linux Platform Developer Training
ODP
5. boot process
PPTX
Hypervisor and VDI security
ODP
The Deck by Phil Polstra GrrCON2012
PDF
NetBSD on Google Compute Engine (en)
PDF
Understanding The Boot Process
PDF
Beagleboard xm-setup
PDF
Drbl tutorial
PDF
Linux Kernel Platform Development: Challenges and Insights
PDF
NetBSD workshop
ODP
Q4.11: Porting Android to new Platforms
Android for Embedded Linux Developers
Build and Run Android N Source Ccode on NXP SABRESD platform
Security Issues in Android Custom Rom
Security Issues in Android Custom ROM
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Introduction to Modern U-Boot
Booting Android: bootloaders, fastboot and boot images
Embedded linux build systems
Introduction and course Details of Embedded Linux Platform Developer Training
5. boot process
Hypervisor and VDI security
The Deck by Phil Polstra GrrCON2012
NetBSD on Google Compute Engine (en)
Understanding The Boot Process
Beagleboard xm-setup
Drbl tutorial
Linux Kernel Platform Development: Challenges and Insights
NetBSD workshop
Q4.11: Porting Android to new Platforms
Ad

More from Paul Dutot IEng MIET MBCS CITP OSCP CSTM (10)

PPTX
Welcome to the #WannaCry Wine Club
PPTX
Scanning Channel Islands Cyberspace
PPTX
Incident Response in the wake of Dear CEO
PDF
Logicalis Security Conference
ODP
Exploiting buffer overflows
PDF
ODP
A Letter from Anonymous to the Jersey Finance Industry
PDF
WI-FI Security in Jersey 2011
Welcome to the #WannaCry Wine Club
Scanning Channel Islands Cyberspace
Incident Response in the wake of Dear CEO
Logicalis Security Conference
Exploiting buffer overflows
A Letter from Anonymous to the Jersey Finance Industry
WI-FI Security in Jersey 2011

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
cuic standard and advanced reporting.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation theory and applications.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
KodekX | Application Modernization Development
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPT
Teaching material agriculture food technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation_ Review paper, used for researhc scholars
cuic standard and advanced reporting.pdf
MYSQL Presentation for SQL database connectivity
Unlocking AI with Model Context Protocol (MCP)
Encapsulation theory and applications.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Network Security Unit 5.pdf for BCA BBA.
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
KodekX | Application Modernization Development
Mobile App Security Testing_ A Comprehensive Guide.pdf
Teaching material agriculture food technology
Digital-Transformation-Roadmap-for-Companies.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

Path to Surfdroid

  • 1. The Path to SURFDROID An Android Rom Building Journey By Paul Dutot
  • 2. The Path to SURFDROID Where did I get the idea to built a rom ? Android Internals by Marko Gargenta at ● http://www.youtube.com/watch?v=1_H4AlQaNa0 Google Android Source Page ● http://source.android.com/source/index.html
  • 3. The Path to SURFDROID What do you need ? ● Python 2.4 – 2.7 ● Java Development Kit (JDK) 6 for Gingerbread or JDK 5 for Froyo ● Git 1.5.4 or newer ● Dependencies listed on source.android.com ● Correct usb access for adb
  • 4. The Path to SURFDROID Update.zip Contents Bootloader.bin – initial bootloader code Boot.img – contains kernel and ramdisk System.img – android system image Recovery.img – system recovery image Google directory containing update script & binary
  • 5. The Path to SURFDROID Update.zip Structure ( Type 1)
  • 6. The Path to SURFDROID Update.zip Structure ( Type 2)
  • 7. The Path to SURFDROID The Type 1 Updater Script Function ● Mount the system Partition ● Copy the files into system ● Make symbolic links to xbin ● Set correct permissions on files and directories ● Flash the boot.img file
  • 8. The Path to SURFDROID The Type 2 Updater Script Function ● Flashes the bootloader.bin ● Flashes the boot.img file ● Flashes the system.img file ● Flashes the recovery.img file
  • 9. The Path to SURFDROID Development Environment
  • 10. The Path to SURFDROID Notion Ink Partition Information 2 7 BCT MSC Boot Config data 3 8 PT SOS Partition Table data recovery.img 4 9 EBT LNK bootloader data bootloader.bin boot.img 5 10 NVC APP bootloader data microboot.bin system.img 6 11 MBT CAC data data mbtdata.img
  • 11. The Path to SURFDROID The NVFlash Utility & Recovery Modes ● Utility for directly flashing all partitions used with forced recovery mode ● Use with care – only for advanced users ● Vol and + - normal recovery ● Vol and - - forced recovery mode
  • 12. The Path to SURFDROID Building Android Source ● Setup PATH variable ● Pull Down repo command and make excutable ● Sync repo ….wait...wait ● Source build/envsetup.sh ● lunch full-eng ● make
  • 13. The Path to SURFDROID Android Source Directories ● Build – build system ● Device – device specific files ● Prebuilt – Prebuilt stuff including toolchains and kernel ● Out – compilation output directory ● Vendor – vendor specific information
  • 14. The Path to SURFDROID
  • 15. The Path to SURFDROID The Next Stage... So What Do We Need ? ● Kernel – Prebuilt or Compiled ● A supported CM7 device ● Device dependant proprietary binary files ● Working boot.img and system.img ● Packaged Update.zip file
  • 16. The Path to SURFDROID Building the kernel ● Download the NI sources from https://github.com/notionink/adam-kernel.git ● Get running config from tablet sudo ./adb shell then cat /proc/config > config.gz .sudo /adb pull <path to config file>/config.gz unzip config.gz then rename .config in kernel directory ● Setup path variable then make ARCH= arm CROSS_COMPILE=<path to cross compiler toolchain>
  • 17. The Path to SURFDROID The Next Stage... So What Do We Need ? ● Kernel – Prebuilt or Compiled ● A supported CM7 device ● Device dependant proprietary binary files ● Working boot.img and system.img ● Packaged update.zip file
  • 18. The Path to SURFDROID Compile CM7 Main guide is here ● CyanogenMod Wiki http://wiki.cyanogenmod.com/wiki/Viewsonic_G_Tablet:_Compile_CyanogenMod_%28Linux%29
  • 19. The Path to SURFDROID The Next Stage... So What Do We Need ? ● Kernel – Prebuilt or Compiled ● A supported CM7 device ● Device dependant proprietary binary files ● Working boot.img and system.img ● Packaged Update.zip file
  • 20. The Path to SURFDROID Copy Proprietary Binary Blobs ● Download CM7 source ● Start ADB server as root ● Connect tablet via USB ● Navigate to smb_a1002 directory ● Run ./extract-files.sh ● Files are copied into the vendor directory and makefiles built
  • 21. The Path to SURFDROID The Next Stage... So What Do We Need ? ● Kernel – Prebuilt or Compiled ● A supported CM7 device ● Device dependant proprietary binary files ● Working boot.img and system.img ● Packaged update.zip file
  • 22. The Path to SURFDROID Compile CM7 stages ● install ADB via Android SDK ● Create directory and pull down CM7 repo ● Get proprietary blobs ● Download rom manager ● Install kernel in source tree ● Source build/envsetup.sh ● Brunch – choose option 36
  • 23. The Path to SURFDROID
  • 24. The Path to SURFDROID Building & Installing the update.zip file ● Copy the boot.img and system.img to nvflash directory. ● Use the mkupdatezip.sh script to create update.zip ● Copy update.zip to device internal or external sd card. Flash via recovery mode
  • 25. The Path to SURFDROID Flashing the rom with NVflash ● Copy the boot.img and system.img to nvflash directory. ● Use NVFLASH utility in forced recovery mode to reflash entire device.
  • 26. The Path to SURFDROID Android Build Versions ● Build 1 – CM7 V.2.3.4 -broken wifi & rotation ● Build 2 – CM7 V.2.3.4 - wifi ok , rotation still broken ● Build 3-9 – CM7 V2.3.5 - libstagefrighthw.so included – all build ok but boot loop on tablet at netrunner or mediaservice start ● Build 10 - CM7 V.2.3.5 – libstagefrighthw.so working – wifi,video,hdmi playback, rotation and working flash ● Build 11 – Build 10 plus custom splash screen ● Build 12 (in progress) – Build 11 plus titanium backup preinstalled
  • 27. The Path to SURFDROID Common Rom Builders Tasks ● Fixing the 'broken' WIFI / Bluetooth ● Add Additional Apps ● Custom Splash Screen ● Custom Boot Animation ● Android Market
  • 28. The Path to SURFDROID Fixing the 'broken' WIFI ● Recompile Kernel module bcm4329.ko against kernel in source tree ● Use compatible bcm4329.ko with associated files
  • 29. The Path to SURFDROID Add Additional Applications ● Put Additional apk's in out directory ● Start brunch then crtl 'c' ● Make snod ● Copy system.img
  • 30. The Path to SURFDROID Custom Splash Screen ● Create your image at correct resolution- 1024 x600 in raw format ● Unpack Boot.img ● Convert image to rgb255 using to565 ● ./to565 -rle < splash.raw > initlogo.rle ● Put initlogon.rle in ramdisk root directory ● Repack boot.img
  • 31. The Path to SURFDROID Custom Boot Animation ● Create your images at correct resolution- 1024 x600 in raw format ● Replace bootanimation.zip in source
  • 32. The Path to SURFDROID Android Market ● Modified Notion Hacks – Root and Market Access script ● Apply as update.zip in recovery mode
  • 33. The Path to SURFDROID Last Things to Do ● Test it with some apps notably flash ● Release it !!!!!!!!!!!! Thanx to all at tabletroms.com including Blazingwolf, RaYmAn,Thinkdevoid in the irc for their help