{"id":315,"date":"2022-04-25T19:44:51","date_gmt":"2022-04-25T17:44:51","guid":{"rendered":"https:\/\/threedots.ovh\/blog\/?p=315"},"modified":"2022-05-06T14:41:42","modified_gmt":"2022-05-06T12:41:42","slug":"standards-on-arm-platforms-for-os-support-android","status":"publish","type":"post","link":"https:\/\/threedots.ovh\/blog\/2022\/04\/standards-on-arm-platforms-for-os-support-android\/","title":{"rendered":"Standards on Arm platforms for OS support &#8211; Android"},"content":{"rendered":"\n<p>Android is the most popular operating system in the world, rolled out on billions of devices. What is the level of flexibility allowed across across the platform allowing third-party <em>distributions<\/em> of Android to exist?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Bootloader<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Bootloader security<\/h3>\n\n\n\n<p>On a lot of Android devices, boot loader security can be disabled. This is essential to be able to load third-party system software. <\/p>\n\n\n\n<p>However, on some devices (and carriers), this is not the case. Those devices should be avoided if you plan on running third-party OSes.<\/p>\n\n\n\n<p>On Android devices, a notice on each boot is displayed when running with third-party system software. Changing Secure Boot state involves a full data wipe.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Custom keys<\/h3>\n\n\n\n<p>Some devices also allow using AVB custom keys, to allow having <em>both<\/em> a locked bootloader and custom OSes, retaining the security infrastructure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Partition layouts and kernel image format<\/h3>\n\n\n\n<p>The partition names are standardised across the ecosystem. The kernel image format is, too. Newer devices can have dynamic partitioning for even more flexibility.<\/p>\n\n\n\n<p>On Qualcomm devices, the Android boot application is running under a UEFI TianoCore-based environment.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Flashing infrastructure<\/h3>\n\n\n\n<p>Android has a standard (re)flashing infrastructure implemented across the ecosystem, called <em>fastboot<\/em>. This allows installation instructions for custom operating systems to be identical across a wide variety of devices. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Kernel<\/h2>\n\n\n\n<p>For devices shipping with <em>Android 11<\/em> and kernel version 5.4, compatibility with the <em><a rel=\"noreferrer noopener\" href=\"https:\/\/source.android.com\/devices\/architecture\/kernel\/generic-kernel-image\" target=\"_blank\">Generic Kernel Image<\/a><\/em> is mandatory and is part of the certification process. However, the manufacturer can still choose to ship their own product kernel in that scenario.<\/p>\n\n\n\n<p>Since devices first shipped with <em>Android 12<\/em> and kernel version 5.10 or later, the kernel images used on-device are always Google-certified <em>Generic Kernel Images<\/em>.<\/p>\n\n\n\n<p>Those branches as such have a stable <em>kernel module ABI<\/em>, allowing as such to update the kernel independently from the kernel-mode drivers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Generic System Image<\/h2>\n\n\n\n<p>With devices shipping with <em>Android 9<\/em> or later, a <em><a href=\"https:\/\/source.android.com\/setup\/build\/gsi\" target=\"_blank\" rel=\"noreferrer noopener\">Generic System Image<\/a><\/em> containing Android is guaranteed to run. <\/p>\n\n\n\n<p>The drivers are in separate partitions with a stable ABI being guaranteed between Android and those vendor partitions.<\/p>\n\n\n\n<p>Google does <a rel=\"noreferrer noopener\" href=\"https:\/\/developer.android.com\/topic\/generic-system-image\/releases\" target=\"_blank\">distribute<\/a> development GSIs to app developers with the Play Store present. The flashing instructions are <a rel=\"noreferrer noopener\" href=\"https:\/\/source.android.com\/setup\/build\/gsi#flashing-gsis\" target=\"_blank\">broadly<\/a> similar between devices.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Updates for 3rd-party system software<\/h2>\n\n\n\n<p>Vendor partitions are device dependent and aren&#8217;t distributed through a standard update infrastructure. <\/p>\n\n\n\n<p>This means that if you use a third-party system software distribution with <em>Generic System Images<\/em>, you&#8217;ll have to handle driver updates (both kernel and user-mode) yourself to maintain product security guarantees.<\/p>\n\n\n\n<p>However, even using an old driver set, you&#8217;ll still be able to <em>run <\/em>more recent releases of Android.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Non-Android Linux<\/h2>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/halium\" target=\"_blank\">Halium<\/a> is a project that aims to have non-Android Linux distributions working on modern Android devices. <\/p>\n\n\n\n<p>The <a rel=\"noreferrer noopener\" href=\"https:\/\/ubuntu-touch.io\" target=\"_blank\">Ubuntu Touch<\/a> project uses Halium to run on a wide variety of devices, <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.ubports.com\/en\/latest\/porting\/introduction\/Intro.html\" target=\"_blank\">leveraging<\/a> the GSI infrastructure. Those Halium GSIs are available on the <a rel=\"noreferrer noopener\" href=\"https:\/\/ci.ubports.com\/blue\/organizations\/jenkins\/UBportsCommunityPortsJenkinsCI%2Fubports%252Fcommunity-ports%252Fjenkins-ci%252Fgeneric_arm64\/activity\" target=\"_blank\">UBports CI<\/a>. <\/p>\n\n\n\n<p>For that project, a custom kernel build is currently used to enable kernel features that Android doesn&#8217;t use. Apart from that, the OS is identical across the whole set of devices.<\/p>\n\n\n\n<p>However, Halium currently uses an Android 11 base. As such, it doesn&#8217;t have compatibility with devices launched with Android 12 yet. <\/p>\n\n\n\n<p>In the future, a <em>Generic Kernel Image<\/em> + <em>Generic System Image<\/em> combination will allow to have non-Android Linux distributions that function without any device specific work on a wide variety of devices.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hardware virtualisation<\/h2>\n\n\n\n<p>A lot of MediaTek devices shipping with Android ship with hypervisor support usable by Linux.<\/p>\n\n\n\n<p>For Google Tensor, this support isn&#8217;t present in the currently shipped software. It&#8217;s however part of the Android 13 Developer Preview.<\/p>\n\n\n\n<p>For Qualcomm devices, QHEE, Qualcomm&#8217;s own hypervisor, is currently present. This means that virtualisation isn&#8217;t currently accessible by Linux on those devices.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Non-Linux based operating systems (or mainline Linux without Android driver use)<\/h2>\n\n\n\n<p>If you can, go the virtualisation route. If you cannot, then device specific images will have to be used. You&#8217;ll have to provide your own driver sets instead of being able to use the vendor partitions present on the device.<\/p>\n\n\n\n<p>A flattened device tree is given by the bootloader to describe devices on the platform. To boot an operating system using ACPI, shipping ACPI tables is needed.<\/p>\n\n\n\n<p>To boot Windows, you can wrap a UEFI firmware to make it loadable as an OS kernel from the perspective of the Android boot application. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android is the most popular operating system in the world, rolled out on billions of devices. What is the level of flexibility allowed across across the platform allowing third-party distributions of Android to exist? Bootloader Bootloader security On a lot of Android devices, boot loader security can be disabled. This is essential to be able&hellip;&nbsp;<a href=\"https:\/\/threedots.ovh\/blog\/2022\/04\/standards-on-arm-platforms-for-os-support-android\/\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Standards on Arm platforms for OS support &#8211; Android<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-315","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/posts\/315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/comments?post=315"}],"version-history":[{"count":16,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/posts\/315\/revisions"}],"predecessor-version":[{"id":402,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/posts\/315\/revisions\/402"}],"wp:attachment":[{"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/media?parent=315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/categories?post=315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/tags?post=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}