summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD60
-rw-r--r--chipconfig.patch16
3 files changed, 96 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..9e87600c6269
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = qtools-git
+ pkgdesc = A toolset for reading/writing flash of Qualcomm chips
+ pkgver = latest
+ pkgrel = 1
+ url = https://github.com/forth32/qtools
+ arch = i686
+ arch = x86_64
+ license = LGPL3
+ makedepends = git
+ depends = readline
+ provides = qtools
+ conflicts = qtools
+ backup = etc/qtools/chipset.cfg
+ source = git+https://github.com/forth32/qtools.git
+ source = chipconfig.patch
+ sha256sums = SKIP
+ sha256sums = 618abb9acc929cdab9964a49254681bca07ffab088e283936501bfcdb5a881e4
+
+pkgname = qtools-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..70a972f7579f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,60 @@
+# Maintainer: Marat Moustafine <moustafine-@t-tuta-d.t-io>
+
+_pkgname=qtools
+pkgname=$_pkgname-git
+pkgver=latest
+pkgrel=1
+pkgdesc='A toolset for reading/writing flash of Qualcomm chips'
+arch=('i686' 'x86_64')
+url=https://github.com/forth32/$_pkgname
+license=('LGPL3')
+depends=('readline')
+makedepends=('git')
+provides=($_pkgname)
+conflicts=($_pkgname)
+backup=(etc/$_pkgname/chipset.cfg)
+source=(git+$url.git
+ chipconfig.patch)
+sha256sums=('SKIP'
+ '618abb9acc929cdab9964a49254681bca07ffab088e283936501bfcdb5a881e4')
+
+pkgver() {
+ cd $_pkgname
+ (
+ set -o pipefail
+ git describe --long --tags 2> /dev/null | sed -r 's/^[r|v]//;s/-/+/g' ||
+ printf '%s+%s' $(git rev-list --count HEAD) $(git rev-parse --short HEAD)
+ )
+}
+
+prepare() {
+ cd $_pkgname
+ patch -N -p 1 -i ../chipconfig.patch
+}
+
+build () {
+ cd $_pkgname
+ make all
+}
+
+package() {
+ cd $_pkgname
+ install -D -m 755 -t $pkgdir/usr/bin \
+ mibibsplit \
+ qbadblock \
+ qblinfo \
+ qcommand \
+ qdload \
+ qefs \
+ qflashparm \
+ qident \
+ qnvram \
+ qrflash \
+ qrmem \
+ qterminal \
+ qwdirect \
+ qwflash
+ install -D -m 644 -t $pkgdir/usr/lib/$_pkgname/loaders loaders/*.bin
+ install -D -m 644 -t $pkgdir/usr/share/doc/$_pkgname doc/*.odt
+ install -D -m 644 -t $pkgdir/etc/$_pkgname chipset.cfg
+}
diff --git a/chipconfig.patch b/chipconfig.patch
new file mode 100644
index 000000000000..91976e734ba7
--- /dev/null
+++ b/chipconfig.patch
@@ -0,0 +1,16 @@
+diff --git a/chipconfig.c b/chipconfig.c
+index aaa26c7..2d2342e 100644
+--- a/chipconfig.c
++++ b/chipconfig.c
+@@ -90,7 +90,10 @@ int msmidcount;
+ char vname[50];
+ char vval[100];
+
+-FILE* in=fopen("chipset.cfg","r");
++FILE* in=fopen("chipset.cfg","r");
++if (in == 0) {
++ in=fopen("/etc/qtools/chipset.cfg","r");
++}
+ if (in == 0) {
+ printf("\n! Файл конфигурации чипсетов chipset.cfg не найден\n");
+ return 0; // конфиг не найден