Skip to content

Commit

Permalink
Merge pull request android-rpi#3 from ric96/aosp-7.0
Browse files Browse the repository at this point in the history
added support for x86 in gapps script
  • Loading branch information
ikalkov authored Sep 3, 2016
2 parents 0ac6c19 + d828904 commit 1d04f59
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions scripts/gapps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
#

TIMESTAMP="20160827"
PACKAGE="open_gapps-arm-7.0-pico-$TIMESTAMP.zip"
PACKAGE=""

SHOW_HELP=false
ADB_ADDRESS=""

ARCHITECTURE="none"

# ------------------------------------------------
# Helping functions
# ------------------------------------------------
Expand All @@ -36,10 +38,11 @@ show_help()
{
cat << EOF
USAGE:
$0 [-h] -a IP
$0 [-h] -i IP -a ARCH
OPTIONS:
-a Architecture of the device [x86] [x86_64] [arm] [arm64]
-h Show help
-a IP address for ADB
-i IP address for ADB
EOF
}

Expand Down Expand Up @@ -96,7 +99,7 @@ prepare_gapps()
if [ ! -d "gapps/pkg" ]; then
echo " * Downloading OpenGApps package..."
echo ""
wget https://github.com/opengapps/arm/releases/download/$TIMESTAMP/$PACKAGE -O gapps/$PACKAGE
wget https://github.com/opengapps/$ARCHITECTURE/releases/download/$TIMESTAMP/$PACKAGE -O gapps/$PACKAGE
fi

if [ ! -f "gapps/$PACKAGE" ]; then
Expand Down Expand Up @@ -164,9 +167,10 @@ install_package()
# ------------------------------------------------

# save the passed options
while getopts ":a:h" flag; do
while getopts ":i:a:h" flag; do
case $flag in
"a") ADB_ADDRESS="$OPTARG" ;;
"i") ADB_ADDRESS="$OPTARG" ;;
"a") ARCHITECTURE="$OPTARG" ;;
"h") SHOW_HELP=true ;;
*)
echo ""
Expand All @@ -177,12 +181,19 @@ case $flag in
esac
done

if [ "$ARCHITECTURE" != "x86" -a "$ARCHITECTURE" != "x86_64" -a "$ARCHITECTURE" != "arm" -a "$ARCHITECTURE" != "arm64" ]; then
echo "wrong arch $ARCHITECTURE";
show_help
exit 1
fi

if [[ "$SHOW_HELP" = true ]]; then
show_help
exit 1
fi

echo "GApps installation script for RPi"
PACKAGE="open_gapps-$ARCHITECTURE-7.0-pico-$TIMESTAMP.zip"
echo "GApps installation script for RPi/x86"
echo "Used package: $PACKAGE"
echo "ADB IP address: $ADB_ADDRESS"
echo ""
Expand Down

0 comments on commit 1d04f59

Please sign in to comment.