-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #320 from samueldr-wip/feature/android-flashable-zip
android: Add flashable zip output
- Loading branch information
Showing
40 changed files
with
943 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 48 additions & 9 deletions
57
modules/system-types/android/device-notes.fastboot.adoc.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,62 @@ | ||
== Building | ||
== Building and installing | ||
|
||
This will build the default output for your _<%= info["fullName"] %>_. | ||
There are multiple installation methods for your _<%= info["fullName"] %>_. | ||
They all rely on flashing one or more partitions on your device. | ||
|
||
$ nix-build --argstr device <%= info["identifier"] %> -A build.default | ||
[WARNING] | ||
==== | ||
*All installation methods can lead to data loss.* | ||
|
||
== Installation | ||
Flashing a partition *will erase everything on the partition*. Additionally, | ||
the common backups methods, e.g. TWRP, will *not* backup the `userdata` | ||
partition, which may be the installation target. | ||
|
||
Make backups. | ||
==== | ||
|
||
=== Using Fastboot | ||
|
||
This will produce a folder with a flashing script, and the partition images for | ||
your _<%= info["fullName"] %>_. | ||
|
||
$ nix-build --argstr device <%= info["identifier"] %> -A build.android-fastboot-images | ||
|
||
Alternatively, you can build a specific partition image: | ||
|
||
$ nix-build --argstr device <%= info["identifier"] %> -A build.android-bootimg | ||
$ nix-build --argstr device <%= info["identifier"] %> -A build.rootfs | ||
|
||
The device will need to be booted in its bootloader, or `fastboot`, mode. | ||
The boot image can be installed using the following command, assuming it was | ||
built using the previous command. | ||
|
||
The boot images can be installed using the following command, assuming the | ||
`android-fastboot-images` output was used. | ||
|
||
$ result/flash-critical.sh | ||
|
||
If you have a system image (`system.img`) built, you can use `fastboot` to | ||
flash it to the device. Note that it might be too big to fit over the `system` | ||
partition. In such case, it can be flashed on the `userdata` partition. | ||
|
||
WARNING: *This will erase everything on the partition*. Additionally, the | ||
common backups methods, e.g. TWRP, will *not* backup the `userdata` partition. | ||
|
||
$ fastboot flash userdata system.img | ||
|
||
=== Using a flashable zip | ||
|
||
An alternative installation method is to use a flashable zip. The flashable zip | ||
can be built for your _<%= info["fullName"] %>_ using one of the following | ||
commands: | ||
|
||
$ nix-build --argstr device <%= info["identifier"] %>-A build.android-flashable-bootimg | ||
$ nix-build --argstr device <%= info["identifier"] %>-A build.android-flashable-system | ||
$ nix-build --argstr device <%= info["identifier"] %>-A build.android-flashable-zip | ||
|
||
The first two will flash only a specific partition. The last one contains the | ||
partitions of the two previous one. | ||
|
||
The zip can either be copied to the device and selected in a compatible | ||
Android recovery, or sent to the device through `adb sideload`. | ||
|
||
$ adb sideload /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-flashable-<%= info["identifier"] %>-boot.zip | ||
|
||
By default it will flash to the `system` partition. Some configurations may | ||
change this to flash to the `userdata` partition. In that case, *no warning is | ||
given before flashing*. |
Oops, something went wrong.