Compare commits

...

3 Commits

Author SHA1 Message Date
Andrew Gunnerson e105efb6d3 Version 3.2.3
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-06-14 18:26:14 -04:00
Andrew Gunnerson 2a7df104ed CHANGELOG.md: Add entry for PR #304
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-06-14 18:17:06 -04:00
Andrew Gunnerson 8e52a9cf8c Add support for cross-compiling to Android
The precompiled binaries are compiled for aarch64 API 31, which should
work for every device that avbroot supports.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-06-14 17:49:15 -04:00
5 changed files with 55 additions and 9 deletions
+35 -4
View File
@@ -19,6 +19,7 @@ jobs:
# https://github.com/rust-lang/rust/issues/78210
RUSTFLAGS: -C strip=symbols -C target-feature=+crt-static
TARGETS: ${{ join(matrix.artifact.targets, ' ') || matrix.artifact.name }}
ANDROID_API: ${{ matrix.artifact.android_api }}
strategy:
fail-fast: false
matrix:
@@ -33,6 +34,12 @@ jobs:
- aarch64-apple-darwin
- x86_64-apple-darwin
combine: lipo
# ubuntu-latest is not 24.04 yet and 22.04's qemu-user-static segfaults.
- os: ubuntu-24.04
name: aarch64-linux-android31
targets:
- aarch64-linux-android
android_api: '31'
steps:
- name: Check out repository
uses: actions/checkout@v4
@@ -40,6 +47,26 @@ jobs:
# For git describe
fetch-depth: 0
- name: Install qemu-user-static
if: ${{ contains(matrix.artifact.name, 'android') }}
shell: bash
run: |
sudo apt-get -y update
sudo apt-get -y install qemu-user-static
- name: Set Android temporary directory
if: ${{ contains(matrix.artifact.name, 'android') }}
shell: bash
run: |
echo "TMPDIR=/tmp" >> "${GITHUB_ENV}"
- name: Install cargo-android
shell: bash
run: |
cargo install \
--git https://github.com/chenxiaolong/cargo-android \
--tag v0.1.1
- name: Get version
id: get_version
shell: bash
@@ -63,7 +90,8 @@ jobs:
shell: bash
run: |
for target in ${TARGETS}; do
cargo clippy --release --workspace --features static \
cargo android \
clippy --release --workspace --features static \
--target "${target}"
done
@@ -71,7 +99,8 @@ jobs:
shell: bash
run: |
for target in ${TARGETS}; do
cargo build --release --workspace --features static \
cargo android \
build --release --workspace --features static \
--target "${target}"
done
@@ -79,7 +108,8 @@ jobs:
shell: bash
run: |
for target in ${TARGETS}; do
cargo test --release --workspace --features static \
cargo android \
test --release --workspace --features static \
--target "${target}"
done
@@ -87,7 +117,8 @@ jobs:
shell: bash
run: |
for target in ${TARGETS}; do
cargo run --release -p e2e --features static \
cargo android \
run --release -p e2e --features static \
--target "${target}" \
-- test -a -c e2e/e2e.toml
done
+5
View File
@@ -7,6 +7,10 @@
to update the actual links at the bottom of the file.
-->
### Version 3.2.3
* Add prebuilt binary for Android (aarch64) ([PR #304])
### Version 3.2.2
* Add new `--recompute-size` option to `avbroot avb pack` to automatically recompute the image size for resizable images ([Discussion #294], [PR #296])
@@ -295,3 +299,4 @@ Behind-the-scenes changes:
[PR #293]: https://github.com/chenxiaolong/avbroot/pull/293
[PR #296]: https://github.com/chenxiaolong/avbroot/pull/296
[PR #297]: https://github.com/chenxiaolong/avbroot/pull/297
[PR #304]: https://github.com/chenxiaolong/avbroot/pull/304
Generated
+4 -4
View File
@@ -109,7 +109,7 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
[[package]]
name = "avbroot"
version = "3.2.2"
version = "3.2.3"
dependencies = [
"anyhow",
"assert_matches",
@@ -534,7 +534,7 @@ dependencies = [
[[package]]
name = "e2e"
version = "3.2.2"
version = "3.2.3"
dependencies = [
"anyhow",
"avbroot",
@@ -628,7 +628,7 @@ dependencies = [
[[package]]
name = "fuzz"
version = "3.2.2"
version = "3.2.3"
dependencies = [
"avbroot",
"honggfuzz",
@@ -2068,7 +2068,7 @@ dependencies = [
[[package]]
name = "xtask"
version = "3.2.2"
version = "3.2.3"
dependencies = [
"anyhow",
"clap",
+1 -1
View File
@@ -4,7 +4,7 @@ members = ["avbroot", "e2e", "fuzz", "xtask"]
resolver = "2"
[workspace.package]
version = "3.2.2"
version = "3.2.3"
license = "GPL-3.0-only"
edition = "2021"
repository = "https://github.com/chenxiaolong/avbroot"
+10
View File
@@ -440,6 +440,16 @@ Debug builds work too, but they will run significantly slower (in the sha256 com
By default, the executable links to the system's bzip2 and liblzma libraries, which are the only external libraries avbroot depends on. To compile and statically link these two libraries, pass in `--features static`.
### Android cross-compilation
To cross-compile for Android, install [cargo-android](https://github.com/chenxiaolong/cargo-android) and use the `cargo android` wrapper. To make a release build for aarch64, run:
```bash
cargo android build --release --target aarch64-linux-android
```
It is possible to run the tests if the host is running Linux, qemu-user-static is installed, and the executable is built with `RUSTFLAGS=-C target-feature=+crt-static` and `--features static`.
## Verifying digital signatures
First, save the public key to a file listing the keys to be trusted. This is the same key listed in [the author's profile](https://github.com/chenxiaolong/).