Commit d6f797ab authored by Antoine Fontaine's avatar Antoine Fontaine
Browse files

snap: fix and document usage of a locally build anbox image

No related merge requests found
Showing with 15 additions and 8 deletions
+15 -8
......@@ -3,7 +3,6 @@ parts/
stage/
prime/
snap/.snapcraft
android-images/
*.snap
CMakeLists.txt.user
*.o
......
......@@ -137,8 +137,8 @@ If you want to build the anbox snap instead you can do this with the following
steps:
```
$ mkdir android-images
$ cp /path/to/android.img android-images/android.img
$ ARCH=$(uname -m)
$ cp /path/to/android.img data/android-images/android-$ARCH.img
$ snapcraft
```
......
android-*
You can put your own android images here. They will be used
when building the snap.
You should name your images `android-$(arch).img`. For example
`android-x86_64.img` or `android-aarch64.img`.
......@@ -95,18 +95,20 @@ parts:
build-packages:
- wget
override-build: |
LOCAL_IMAGE=$SNAPCRAFT_PART_INSTALL/../../../android-images/android.img
ARCH=$(uname -m)
LOCAL_IMAGE="$SNAPCRAFT_PART_SRC/android-images/android-$ARCH.img"
if [ -f $LOCAL_IMAGE ]; then
if [ -f "$LOCAL_IMAGE" ]; then
echo "Using local image $LOCAL_IMAGE"
cp $LOCAL_IMAGE $SNAPCRAFT_PART_INSTALL/android.img
cp "$LOCAL_IMAGE" "$SNAPCRAFT_PART_INSTALL"/android.img
else
echo "android image 'data/android-images/android-$ARCH.img'" \
"not found, downloading one\n\n"
IMAGE_PATH=
IMAGE_NAME=
ARCH=$(uname -m)
case "$ARCH" in
x86_64)
......@@ -115,7 +117,7 @@ parts:
IMAGE_HASH="6b04cd33d157814deaf92dccf8a23da4dc00b05ca6ce982a03830381896a8cca"
;;
*)
echo "ERROR: Unknown architecture $ARCH"
echo "ERROR: Anbox upstream doesn't provide an image for $ARCH"
exit 1
;;
esac
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment