community/android-tools to 29.0.3-2

This commit is contained in:
Kevin Mihelich 2019-09-19 04:36:09 +00:00
parent d17e624184
commit e23ba64b1e
3 changed files with 48 additions and 6 deletions

View file

@ -9,14 +9,15 @@ buildarch=28
pkgname=android-tools pkgname=android-tools
pkgver=29.0.3 pkgver=29.0.3
pkgrel=1 pkgrel=2
tag=platform-tools-$pkgver tag=platform-tools-$pkgver
pkgdesc='Android platform tools' pkgdesc='Android platform tools'
arch=(x86_64) arch=(x86_64)
url='http://tools.android.com/' url='http://tools.android.com/'
license=(Apache MIT) license=(Apache MIT)
depends=(pcre2 libusb) depends=(pcre2 libusb)
optdepends=('python: for mkbootimg script') optdepends=('python: for mkbootimg script'
'python2: for unpack_bootimg & avbtool scripts')
makedepends=(git clang gtest ruby cmake ninja go-pie) makedepends=(git clang gtest ruby cmake ninja go-pie)
provides=(fastboot adb) provides=(fastboot adb)
conflicts=(fastboot adb) conflicts=(fastboot adb)
@ -31,6 +32,7 @@ source=(git+https://android.googlesource.com/platform/system/core#tag=$tag
git+https://boringssl.googlesource.com/boringssl#commit=$_boringssl_commit git+https://boringssl.googlesource.com/boringssl#commit=$_boringssl_commit
generate_build.rb generate_build.rb
fix_build_core.patch fix_build_core.patch
fix_sparse_img.patch
bash_completion.fastboot) bash_completion.fastboot)
# Bash completion file was taken from https://github.com/mbrubeck/android-completion # Bash completion file was taken from https://github.com/mbrubeck/android-completion
sha1sums=('SKIP' sha1sums=('SKIP'
@ -42,14 +44,16 @@ sha1sums=('SKIP'
'SKIP' 'SKIP'
'SKIP' 'SKIP'
'afca7974ad8658e52fd028ead12ad0a959d63273' 'afca7974ad8658e52fd028ead12ad0a959d63273'
'e7f02cd6529dad54b4bdfd35e34b2cb9cb70cdd4' '6f3d6ca9112b0f2b3049febb46cf311ddc883567'
'2b57a4cf8012473c1a4fc6adae16573756272b02'
'7004dbd0c193668827174880de6f8434de8ceaee') '7004dbd0c193668827174880de6f8434de8ceaee')
prepare() { prepare() {
PLATFORM_TOOLS_VERSION="$pkgver" LDFLAGS='-Wl,-z,relro,-z,now' ./generate_build.rb > build.ninja PLATFORM_TOOLS_VERSION="$pkgver-$pkgrel" LDFLAGS='-Wl,-z,relro,-z,now' ./generate_build.rb > build.ninja
cd "$srcdir"/core cd "$srcdir"/core
patch -p1 < ../fix_build_core.patch patch -p1 < ../fix_build_core.patch
patch -p1 < ../fix_sparse_img.patch # FS#63370
cd "$srcdir"/avb cd "$srcdir"/avb
sed -i 's|/usr/bin/env python$|/usr/bin/env python2|g' avbtool sed -i 's|/usr/bin/env python$|/usr/bin/env python2|g' avbtool

View file

@ -16,7 +16,7 @@ index 24d4292d02..e4ad76b7c3 100644
return android::base::StringPrintf( return android::base::StringPrintf(
"Android Debug Bridge version %d.%d.%d\n" "Android Debug Bridge version %d.%d.%d\n"
- "Version %s-%s\n" - "Version %s-%s\n"
+ "Version %s-ArchLinux\n" + "Version %s\n"
"Installed as %s\n", "Installed as %s\n",
ADB_VERSION_MAJOR, ADB_VERSION_MINOR, ADB_SERVER_VERSION, ADB_VERSION_MAJOR, ADB_VERSION_MINOR, ADB_SERVER_VERSION,
- PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str(), - PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str(),
@ -71,7 +71,7 @@ index 8923f409df..d245a577ff 100644
setvbuf(stderr, nullptr, _IONBF, 0); setvbuf(stderr, nullptr, _IONBF, 0);
} else if (name == "version") { } else if (name == "version") {
- fprintf(stdout, "fastboot version %s-%s\n", PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str()); - fprintf(stdout, "fastboot version %s-%s\n", PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str());
+ fprintf(stdout, "fastboot version %s-ArchLinux\n", PLATFORM_TOOLS_VERSION); + fprintf(stdout, "fastboot version %s\n", PLATFORM_TOOLS_VERSION);
fprintf(stdout, "Installed as %s\n", android::base::GetExecutablePath().c_str()); fprintf(stdout, "Installed as %s\n", android::base::GetExecutablePath().c_str());
return 0; return 0;
#if !defined(_WIN32) #if !defined(_WIN32)

View file

@ -0,0 +1,38 @@
commit fbb9535aaea5ae4011f3c3edf4c00b27452f57ec
Author: Tom Cherry <tomcherry@google.com>
Date: Tue Sep 17 13:34:04 2019 -0700
fastboot: don't use sparse_file_import_auto() in load_buf_fd()
load_buf_fd() attempts to find the size of the file that it is about
to load by first calling sparse_file_import_auto() then using
sparse_file_len() upon success or falling back to the file size on the
filesystem on failure.
This is problematic however as sparse_file_import_auto() creates a
sparse_file out of the normal file, but does not resparse it, so an
assertion fails during the sparse_file_len() call.
This is fixed by using sparse_file_import() instead. This will fail
in the case that the file is not sparse and the call to
sparse_file_len() will be properly skipped.
Bug: 140538105
Test: flash blueline factory image with assertions enabled in
libsparse/sparse.cpp
Change-Id: I0283be33563a3301ce5b09bde41105a20f91086c
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 4737ae4d66..a7fc628c43 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -874,7 +874,7 @@ static bool load_buf_fd(int fd, struct fastboot_buffer* buf) {
return false;
}
- if (sparse_file* s = sparse_file_import_auto(fd, false, false)) {
+ if (sparse_file* s = sparse_file_import(fd, false, false)) {
buf->image_size = sparse_file_len(s, false, false);
sparse_file_destroy(s);
} else {