summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFranck Lucien Duriez2018-12-20 13:06:11 +0000
committerFranck Lucien Duriez2018-12-21 17:37:08 +0100
commite6ad0ee6e4e0d0d67ce024572389ed48283ee74f (patch)
tree06b36497bf646c9cc8706e38e71f5f348e03fde8
downloadaur-fastboot-arm64.tar.gz
First commit
-rw-r--r--.SRCINFO19
-rw-r--r--.gitignore3
-rw-r--r--Makefile48
-rw-r--r--PKGBUILD44
-rw-r--r--license.txt25
5 files changed, 139 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..62205258f5fc
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = fastboot-arm64
+ pkgdesc = fastboot for Raspberry 3
+ pkgver = 5.1.1
+ pkgrel = 1
+ url = http://developer.android.com/sdk/index.html
+ arch = aarch64
+ license = custom
+ depends = zlib
+ depends = ncurses
+ depends = repo
+ provides = fastboot
+ conflicts = fastboot
+ source = license.txt
+ source = Makefile
+ sha1sums = SKIP
+ sha1sums = SKIP
+
+pkgname = fastboot-arm64
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..cef2199b822a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+src/
+pkg/
+*.tar.xz
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..41fc12b40d20
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,48 @@
+# standalone Makefile for adb
+# found on: https://hev.cc/2272.html
+
+SRCS+= protocol.c engine.c util.c fs.c bootimg.c fastboot.c usb_linux.c util_linux.c
+SRCS+= $(filter-out ../libsparse/simg2simg.c ../libsparse/img2simg.c ../libsparse/simg2img.c ../libsparse/append2simg.c, $(wildcard ../libsparse/*.c))
+SRCS+= $(filter-out ../libzipfile/test_zipfile.c, $(wildcard ../libzipfile/*.c))
+SRCS+= $(filter-out ../../extras/ext4_utils/make_ext4fs_main.c ./../extras/ext4_utils/ext4fixup_main.c ../../extras/ext4_utils/setup_fs.c ../../extras/ext4_utils/ext4fixup_main.c ../../extras/ext4_utils/ext2simg.c, $(wildcard ../../extras/ext4_utils/*.c))
+SRCS+= $(wildcard ../../../external/zlib/src/*.c)
+SRCS+= $(filter-out ../../../external/pcre/dist/pcretest.c ../../../external/pcre/dist/dftables.c ../../../external/pcre/dist/pcre_jit_test.c ../../../external/pcre/dist/pcregrep.c ../../../external/pcre/dist/pcredemo.c, $(wildcard ../../../external/pcre/dist/*.c))
+SRCS+= $(wildcard ../../../external/pcre/*.c)
+SRCS+= $(filter-out ../../../external/libselinux/src/android.c, $(wildcard ../../../external/libselinux/src/*.c))
+
+#$(info $(SRCS))
+
+CFLAGS+= -DADB_HOST=1
+CFLAGS+= -DHAVE_FORKEXEC=1
+CFLAGS+= -DHAVE_SYMLINKS
+CFLAGS+= -DHAVE_TERMIO_H
+CFLAGS+= -D_GNU_SOURCE
+CFLAGS+= -D_XOPEN_SOURCE
+CFLAGS+= -I.
+CFLAGS+= -I../include
+CFLAGS+= -I../mkbootimg
+CFLAGS+= -I../libsparse/include -I../../extras/ext4_utils -I../../extras/f2fs_utils
+CFLAGS+= -I../../../external/zlib -I../../../external/libselinux/include -I../../../external/pcre -I../../../external/pcre/dist
+
+# so well, let's fake HAVE_OFF64_T, because Raspbian does not.
+# just stay away from files larger than 2GB, ok?
+CFLAGS+= -O2 -g -Wno-unused-parameter -DHAVE_OFF64_T -DHAVE_CONFIG_H -DSUPPORT_PCRE8 -DHOST
+
+LIBS= -lcrypto -lpthread -lrt
+
+TOOLCHAIN= /usr/bin/
+CC= $(TOOLCHAIN)gcc
+LD= $(TOOLCHAIN)gcc
+
+OBJS= $(SRCS:.c=.o)
+
+%.o: %.c
+ $(CC) -c -o $@ $< $(CFLAGS)
+
+all: fastboot
+
+fastboot: $(OBJS)
+ $(LD) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
+
+clean:
+ rm -rf $(OBJS)
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9b94764baac2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Franck Lucien Duriez <franck.lucien.duriez@gmail.com>
+
+pkgname=fastboot-arm64
+pkgver=5.1.1
+pkgrel=1
+pkgdesc='fastboot for Raspberry 3'
+arch=('aarch64')
+url='http://developer.android.com/sdk/index.html'
+license=('custom')
+depends=('zlib' 'ncurses' 'repo')
+provides=('fastboot')
+conflicts=('fastboot')
+source=("license.txt"
+ "Makefile")
+sha1sums=('SKIP'
+ 'SKIP')
+
+_branch='android-5.1.1_r9'
+
+build() {
+ mkdir -p system external
+ test -d system/core || \
+ git clone -b "$_branch" https://android.googlesource.com/platform/system/core system/core
+ test -d external/zlib || \
+ git clone -b "$_branch" https://android.googlesource.com/platform/external/zlib external/zlib
+ test -d system/extras || \
+ git clone -b "$_branch" https://android.googlesource.com/platform/system/extras system/extras
+ test -d external/libselinux || \
+ git clone -b "$_branch" https://android.googlesource.com/platform/external/libselinux external/libselinux
+ test -d external/pcre || \
+ git clone -b "$_branch" https://android.googlesource.com/platform/external/pcre external/pcre
+ grep --quiet '#include <sys/sysmacros.h>' 'system/core/fastboot/usb_linux.c' || \
+ sed -i '1s|^|#include <sys/sysmacros.h>\n|' 'system/core/fastboot/usb_linux.c'
+ sed -i 's|extern char \*sys_errlist|extern char const *const sys_errlist|' 'external/pcre/dist/pcregrep.c'
+ cp Makefile system/core/fastboot/Makefile
+ cd system/core/fastboot
+ make
+}
+
+package() {
+ install -Dm644 "${srcdir}/license.txt" "${pkgdir}/usr/share/licenses/${pkgname}/license.txt"
+ install -d "${pkgdir}/etc/profile.d"
+ install -Dm755 "${srcdir}/system/core/fastboot/fastboot" "${pkgdir}/usr/bin/fastboot"
+}
diff --git a/license.txt b/license.txt
new file mode 100644
index 000000000000..e994f57108a9
--- /dev/null
+++ b/license.txt
@@ -0,0 +1,25 @@
+Copyright (C) 2018 The Android Open Source Project
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.