SlideShare uma empresa Scribd logo
1 de 44
Baixar para ler offline
Building Android for the
Cloud:
Android as A Server
Ron Munitz
Founder & CTO
ron@nubosoftware.com
ron@android-x86.org
AnDevCon
November 2013
@ronubo
Agenda
● Android, the cloud and I
● Android and the Cloud
● X86 Android projects
● Bringing up Android on an AWS
This work is licensed under the Creative Commons
Attribution-ShareAlike 4.0 International License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-
sa/4.0/
© Copyright Ron Munitz 2013
From distributed avionic systems
to distributed Android Systems
● Distributed Fault Tolerant Avionic Systems
○ Linux, VxWorks, very esoteric libraries, 0’s and 1’s
● Highly distributed video routers
○ Linux
● Android device bringups
○ Linux, Android
● Distributed Android
○ Rdroid? Cloudroid? Too busy working to get over the legal
naming, so no name is officially claimed for my open source
About://Ron Munitz
● According to w3tech.com, over 60% of the server market share
is owned by Unix/Linux/BSD variants.
● Android is (?) the new Linux.
○ That is a very controversial phrase.
○ But there is no doubt about it being the most popular commercial Linux
distribution
● Android as a Server
○ #Android application developers >> #Linux Application developers
○ Powerful server-grade API’s regardless of the UI.
○ Terminal Services solutions for Android (BYOD, enterprise mobility)
● Massive server migration to the cloud
● Android server migration to the cloud
Motivation for using Android in the cloud
Some Legal Notes
I have been using the name
“ClouDroid” internally in the past.
This lecture is by no means related
to any commercial “ClouDroid”
product out there - it is just shorter to
write that instead of writing “Android
for The Cloud” and helps the slides
titles to be more readable.
* This slide is by no means related to
a particular black backgrounded
graphical slide at the end of the
presentation.
I really hope so anyway...
™ Droid is a registered trademark of
LucasFilm
™ Android is a registered trademark of
Google.
* I am not a lawyer
* My sister is - but she is not my lawyer
● Let’s talk tech:
● Android ROM structure in a jiffy
○ For details see my workshop on Tuesday @AnDevCon
● Cloud selection architecture
○ Understanding the costs
○ Understanding the location
○ Understanding the underlying technology/Virtualization
● Linux bringup on the Cloud - with an Android ready kernel
● Replacing Linux Userspace with Android Userspace
“ClouDroid” HOWTO - The “Server” part
● Android is a mobile platform ⇒ UX for is a major concern
● Display is based on Surface, OpenGL and Frame Buffers
● Need to choose Remote Display Protocol for Android
○ No display protocol currently handles that well
■ Working on the FB level is just too slow.
● Or: Develop one.
○ That’s what I have been doing for the last couple of years.
“ClouDroid” HOWTO - The “UX” part
● Display protocols incur some serious issues with virtualization
techniques which are the building blocks of modern cloud
architectures. To name a few:
○ Hardware Acceleration
○ Multi-User support (big deal)
○ Noisy input and multi sensors
○ Location based services
● For the sake of the ease of discussion, let’s assume that a
remote display protocol is not an issue, and proceed with the
rest of the steps
○ It is not a big issue. It is a HUGE issue
Final words about Remote Display before we
Nice talking.
Now let’s get technical
AnDevCon
November 2013
@ronubo
Traditional terminology – whatever lies on the read-only partitions of the
device's internal flash memory:
● Recovery Mode:
○ Recovery Image (kernel + initrd)
● Operational Mode:
○ Boot Image (kernel + initrd)
○ System Image
● The magical link between the two:
○ Misc
What is not a part of the ROM?
● User data: /data, /cache, /mnt/sdcard/...
Android ROM components
Since Android is Linux at its core, we can examine its
storage layout via common Linux tools:
shell@android:/ $ df
Filesystem Size Used Free Blksize
/dev 487M 32K 487M 4096
/mnt/secure 487M 0K 487M 4096
/mnt/asec 487M 0K 487M 4096
/mnt/obb 487M 0K 487M 4096
/system 639M 464M 174M 4096
/cache 436M 7M 428M 4096
/data 5G 2G 3G 4096
/mnt/shell/emulated 5G 2G 3G 4096
Android ROM Storage Layout
shell@android:/ $ mount
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
### Output of mount continues in next slide
Android ROM Storage layout: "Standard Linux"
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/secure tmpfs rw,relatime,mode=700 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/platform/sdhci-tegra.3/by-name/APP /system ext4 ro,relatime,user_xattr,acl,barrier=1,
data=ordered 0 0
/dev/block/platform/sdhci-tegra.3/by-name/CAC /cache ext4 rw,nosuid,nodev,noatime,
errors=panic,user_xattr,acl,barrier=1,nomblk_io_submit,data=ordered,discard 0 0
/dev/block/platform/sdhci-tegra.3/by-name/UDA /data ext4 rw,nosuid,nodev,noatime,errors=panic,
user_xattr,acl,barrier=1,nomblk_io_submit,data=ordered,discard 0 0
/dev/fuse /mnt/shell/emulated fuse rw, nosuid, nodev, relatime,user_id=1023,group_id=1023,
default_permissions,allow_other 0 0
Android ROM Storage layout: "Standard Android"
shell@android:/ $ cat /proc/partitions
major minor #blocks name
179 0 7467008 mmcblk0
179 1 12288 mmcblk0p1
179 2 8192 mmcblk0p2
179 3 665600 mmcblk0p3
179 4 453632 mmcblk0p4
179 5 512 mmcblk0p5
179 6 10240 mmcblk0p6
179 7 5120 mmcblk0p7
179 8 512 mmcblk0p8
179 9 6302720 mmcblk0p9
Android ROM Storage Layout
shell@android:/ $ ls -l /dev/block/platform/sdhci-tegra.3/by-name/
lrwxrwxrwx root root 2013-02-06 03:54 APP -> /dev/block/mmcblk0p3
lrwxrwxrwx root root 2013-02-06 03:54 CAC -> /dev/block/mmcblk0p4
lrwxrwxrwx root root 2013-02-06 03:54 LNX -> /dev/block/mmcblk0p2
lrwxrwxrwx root root 2013-02-06 03:54 MDA -> /dev/block/mmcblk0p8
lrwxrwxrwx root root 2013-02-06 03:54 MSC -> /dev/block/mmcblk0p5
lrwxrwxrwx root root 2013-02-06 03:54 PER -> /dev/block/mmcblk0p7
lrwxrwxrwx root root 2013-02-06 03:54 SOS -> /dev/block/mmcblk0p1
lrwxrwxrwx root root 2013-02-06 03:54 UDA -> /dev/block/mmcblk0p9
lrwxrwxrwx root root 2013-02-06 03:54 USP -> /dev/block/mmcblk0p6
Legend: APP is system, SOS is recovery, UDA is for data...
So, where is my stuff?!
For a couple of reasons:
● Backup
● Recovery
● Software updates
● Error checking
● Board design
● Curiosity
● ...
● Because bringing up Android on the Cloud is
essentially building an Android device!
Why should we care about it?
Various forks to the Android Open Source Project:
● AOSP - (4.4+ OPENMASTER/KRT16M upstream)
○ The root of all (good?)
● Android-X86 (KRT16M upstream, JLS36I last stable release)
● Android-IA (JDQ39 upstream )
● Many other forks
○ CyanogenMod
○ Buildroid/AndroVM
○ And many others... Not all are known or Open-Sourced
Android Projects
X86 Android Projects
AnDevCon
November 2013
@ronubo
● Most Cloud Based architecture run or virtualize X86
based hardware
● Architecture set Emulation is expensive
● It is also unnecessary
● Virtualize Android for X86 architectures on the cloud
Motivation
X86 ROMs (by chronological order):
● Android-X86 (Debut date: 2009)
○ http://android-x86.org
● Emulator-x86 (Debut date: 2011)
○ http://source.android.com
● Android-IA (Debut date: 2012)
○ https://01.org/android-ia
Android and X86
The common reference, having the most recent version of the Android platform
(Userspace) versions.
Provides the QEMU based Android Emulator:
+ Works on any hosted OS
+ Supports multiple architectures
- But slow on non X86 ones
- Performs terribly if virtualized
- Has no installer for X86 devices
- Very old kernel
+/- An emulator. For better and for worse.
AOSP
+ Developed by the open source community
+ Developer/Linux user friendly
+ Multi-Boot friendly
+ Generally supports many Intel and AMD devices
+/- But of course requires specific work on specific HW
+ VM friendly
+ Mature, Recognized and stable
- Delays in new releases (You can help!)
- Latest version (4.4) is still very buggy, but it’s been out only for a week
+/- Latest stable version (4.3) still needs some work for some devices
+ The ICS 4.0.4 release is amazing - including running ARM apps
Android-X86
+ Installer to device
+ Relatively new versions of android and kernel
+ Works great on ivy-bridge devices
+ Integrated Ethernet Configuration Management
- Development for devices based on intel solutions only
- Very unfriendly to other OS's
- Not developer friendly – unless they make it such
- Community work can be better. But it is seems to be getting better
- Intel phones are not based on it (at the moment)
+ Made impressive progress in early 2013
- But suspended development at Android 4.2.2
? Project resumption at Kit-Kat?
Android-IA
● Android is Linux
○ Therefore the required minimum to run it would be:
■ A Kernel
■ A filesystem
■ A ramdisk/initrd... Whatever makes you happy with your kernel's
init/main.c's run_init_process() calls.
See http://lxr.linux.no/linux+v3.6.9/init/main.c
○ This means that we can achieve full functionality with
■ A kernel (+ramdisk)
■ A rootfs where Android system/ will be mounted (ROM)
■ Some place to read/write data
Android is Linux
Android-IA is Android
Android-IA is, of course, Linux as well.
However, it was designed to conform to Android OEM's partition layout, and
has no less than 9 partitions:
○ boot - flashed boot.img (kernel+ramdisk.img)
○ recovery - Recovery image
○ misc - shared storage between boot and recovery
○ system - flashed system.img - contents of the System partition
○ cache - cache partition
○ data - data partition
○ install - Installation definition
○ bootloader - A vfat partition containing android syslinux bootloader (<4.2.2)
- A GPT partition containing gummiboot (Only option in 4.2.2)
○ fastboot - fastboot protocol (flashed droidboot.img)
Note: On android-ia-4.2.2-r1, the bootable live.img works with a single partition,
enforcing EFI. It still has its issues - but it is getting there.
● One partition with two directories
○ First directory – grub (bootloader)
○ Second directory – files of android (SRC)
■ kernel
■ initrd.img
■ ramdisk.img
○ system
○ data
● This simple structure makes it very easy to work and debug
Note: Also comes with a live CD/installer. Very convenient.
Android-X86 is Linux
● Start bootloader
● The bootloader starts the combined kernel + ramdisk
image (boot.img flashed to /boot)
● At the end of kernel initialization Android's
● /init runs from ramdisk
● File systems are mounted the Android way – using
fstab.common that is processed (mount_all command)
from in init.<target>.rc
Android-IA boot process
● Start bootloader (GRUB)
● bootloader starts kernel + initrd (minimal linux) + kernel
command line
● At the end of kernel initialization
○ run the /init script from initrd.img
○ load some modules, etc.
○ At the end change root to the Android file system
● Run the /init binary from ramdisk.img
○ Which parses init.rc, and starts talking “Android-ish”
Android-X86 boot process
It depends what you need:
○ Developer options?
○ Debugging the init process?
○ Support for Hardware?
○ Support for OTA?
○ Licensing?
○ Participating in project direction?
○ Upstream features?
○ ...
There is no Black and White.
Which one is better?
● Use Android-X86 installer system
● And put your desired android files (matching
kernel/ramdisk/system) in the same partition.
● Use the Android-X86 chroot mechanism
○ Critics: Does redundant stuff
○ But that's just a hack anyway – devise specific solutions for
specific problems
● This way, we can multiple boot various projects:
○ Android-IA
○ AOSP
○ Any other OS...
Note: You can also use chroot mechanism on any Linux Distribution,
from userspace! But this is significantly harder...
An hybrid approach
Repartition existing Linux partition (Don't do that...)
Install Android-X86
Add entries to GRUB
Reboot to Android-X86 debug mode
Copy Android-IA files from a pendrive or over SCP
For the former: cp /mnt/USB/A-IA/ /mnt && sync
/mnt is the root of Android-X86 installed partition
(e.g. (hd0,1)/...
Update GRUB entries and update GRUB
Voila :-)
Less simplified procedure: Debug GRUB... :-(
** Note: Replace Android-IA with AOSP to boot AOSP built files (system.img /
kernel / ramdisk.img) on your target device.
Multi-boot recipe with legacy GRUB (simplified)
● Repartition existing Linux partition (Don't do that...)
● Create a mount point for your multi-booting android
○ Can make a partition per distribution, it doesn't really matter.
○ For this example let's assume all Android distributions will co exist on the same
partition, and that it is mounted to /media/Android-x86
● Build your images
○ AOSP: Discussed before
○ Android-x86:
■ . build/envsetup.sh && lunch android_x86-<variant> 
&& make iso_img
○ Android-IA:
■ . build/envsetup.sh && lunch core_mesa-<variant> 
&& make allimages
■ . build/envsetup.sh && lunch bigcore-<variant> && make allimages
** <variant> is either one of the following: user, userdebug, eng
Multi-boot recipe using GRUB2
● Create directories for your projects (e.g. jb-x86, A-IA, AOSP) under your
mount point (e.g. /media/Android-x86)
● From Android-X86's out/product/target: Copy initrd.img to all projects.
○ Can of course only copy ramdisk to one location.
● From all projects – copy kernel, ramdisk.img, system/ and data/ to to
the corresponding directory under your mount point.
● Add entries to GRUB and update grub.
● # e.g. sudo vi /etc/grub.d/40_custom && update-grub
Multi-boot recipe using GRUB2 (cont.)
$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda5 451656948 394848292 34199920 93% /
udev 1954628 4 1954624 1% /dev
tmpfs 785388 1072 784316 1% /run
none 5120 0 5120 0% /run/lock
none 1963460 2628 1960832 1% /run/shm
/dev/sda1 15481360 5165416 9529464 36% /media/Android-
x86
Multi-boot recipe with GRUB2 - A numerical example
#### JB-X86
menuentry 'jb-x86' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
echo 'Loading Android-X86'
linux /jb-x86/kernel quiet androidboot.hardware=android_x86 video=-16 SRC=/jb-x86
initrd /jb-x86/initrd.img
}
A numerical example (cont.)- /etc/grub.d/40_custom
### android-IA
menuentry 'Android-IA' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
echo 'Loading Android-IA'
linux /A-IA/kernel console=ttyS0 pci=noearly console=tty0 loglevel=8 androidboot.hardware=ivb
SRC=/A-IA
initrd /A-IA/initrd.img
}
A numerical example (cont.) - /etc/grub.d/40_custom
● In the last couple of slides I essentially gave you the choice of which
Android system to use on your cloud services.
● Now I will give you the recipe:
○ Cloudroid recipe:
■ Choose an Android distribution
● Most convenient for debugging: Some sort of Android-
X86.
● Bring it up on your target architecture
○ i.e. HW, or VM
● Pack it in your cloud service instance wrapper
● DEBUG. These things are not trivial.
OK, some tricky linux stuff. why should we care?!
● AWS Cloudroid recipe:
○ Choose “Local” server with HW characteristics similiar to the
target VM
○ Bring up Android-X86 on XEN
■ You can use other distributions too for the chroot part
■ In fact - in many of my projects I use the AOSP
○ Create an AMI out of that Android-X86 instance
○ Set up a new AWS instance with that AMI
● Sounds simple, right?
○ Well, it’s not. If you are up for the challenge, I would definitely
recommend hiring a top-notch, competent Linux bringup
superstar.
● There is a a bit simpler alternative...
A Numerical example - Using AWS
● A couple of excellent options for the non-virtualized
Host (assuming Intel VT/AMD-V and the likes)
○ The AOSP X86 emulator/AOSP on a Virtual Machine
○ Android-X86 on a Virtual Machine
○ Android-IA on a Virtual Machine
● Problem: Can’t run a VM within a VM!
● There is an elegant solution for this problem...
Using Android from within Linux
Releasing an Android from a chroot jail
in two quick steps:
1. Run “Standard” Linux
2. chroot <Android ramdisk.img> <Android’s /init>
● Bring up a standard Amazon Machine Instance (AMI) according to
your VM requirements (bandwidth, memory, CPU, storage, location).
● Copy Android components to the AMI
○ XEN + Android ready kernel + initramfs
○ system.img
○ data.img
○ ramdisk.img
● Update bootloader to load Replace kernel + initramfs
● Boot AMI instance
● mount system.img and data.img as loopback devices
● chroot to Android’s ramdisk.img - running Android’s /init
○ A N D R O I D
● Success!
chroot Jail - AWS recipe
● The AOSP is hosted at http://source.android.com
● The Android-x86.org project is hosted at http://Android-X86.org
● The Android-IA project is hosted at https://01.org/android-ia
● Free AWS trial is available at http://aws.amazon.com/
● Android on the cloud in the real world - http://www.nubosoftware.com
● Android on IA - ROM cooking tutorial - Ron Munitz, AnDevCon November, 2013
● Introduction to Embedded Android course - by Ron Munitz.
Taught at Afeka College of Engineering, Tel-Aviv, Israel
● Android Internals course - @thePSCG
● Android Customization course - @thePSCG
References
Thank You AnDevCon
November 2013

Mais conteúdo relacionado

Mais procurados

BKK16-500K2 CTO talk - The End to End Story
BKK16-500K2 CTO talk - The End to End StoryBKK16-500K2 CTO talk - The End to End Story
BKK16-500K2 CTO talk - The End to End StoryLinaro
 
The end of embedded Linux (as we know it)
The end of embedded Linux (as we know it)The end of embedded Linux (as we know it)
The end of embedded Linux (as we know it)Chris Simmonds
 
Embedded Android: Android beyond the smartphone
Embedded Android: Android beyond the smartphoneEmbedded Android: Android beyond the smartphone
Embedded Android: Android beyond the smartphoneChris Simmonds
 
Developing Android Platform Tools
Developing Android Platform ToolsDeveloping Android Platform Tools
Developing Android Platform ToolsOpersys inc.
 
Read-only rootfs: theory and practice
Read-only rootfs: theory and practiceRead-only rootfs: theory and practice
Read-only rootfs: theory and practiceChris Simmonds
 
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) WinningKernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) WinningAnne Nicolas
 
A timeline for embedded Linux
A timeline for embedded LinuxA timeline for embedded Linux
A timeline for embedded LinuxChris Simmonds
 
MOVED: RDK/WPE Port on DB410C - SFO17-206
MOVED: RDK/WPE Port on DB410C - SFO17-206MOVED: RDK/WPE Port on DB410C - SFO17-206
MOVED: RDK/WPE Port on DB410C - SFO17-206Linaro
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardAnne Nicolas
 
Reducing the boot time of Linux devices
Reducing the boot time of Linux devicesReducing the boot time of Linux devices
Reducing the boot time of Linux devicesChris Simmonds
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 
10 ways hardware engineers can make software integration easier
10 ways hardware engineers can make software integration easier10 ways hardware engineers can make software integration easier
10 ways hardware engineers can make software integration easierChris Simmonds
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017Chris Simmonds
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011pundiramit
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...linuxlab_conf
 

Mais procurados (20)

What & How to Customize Android?
What & How to Customize Android?What & How to Customize Android?
What & How to Customize Android?
 
BKK16-500K2 CTO talk - The End to End Story
BKK16-500K2 CTO talk - The End to End StoryBKK16-500K2 CTO talk - The End to End Story
BKK16-500K2 CTO talk - The End to End Story
 
Bringing Tizen to a Raspberry Pi 2 Near You
Bringing Tizen to a Raspberry Pi 2 Near YouBringing Tizen to a Raspberry Pi 2 Near You
Bringing Tizen to a Raspberry Pi 2 Near You
 
The end of embedded Linux (as we know it)
The end of embedded Linux (as we know it)The end of embedded Linux (as we know it)
The end of embedded Linux (as we know it)
 
Embedded Android: Android beyond the smartphone
Embedded Android: Android beyond the smartphoneEmbedded Android: Android beyond the smartphone
Embedded Android: Android beyond the smartphone
 
Developing Android Platform Tools
Developing Android Platform ToolsDeveloping Android Platform Tools
Developing Android Platform Tools
 
Read-only rootfs: theory and practice
Read-only rootfs: theory and practiceRead-only rootfs: theory and practice
Read-only rootfs: theory and practice
 
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) WinningKernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
 
A timeline for embedded Linux
A timeline for embedded LinuxA timeline for embedded Linux
A timeline for embedded Linux
 
MOVED: RDK/WPE Port on DB410C - SFO17-206
MOVED: RDK/WPE Port on DB410C - SFO17-206MOVED: RDK/WPE Port on DB410C - SFO17-206
MOVED: RDK/WPE Port on DB410C - SFO17-206
 
Using OpenEmbedded
Using OpenEmbeddedUsing OpenEmbedded
Using OpenEmbedded
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
 
Reducing the boot time of Linux devices
Reducing the boot time of Linux devicesReducing the boot time of Linux devices
Reducing the boot time of Linux devices
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
10 ways hardware engineers can make software integration easier
10 ways hardware engineers can make software integration easier10 ways hardware engineers can make software integration easier
10 ways hardware engineers can make software integration easier
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
 

Semelhante a Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)

X86 ROM Cooking 101 (Android Builders Summit 2014)
X86 ROM Cooking 101 (Android Builders Summit 2014)X86 ROM Cooking 101 (Android Builders Summit 2014)
X86 ROM Cooking 101 (Android Builders Summit 2014)Ron Munitz
 
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)Ron Munitz
 
Hacking with ARM Mobile devices on Linux
Hacking with ARM Mobile devices on LinuxHacking with ARM Mobile devices on Linux
Hacking with ARM Mobile devices on LinuxNetwalker lab kapper
 
Hacking with Linux on Android devices #MOCPON
Hacking with Linux on Android devices    #MOCPONHacking with Linux on Android devices    #MOCPON
Hacking with Linux on Android devices #MOCPONNetwalker lab kapper
 
Headless Android (Wearable DevCon 2014)
Headless Android (Wearable DevCon 2014)Headless Android (Wearable DevCon 2014)
Headless Android (Wearable DevCon 2014)Ron Munitz
 
Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Opersys inc.
 
BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)
BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)
BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)Ron Munitz
 
Android ROM cooking: A practical Tutorial (DroidCon Torino 2014)
Android ROM cooking: A practical Tutorial (DroidCon Torino 2014)Android ROM cooking: A practical Tutorial (DroidCon Torino 2014)
Android ROM cooking: A practical Tutorial (DroidCon Torino 2014)Ron Munitz
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteOpersys inc.
 
Introduction to Android ROM cooking, part of my AnDevCon workshop (AnDevCon S...
Introduction to Android ROM cooking, part of my AnDevCon workshop (AnDevCon S...Introduction to Android ROM cooking, part of my AnDevCon workshop (AnDevCon S...
Introduction to Android ROM cooking, part of my AnDevCon workshop (AnDevCon S...Ron Munitz
 
Hacking with ARM devices on Linux
Hacking with ARM devices on Linux Hacking with ARM devices on Linux
Hacking with ARM devices on Linux Netwalker lab kapper
 
LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205Linaro
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Is Android the New Embedded Linux? at AnDevCon IV
Is Android the New Embedded Linux? at AnDevCon IVIs Android the New Embedded Linux? at AnDevCon IV
Is Android the New Embedded Linux? at AnDevCon IVOpersys inc.
 
Droidcon uk2012 androvm
Droidcon uk2012 androvmDroidcon uk2012 androvm
Droidcon uk2012 androvmdfages
 
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Ron Munitz
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop at Embedded World 2014Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop at Embedded World 2014Opersys inc.
 
Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014Opersys inc.
 

Semelhante a Android As a Server- Building Android for the Cloud (AnDevCon SF 2013) (20)

X86 ROM Cooking 101 (Android Builders Summit 2014)
X86 ROM Cooking 101 (Android Builders Summit 2014)X86 ROM Cooking 101 (Android Builders Summit 2014)
X86 ROM Cooking 101 (Android Builders Summit 2014)
 
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)
 
Hacking with ARM Mobile devices on Linux
Hacking with ARM Mobile devices on LinuxHacking with ARM Mobile devices on Linux
Hacking with ARM Mobile devices on Linux
 
Hacking with Linux on Android devices #MOCPON
Hacking with Linux on Android devices    #MOCPONHacking with Linux on Android devices    #MOCPON
Hacking with Linux on Android devices #MOCPON
 
Headless Android (Wearable DevCon 2014)
Headless Android (Wearable DevCon 2014)Headless Android (Wearable DevCon 2014)
Headless Android (Wearable DevCon 2014)
 
Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014
 
BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)
BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)
BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)
 
Android ROM cooking: A practical Tutorial (DroidCon Torino 2014)
Android ROM cooking: A practical Tutorial (DroidCon Torino 2014)Android ROM cooking: A practical Tutorial (DroidCon Torino 2014)
Android ROM cooking: A practical Tutorial (DroidCon Torino 2014)
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform Toolsuite
 
Introduction to Android ROM cooking, part of my AnDevCon workshop (AnDevCon S...
Introduction to Android ROM cooking, part of my AnDevCon workshop (AnDevCon S...Introduction to Android ROM cooking, part of my AnDevCon workshop (AnDevCon S...
Introduction to Android ROM cooking, part of my AnDevCon workshop (AnDevCon S...
 
Hacking with ARM devices on Linux
Hacking with ARM devices on Linux Hacking with ARM devices on Linux
Hacking with ARM devices on Linux
 
LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Is Android the New Embedded Linux? at AnDevCon IV
Is Android the New Embedded Linux? at AnDevCon IVIs Android the New Embedded Linux? at AnDevCon IV
Is Android the New Embedded Linux? at AnDevCon IV
 
Droidcon uk2012 androvm
Droidcon uk2012 androvmDroidcon uk2012 androvm
Droidcon uk2012 androvm
 
Android Development Tutorial V3
Android Development Tutorial   V3Android Development Tutorial   V3
Android Development Tutorial V3
 
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop at Embedded World 2014Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop at Embedded World 2014
 
Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014
 

Último

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Último (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)

  • 1. Building Android for the Cloud: Android as A Server Ron Munitz Founder & CTO ron@nubosoftware.com ron@android-x86.org AnDevCon November 2013 @ronubo
  • 2. Agenda ● Android, the cloud and I ● Android and the Cloud ● X86 Android projects ● Bringing up Android on an AWS
  • 3. This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by- sa/4.0/ © Copyright Ron Munitz 2013
  • 4. From distributed avionic systems to distributed Android Systems ● Distributed Fault Tolerant Avionic Systems ○ Linux, VxWorks, very esoteric libraries, 0’s and 1’s ● Highly distributed video routers ○ Linux ● Android device bringups ○ Linux, Android ● Distributed Android ○ Rdroid? Cloudroid? Too busy working to get over the legal naming, so no name is officially claimed for my open source About://Ron Munitz
  • 5. ● According to w3tech.com, over 60% of the server market share is owned by Unix/Linux/BSD variants. ● Android is (?) the new Linux. ○ That is a very controversial phrase. ○ But there is no doubt about it being the most popular commercial Linux distribution ● Android as a Server ○ #Android application developers >> #Linux Application developers ○ Powerful server-grade API’s regardless of the UI. ○ Terminal Services solutions for Android (BYOD, enterprise mobility) ● Massive server migration to the cloud ● Android server migration to the cloud Motivation for using Android in the cloud
  • 6. Some Legal Notes I have been using the name “ClouDroid” internally in the past. This lecture is by no means related to any commercial “ClouDroid” product out there - it is just shorter to write that instead of writing “Android for The Cloud” and helps the slides titles to be more readable. * This slide is by no means related to a particular black backgrounded graphical slide at the end of the presentation. I really hope so anyway... ™ Droid is a registered trademark of LucasFilm ™ Android is a registered trademark of Google. * I am not a lawyer * My sister is - but she is not my lawyer
  • 7. ● Let’s talk tech: ● Android ROM structure in a jiffy ○ For details see my workshop on Tuesday @AnDevCon ● Cloud selection architecture ○ Understanding the costs ○ Understanding the location ○ Understanding the underlying technology/Virtualization ● Linux bringup on the Cloud - with an Android ready kernel ● Replacing Linux Userspace with Android Userspace “ClouDroid” HOWTO - The “Server” part
  • 8. ● Android is a mobile platform ⇒ UX for is a major concern ● Display is based on Surface, OpenGL and Frame Buffers ● Need to choose Remote Display Protocol for Android ○ No display protocol currently handles that well ■ Working on the FB level is just too slow. ● Or: Develop one. ○ That’s what I have been doing for the last couple of years. “ClouDroid” HOWTO - The “UX” part
  • 9. ● Display protocols incur some serious issues with virtualization techniques which are the building blocks of modern cloud architectures. To name a few: ○ Hardware Acceleration ○ Multi-User support (big deal) ○ Noisy input and multi sensors ○ Location based services ● For the sake of the ease of discussion, let’s assume that a remote display protocol is not an issue, and proceed with the rest of the steps ○ It is not a big issue. It is a HUGE issue Final words about Remote Display before we
  • 10. Nice talking. Now let’s get technical AnDevCon November 2013 @ronubo
  • 11. Traditional terminology – whatever lies on the read-only partitions of the device's internal flash memory: ● Recovery Mode: ○ Recovery Image (kernel + initrd) ● Operational Mode: ○ Boot Image (kernel + initrd) ○ System Image ● The magical link between the two: ○ Misc What is not a part of the ROM? ● User data: /data, /cache, /mnt/sdcard/... Android ROM components
  • 12. Since Android is Linux at its core, we can examine its storage layout via common Linux tools: shell@android:/ $ df Filesystem Size Used Free Blksize /dev 487M 32K 487M 4096 /mnt/secure 487M 0K 487M 4096 /mnt/asec 487M 0K 487M 4096 /mnt/obb 487M 0K 487M 4096 /system 639M 464M 174M 4096 /cache 436M 7M 428M 4096 /data 5G 2G 3G 4096 /mnt/shell/emulated 5G 2G 3G 4096 Android ROM Storage Layout
  • 13. shell@android:/ $ mount rootfs / rootfs ro,relatime 0 0 tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0 devpts /dev/pts devpts rw,relatime,mode=600 0 0 proc /proc proc rw,relatime 0 0 sysfs /sys sysfs rw,relatime 0 0 debugfs /sys/kernel/debug debugfs rw,relatime 0 0 ### Output of mount continues in next slide Android ROM Storage layout: "Standard Linux"
  • 14. none /acct cgroup rw,relatime,cpuacct 0 0 tmpfs /mnt/secure tmpfs rw,relatime,mode=700 0 0 tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0 tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0 none /dev/cpuctl cgroup rw,relatime,cpu 0 0 /dev/block/platform/sdhci-tegra.3/by-name/APP /system ext4 ro,relatime,user_xattr,acl,barrier=1, data=ordered 0 0 /dev/block/platform/sdhci-tegra.3/by-name/CAC /cache ext4 rw,nosuid,nodev,noatime, errors=panic,user_xattr,acl,barrier=1,nomblk_io_submit,data=ordered,discard 0 0 /dev/block/platform/sdhci-tegra.3/by-name/UDA /data ext4 rw,nosuid,nodev,noatime,errors=panic, user_xattr,acl,barrier=1,nomblk_io_submit,data=ordered,discard 0 0 /dev/fuse /mnt/shell/emulated fuse rw, nosuid, nodev, relatime,user_id=1023,group_id=1023, default_permissions,allow_other 0 0 Android ROM Storage layout: "Standard Android"
  • 15. shell@android:/ $ cat /proc/partitions major minor #blocks name 179 0 7467008 mmcblk0 179 1 12288 mmcblk0p1 179 2 8192 mmcblk0p2 179 3 665600 mmcblk0p3 179 4 453632 mmcblk0p4 179 5 512 mmcblk0p5 179 6 10240 mmcblk0p6 179 7 5120 mmcblk0p7 179 8 512 mmcblk0p8 179 9 6302720 mmcblk0p9 Android ROM Storage Layout
  • 16. shell@android:/ $ ls -l /dev/block/platform/sdhci-tegra.3/by-name/ lrwxrwxrwx root root 2013-02-06 03:54 APP -> /dev/block/mmcblk0p3 lrwxrwxrwx root root 2013-02-06 03:54 CAC -> /dev/block/mmcblk0p4 lrwxrwxrwx root root 2013-02-06 03:54 LNX -> /dev/block/mmcblk0p2 lrwxrwxrwx root root 2013-02-06 03:54 MDA -> /dev/block/mmcblk0p8 lrwxrwxrwx root root 2013-02-06 03:54 MSC -> /dev/block/mmcblk0p5 lrwxrwxrwx root root 2013-02-06 03:54 PER -> /dev/block/mmcblk0p7 lrwxrwxrwx root root 2013-02-06 03:54 SOS -> /dev/block/mmcblk0p1 lrwxrwxrwx root root 2013-02-06 03:54 UDA -> /dev/block/mmcblk0p9 lrwxrwxrwx root root 2013-02-06 03:54 USP -> /dev/block/mmcblk0p6 Legend: APP is system, SOS is recovery, UDA is for data... So, where is my stuff?!
  • 17. For a couple of reasons: ● Backup ● Recovery ● Software updates ● Error checking ● Board design ● Curiosity ● ... ● Because bringing up Android on the Cloud is essentially building an Android device! Why should we care about it?
  • 18. Various forks to the Android Open Source Project: ● AOSP - (4.4+ OPENMASTER/KRT16M upstream) ○ The root of all (good?) ● Android-X86 (KRT16M upstream, JLS36I last stable release) ● Android-IA (JDQ39 upstream ) ● Many other forks ○ CyanogenMod ○ Buildroid/AndroVM ○ And many others... Not all are known or Open-Sourced Android Projects
  • 20. ● Most Cloud Based architecture run or virtualize X86 based hardware ● Architecture set Emulation is expensive ● It is also unnecessary ● Virtualize Android for X86 architectures on the cloud Motivation
  • 21. X86 ROMs (by chronological order): ● Android-X86 (Debut date: 2009) ○ http://android-x86.org ● Emulator-x86 (Debut date: 2011) ○ http://source.android.com ● Android-IA (Debut date: 2012) ○ https://01.org/android-ia Android and X86
  • 22. The common reference, having the most recent version of the Android platform (Userspace) versions. Provides the QEMU based Android Emulator: + Works on any hosted OS + Supports multiple architectures - But slow on non X86 ones - Performs terribly if virtualized - Has no installer for X86 devices - Very old kernel +/- An emulator. For better and for worse. AOSP
  • 23. + Developed by the open source community + Developer/Linux user friendly + Multi-Boot friendly + Generally supports many Intel and AMD devices +/- But of course requires specific work on specific HW + VM friendly + Mature, Recognized and stable - Delays in new releases (You can help!) - Latest version (4.4) is still very buggy, but it’s been out only for a week +/- Latest stable version (4.3) still needs some work for some devices + The ICS 4.0.4 release is amazing - including running ARM apps Android-X86
  • 24. + Installer to device + Relatively new versions of android and kernel + Works great on ivy-bridge devices + Integrated Ethernet Configuration Management - Development for devices based on intel solutions only - Very unfriendly to other OS's - Not developer friendly – unless they make it such - Community work can be better. But it is seems to be getting better - Intel phones are not based on it (at the moment) + Made impressive progress in early 2013 - But suspended development at Android 4.2.2 ? Project resumption at Kit-Kat? Android-IA
  • 25. ● Android is Linux ○ Therefore the required minimum to run it would be: ■ A Kernel ■ A filesystem ■ A ramdisk/initrd... Whatever makes you happy with your kernel's init/main.c's run_init_process() calls. See http://lxr.linux.no/linux+v3.6.9/init/main.c ○ This means that we can achieve full functionality with ■ A kernel (+ramdisk) ■ A rootfs where Android system/ will be mounted (ROM) ■ Some place to read/write data Android is Linux
  • 26. Android-IA is Android Android-IA is, of course, Linux as well. However, it was designed to conform to Android OEM's partition layout, and has no less than 9 partitions: ○ boot - flashed boot.img (kernel+ramdisk.img) ○ recovery - Recovery image ○ misc - shared storage between boot and recovery ○ system - flashed system.img - contents of the System partition ○ cache - cache partition ○ data - data partition ○ install - Installation definition ○ bootloader - A vfat partition containing android syslinux bootloader (<4.2.2) - A GPT partition containing gummiboot (Only option in 4.2.2) ○ fastboot - fastboot protocol (flashed droidboot.img) Note: On android-ia-4.2.2-r1, the bootable live.img works with a single partition, enforcing EFI. It still has its issues - but it is getting there.
  • 27. ● One partition with two directories ○ First directory – grub (bootloader) ○ Second directory – files of android (SRC) ■ kernel ■ initrd.img ■ ramdisk.img ○ system ○ data ● This simple structure makes it very easy to work and debug Note: Also comes with a live CD/installer. Very convenient. Android-X86 is Linux
  • 28. ● Start bootloader ● The bootloader starts the combined kernel + ramdisk image (boot.img flashed to /boot) ● At the end of kernel initialization Android's ● /init runs from ramdisk ● File systems are mounted the Android way – using fstab.common that is processed (mount_all command) from in init.<target>.rc Android-IA boot process
  • 29. ● Start bootloader (GRUB) ● bootloader starts kernel + initrd (minimal linux) + kernel command line ● At the end of kernel initialization ○ run the /init script from initrd.img ○ load some modules, etc. ○ At the end change root to the Android file system ● Run the /init binary from ramdisk.img ○ Which parses init.rc, and starts talking “Android-ish” Android-X86 boot process
  • 30. It depends what you need: ○ Developer options? ○ Debugging the init process? ○ Support for Hardware? ○ Support for OTA? ○ Licensing? ○ Participating in project direction? ○ Upstream features? ○ ... There is no Black and White. Which one is better?
  • 31. ● Use Android-X86 installer system ● And put your desired android files (matching kernel/ramdisk/system) in the same partition. ● Use the Android-X86 chroot mechanism ○ Critics: Does redundant stuff ○ But that's just a hack anyway – devise specific solutions for specific problems ● This way, we can multiple boot various projects: ○ Android-IA ○ AOSP ○ Any other OS... Note: You can also use chroot mechanism on any Linux Distribution, from userspace! But this is significantly harder... An hybrid approach
  • 32. Repartition existing Linux partition (Don't do that...) Install Android-X86 Add entries to GRUB Reboot to Android-X86 debug mode Copy Android-IA files from a pendrive or over SCP For the former: cp /mnt/USB/A-IA/ /mnt && sync /mnt is the root of Android-X86 installed partition (e.g. (hd0,1)/... Update GRUB entries and update GRUB Voila :-) Less simplified procedure: Debug GRUB... :-( ** Note: Replace Android-IA with AOSP to boot AOSP built files (system.img / kernel / ramdisk.img) on your target device. Multi-boot recipe with legacy GRUB (simplified)
  • 33. ● Repartition existing Linux partition (Don't do that...) ● Create a mount point for your multi-booting android ○ Can make a partition per distribution, it doesn't really matter. ○ For this example let's assume all Android distributions will co exist on the same partition, and that it is mounted to /media/Android-x86 ● Build your images ○ AOSP: Discussed before ○ Android-x86: ■ . build/envsetup.sh && lunch android_x86-<variant> && make iso_img ○ Android-IA: ■ . build/envsetup.sh && lunch core_mesa-<variant> && make allimages ■ . build/envsetup.sh && lunch bigcore-<variant> && make allimages ** <variant> is either one of the following: user, userdebug, eng Multi-boot recipe using GRUB2
  • 34. ● Create directories for your projects (e.g. jb-x86, A-IA, AOSP) under your mount point (e.g. /media/Android-x86) ● From Android-X86's out/product/target: Copy initrd.img to all projects. ○ Can of course only copy ramdisk to one location. ● From all projects – copy kernel, ramdisk.img, system/ and data/ to to the corresponding directory under your mount point. ● Add entries to GRUB and update grub. ● # e.g. sudo vi /etc/grub.d/40_custom && update-grub Multi-boot recipe using GRUB2 (cont.)
  • 35. $ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda5 451656948 394848292 34199920 93% / udev 1954628 4 1954624 1% /dev tmpfs 785388 1072 784316 1% /run none 5120 0 5120 0% /run/lock none 1963460 2628 1960832 1% /run/shm /dev/sda1 15481360 5165416 9529464 36% /media/Android- x86 Multi-boot recipe with GRUB2 - A numerical example
  • 36. #### JB-X86 menuentry 'jb-x86' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod gzio insmod part_msdos insmod ext2 set root='(hd0,msdos1)' echo 'Loading Android-X86' linux /jb-x86/kernel quiet androidboot.hardware=android_x86 video=-16 SRC=/jb-x86 initrd /jb-x86/initrd.img } A numerical example (cont.)- /etc/grub.d/40_custom
  • 37. ### android-IA menuentry 'Android-IA' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod gzio insmod part_msdos insmod ext2 set root='(hd0,msdos1)' echo 'Loading Android-IA' linux /A-IA/kernel console=ttyS0 pci=noearly console=tty0 loglevel=8 androidboot.hardware=ivb SRC=/A-IA initrd /A-IA/initrd.img } A numerical example (cont.) - /etc/grub.d/40_custom
  • 38. ● In the last couple of slides I essentially gave you the choice of which Android system to use on your cloud services. ● Now I will give you the recipe: ○ Cloudroid recipe: ■ Choose an Android distribution ● Most convenient for debugging: Some sort of Android- X86. ● Bring it up on your target architecture ○ i.e. HW, or VM ● Pack it in your cloud service instance wrapper ● DEBUG. These things are not trivial. OK, some tricky linux stuff. why should we care?!
  • 39. ● AWS Cloudroid recipe: ○ Choose “Local” server with HW characteristics similiar to the target VM ○ Bring up Android-X86 on XEN ■ You can use other distributions too for the chroot part ■ In fact - in many of my projects I use the AOSP ○ Create an AMI out of that Android-X86 instance ○ Set up a new AWS instance with that AMI ● Sounds simple, right? ○ Well, it’s not. If you are up for the challenge, I would definitely recommend hiring a top-notch, competent Linux bringup superstar. ● There is a a bit simpler alternative... A Numerical example - Using AWS
  • 40. ● A couple of excellent options for the non-virtualized Host (assuming Intel VT/AMD-V and the likes) ○ The AOSP X86 emulator/AOSP on a Virtual Machine ○ Android-X86 on a Virtual Machine ○ Android-IA on a Virtual Machine ● Problem: Can’t run a VM within a VM! ● There is an elegant solution for this problem... Using Android from within Linux
  • 41. Releasing an Android from a chroot jail in two quick steps: 1. Run “Standard” Linux 2. chroot <Android ramdisk.img> <Android’s /init>
  • 42. ● Bring up a standard Amazon Machine Instance (AMI) according to your VM requirements (bandwidth, memory, CPU, storage, location). ● Copy Android components to the AMI ○ XEN + Android ready kernel + initramfs ○ system.img ○ data.img ○ ramdisk.img ● Update bootloader to load Replace kernel + initramfs ● Boot AMI instance ● mount system.img and data.img as loopback devices ● chroot to Android’s ramdisk.img - running Android’s /init ○ A N D R O I D ● Success! chroot Jail - AWS recipe
  • 43. ● The AOSP is hosted at http://source.android.com ● The Android-x86.org project is hosted at http://Android-X86.org ● The Android-IA project is hosted at https://01.org/android-ia ● Free AWS trial is available at http://aws.amazon.com/ ● Android on the cloud in the real world - http://www.nubosoftware.com ● Android on IA - ROM cooking tutorial - Ron Munitz, AnDevCon November, 2013 ● Introduction to Embedded Android course - by Ron Munitz. Taught at Afeka College of Engineering, Tel-Aviv, Israel ● Android Internals course - @thePSCG ● Android Customization course - @thePSCG References