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
ABS 2012 - Android Device Porting Walkthrough
PPT
Rooting android
PPTX
Taking Control of Your Mobile Device - Rooting-n-Roms
PDF
Qi -- Lightweight Boot Loader Applied in Mobile and Embedded Devices
PDF
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
PPTX
Build Your Own Android Tablet
PDF
Hacking Android OS
PDF
Build and Run Android N Source Ccode on NXP SABRESD platform
PPTX
Android unlocking and rooting
PPTX
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014
PDF
Beginner for install Linux and *BSD in the inexpensive ARM and Intel based mo...
PDF
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
PDF
Android Internals
PPT
NthCode - Porting Google Android To A Nokia N810
PDF
From stock to Cyanogenmod: The Sony Ericsson Case
PDF
Android
PPSX
Rooting Android Devices
PDF
Lecture02web 140phpapp01
ABS 2012 - Android Device Porting Walkthrough
Rooting android
Taking Control of Your Mobile Device - Rooting-n-Roms
Qi -- Lightweight Boot Loader Applied in Mobile and Embedded Devices
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Build Your Own Android Tablet
Hacking Android OS
Build and Run Android N Source Ccode on NXP SABRESD platform
Android unlocking and rooting
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014
Beginner for install Linux and *BSD in the inexpensive ARM and Intel based mo...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Android Internals
NthCode - Porting Google Android To A Nokia N810
From stock to Cyanogenmod: The Sony Ericsson Case
Android
Rooting Android Devices
Lecture02web 140phpapp01
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
Altius execution marketplace concept.pdf
PPTX
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PDF
ment.tech-How to Develop an AI Agent Healthcare App like Sully AI (1).pdf
PDF
eBook Outline_ AI in Cybersecurity – The Future of Digital Defense.pdf
PDF
Examining Bias in AI Generated News Content.pdf
PPTX
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
PDF
TrustArc Webinar - Data Minimization in Practice_ Reducing Risk, Enhancing Co...
PPTX
Introduction-to-Artificial-Intelligence (1).pptx
PDF
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
PPTX
Report in SIP_Distance_Learning_Technology_Impact.pptx
PDF
Intravenous drug administration application for pediatric patients via augmen...
PDF
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
PDF
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
PDF
Secure Java Applications against Quantum Threats
PDF
Human Computer Interaction Miterm Lesson
PDF
Child-friendly e-learning for artificial intelligence education in Indonesia:...
PDF
Introduction to c language from lecture slides
PPTX
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
PDF
Domain-specific knowledge and context in large language models: challenges, c...
Altius execution marketplace concept.pdf
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
ment.tech-How to Develop an AI Agent Healthcare App like Sully AI (1).pdf
eBook Outline_ AI in Cybersecurity – The Future of Digital Defense.pdf
Examining Bias in AI Generated News Content.pdf
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
TrustArc Webinar - Data Minimization in Practice_ Reducing Risk, Enhancing Co...
Introduction-to-Artificial-Intelligence (1).pptx
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
Report in SIP_Distance_Learning_Technology_Impact.pptx
Intravenous drug administration application for pediatric patients via augmen...
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
Secure Java Applications against Quantum Threats
Human Computer Interaction Miterm Lesson
Child-friendly e-learning for artificial intelligence education in Indonesia:...
Introduction to c language from lecture slides
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
Domain-specific knowledge and context in large language models: challenges, c...

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