├── screenshots └── anbox-window.png └── README.md /screenshots/anbox-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FydeOS-ArcHero/chromium_os-archero-developer-guide/HEAD/screenshots/anbox-window.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chromium OS Archero Developer Guide 2 | 3 | This guide will walk you through the processing of replacing Chromium OS ARC++ with Anbox customized by FydeOS. Since Archero is still in an early stage of development, any contribution is welcome. If you have questions with this guide, just [file an issue](https://github.com/FydeOS-ArcHero/chromium_os-archero-developer-guide/issues/new). 4 | 5 | These related projects are the followings: 6 | 7 | - [anbox_fydeos](https://github.com/FydeOS-ArcHero/anbox_fydeos): fork of [anbox/anbox](https://github.com/anbox/anbox). 8 | - [anbox_platform_manifests](https://github.com/FydeOS-ArcHero/anbox_platform_manifests): fork of [anbox/platform_manifests](https://github.com/anbox/platform_manifests), Android manifest for building [AOSP](https://source.android.com/). 9 | - [chromiumos_anbox_manifest](https://github.com/FydeOS-ArcHero/chromiumos_anbox_manifest): fork of [chromiumos/manifest](https://chromium.googlesource.com/chromiumos/manifest/), Chromium OS manifest for building Chromium OS. 10 | - [overlay-amd64-anbox-generic](https://github.com/FydeOS-ArcHero/overlay-amd64-anbox-generic): board extended on `amd64-generic` with Anbox's dependencies. 11 | - [platform_frameworks_base](https://github.com/FydeOS-ArcHero/platform_frameworks_base): fork of [anbox/plaform_framework_base](https://github.com/FydeOS-ArcHero/platform_frameworks_base), base components of AOSP framework. 12 | - [project-archero](https://github.com/FydeOS-ArcHero/project-archero): solution to replace Google's ARC++ based on Anbox. 13 | 14 | ## 0. Hardware requirements 15 | 16 | We will use a server as an example because we need to download and build lots of code. 17 | 18 | - OS: Ubuntu 18.04 19 | - CPU: 4 cores 20 | - Memory: 32G 21 | - Disk: 500G 22 | 23 | ## 1. Build Anbox 24 | 25 | Firstly, check whether your JDK version is 1.8.x, if not, install JDK version 1.8: 26 | 27 | ```bash 28 | # Check JDK version 29 | $ java -version 30 | openjdk version "1.8.0_252" 31 | OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09) 32 | OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode) 33 | 34 | # If the version is already 1.8.x, just skip installing and switching JDK 35 | $ sudo apt update 36 | $ sudo apt-get install openjdk-8-jdk openjdk-8-jre 37 | 38 | # Select version 1.8 39 | $ sudo update-alternatives --config java 40 | ``` 41 | 42 | Next, ready to download and build Anbox: 43 | 44 | ```bash 45 | $ mkdir $HOME/anbox-work 46 | $ cd $HOME/anbox-work 47 | $ repo init -u https://github.com/FydeOS-ArcHero/anbox_platform_manifests.git -b anbox 48 | $ repo sync -j4 49 | $ . build/envsetup.sh 50 | $ lunch anbox_x86_64-userdebug 51 | $ make -j4 52 | ``` 53 | 54 | Start to build Android image: 55 | 56 | ```bash 57 | # These two packages are required 58 | $ sudo apt-get install -y attr squashfs-tools 59 | $ cd $HOME/anbox-work/vendor/anbox 60 | $ scripts/create-package.sh \ 61 | $PWD/../../out/target/product/x86_64/ramdisk.img \ 62 | $PWD/../../out/target/product/x86_64/system.img 63 | ``` 64 | 65 | When the script is done, there should be a file named `android.img` in the current directory. 66 | 67 | ## 2. Build Chromium OS 68 | 69 | Download Chromium OS source code: 70 | 71 | ```bash 72 | $ mkdir $HOME/chromiumos 73 | $ cd $HOME/chromiumos 74 | $ repo init -u https://github.com/FydeOS-ArcHero/chromiumos_anbox_manifest.git --repo-url https://chromium.googlesource.com/external/repo.git -b release-R83-13020.B 75 | $ repo sync -j4 76 | ``` 77 | 78 | Replace the Android image of Chromium OS with `android.img` which is generated in the last step: 79 | 80 | ```bash 81 | $ cd $HOME 82 | $ cp anbox-work/vendor/anbox/android.img chromiumos/src/overlays/project-archero/app-emulation/anbox/files/android_amd64.img 83 | $ cd chromiumos 84 | $ repo sync -j4 85 | ``` 86 | 87 | That's all for Chromium OS. 88 | 89 | ## 3. Build Chromium 90 | 91 | The works for building Chromium are more complicated and time-consuming (~3 hours or longer depending on the network and hardware). 92 | 93 | Firstly, get Chromium source code and its dependencies: 94 | 95 | ```bash 96 | $ mkdir ~/chromium && cd ~/chromium 97 | $ fetch --nohooks chromium 98 | ``` 99 | 100 | Next, edit `.gclient` located in `chromium` directory and add a line: 101 | 102 | ``` 103 | target_os = ['chromeos'] 104 | ``` 105 | 106 | Next, add branch to `anbox_chromium`: 107 | 108 | ``` 109 | $ cd src 110 | $ git remote add github https://github.com/FydeOS-ArcHero/anbox_chromium.git 111 | $ git fetch github 112 | $ git checkout -b anbox-83.0.4103.122 github/anbox-83.0.4103.122 113 | ``` 114 | 115 | Now `cros_sdk` is ready to build Chromium: 116 | 117 | ```bash 118 | $ cd $HOME 119 | $ ./chromiumos/chromite/bin/cros_sdk --nouse-image --chrome_root ./chromium 120 | ``` 121 | 122 | Finally, start to build Chromium and cross your fingers: 123 | 124 | ```bash 125 | (sdk)$ export BOARD=amd64-anbox-generic 126 | (sdk)$ setup_board --board=${BOARD} 127 | (sdk)$ CHROME_ORIGIN=LOCAL_SOURCE ./build_packages --board=${BOARD} --nowithautotest 128 | (sdk)$ ./build_image --board=${BOARD} --noenable_rootfs_verification --adjust_part="STATE:+4G" test 129 | # Start VM 130 | (sdk)$ cros_vm --start --qemu-args "-vnc :1 -machine pc-i440fx-2.3" --image-path /mnt/host/source/src/build/images/amd64-anbox-generic/latest/chromiumos_test_image.bin 131 | ``` 132 | 133 | ## 4. Viewing VM in VNC 134 | 135 | You can download [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) on your local dev machine and access **127.0.0.1:5901** to view VM. Note that "Options > Picture quality" needs to be set to **high** for this to work. 136 | 137 | After VM is connected successfully, you will see the welcome screen of Chromium OS. Connect to a network and log-in to the system. In several seconds, you will see the Android apps in the launcher. 138 | --------------------------------------------------------------------------------