If you decide to compile AsteroidOS from source be aware that it’s a simple process but the first build might take you a lot of time. Report any problem to the issues tracker:
Start by cloning the main repository using the following command:
git clone https://github.com/AsteroidOS/asteroid.git cd asteroid/
This repository only contains a shell script that populates src/ with OpenEmbedded and the appropriate layers. Then, it setups the environment for a bitbake build. This command will setup a build for dory, the LG G Watch, but you can also build an image for bass, the LG G Watch Urbane, sparrow, the Asus Zenwatch 2 and tetra the Sony Smartwatch 3.
. ./prepare-build.sh dory # Be careful that this script must be sourced and not only ran.
Now that the environment is correctly setup, you should be in the build directory. You can now ‘bake’ your asteroid system. Make sure you have the following build dependencies:
git build-essential diffstat gawk chrpath texinfo
And then you can run:
After a while, the generated image should be available in build/tmp-glibc/deploy/images/dory/.
Note: On most watches, the Android Wear settings can be opened without first coupling the device with a phone by holding the power button on the back or on the side.
In order to use AsteroidOS, your watch’s bootloader needs to be unlocked. It can be unlocked by rebooting into bootloader mode and unlocking it. To reboot your watch to bootloader mode, you need to enable ADB/Android Debugging in Android’s settings. ADB Debugging is normally listed under Developer options, which may need to be enabled by tapping Build number in the About page several times. If adb doesn’t recognize your device and you are sure you have enabled ADB Debugging in Developer options, use this guide and unplug and replug your watch.
adb reboot bootloader fastboot oem unlock # Accept the notice message
Unlocking the bootloader will perform a factory reset, so you must reboot into Android Wear and re-enable developer mode and adb debugging.
You can now decide if you want to try the built image without removing your Android Wear system or if you want to install Asteroid definitely.
- “Dual-boot” (Only stores the rootfs in a loop file of the internal sdcard and requires an USB connection to boot Asteroid)
Send the build (which may take several minutes):
adb push -p build/tmp-glibc/deploy/images/dory/asteroid-image-dory.ext4 /sdcard/asteroidos.ext4
Boot the build via fastboot (which you must do each time you want to boot into Asteroid instead of Android Wear):
adb reboot bootloader fastboot boot build/tmp-glibc/deploy/images/dory/zImage-dtb-dory.fastboot
- Real AsteroidOS Installation (replaces the userdata and boot partitions)
Reboot into bootloader mode and flash the required partitions with:
adb reboot bootloader fastboot flash userdata build/tmp-glibc/deploy/images/dory/asteroid-image-dory.ext4 fastboot flash boot build/tmp-glibc/deploy/images/dory/zImage-dtb-dory.fastboot
Enjoy! Note that when AsteroidOS is up and running you should be able to run adb shell from your computer to get a remote root shell.