[dtbTool] Fix version detection and find dtb in subfolders (#1057)

Fixes #1055.
This commit is contained in:
drebrez 2017-12-30 20:00:48 +01:00 committed by Oliver Smith
parent d1c97617d6
commit 1c71d748f5
3 changed files with 62 additions and 4 deletions

View file

@ -0,0 +1,13 @@
diff --git a/dtbTool b/dtbTool
index b11402d..2dcdd87 100755
--- a/dtbTool
+++ b/dtbTool
@@ -353,7 +353,7 @@ def generate_records(f, pagesize):
board_id = fdt_get_property_int(blob, 0, "qcom,board-id")
pmic_id = fdt_get_property_int(blob, 0, "qcom,pmic-id")
- if board_id:
+ if board_id and msm_id:
x = iter(board_id)
board_id = list(zip(x, x))
x = iter(msm_id)

View file

@ -0,0 +1,33 @@
diff --git a/dtbTool b/dtbTool
index 2dcdd87..0c14a94 100644
--- a/dtbTool
+++ b/dtbTool
@@ -408,6 +408,16 @@ def write_padding(f, pagesize):
if count != pagesize:
output.write(b"".join([b'\x00' for x in range(count)]))
+def find_dtb(indir):
+ flist = list()
+ for f in os.listdir(indir):
+ ff = os.path.join(indir, f)
+ if os.path.isfile(ff) and ff.endswith('.dtb'):
+ flist.append(ff)
+ elif os.path.isdir(ff):
+ flist.extend(find_dtb(ff))
+ return flist
+
if __name__ == "__main__":
usage = ("""%prog -o <output file> <input DTB directory> [options]""")
parser = OptionParser(usage=usage)
@@ -434,10 +444,7 @@ if __name__ == "__main__":
pagesize = options.pagesize
indir = args[0]
- flist = [os.path.join(indir, f)
- for f in os.listdir(indir)
- if os.path.isfile(os.path.join(indir, f)) and
- f.endswith('.dtb')]
+ flist = find_dtb(indir)
records = []
for f in flist:

View file

@ -1,17 +1,29 @@
pkgname=dtbtool pkgname=dtbtool
pkgver=1.6.0 pkgver=1.6.0
pkgrel=0 pkgrel=1
pkgdesc="skales dtbtool" pkgdesc="skales dtbtool"
url="https://source.codeaurora.org/quic/kernel/skales/plain/dtbTool" url="https://source.codeaurora.org/quic/kernel/skales/plain/dtbTool"
arch="all" arch="all"
license="BSD-2" license="BSD-2"
source="dtbTool::https://source.codeaurora.org/quic/kernel/skales/plain/dtbTool?id=${pkgver}" source="
dtbTool::https://source.codeaurora.org/quic/kernel/skales/plain/dtbTool?id=${pkgver}
00_fix_version_detection.patch
01_find_dtb_in_subfolders.patch
"
options="!check" options="!check"
depends="dtc-dev python" depends="dtc-dev python"
builddir="$srcdir/build"
prepare() {
mkdir "$builddir"
cp "$srcdir"/dtbTool "$builddir"/dtbTool
default_prepare
}
package() { package() {
install -D -m755 "$srcdir"/dtbTool \ install -D -m755 "$builddir"/dtbTool \
"$pkgdir"/usr/bin/dtbTool "$pkgdir"/usr/bin/dtbTool
} }
sha512sums="77ad411ff482896919d971c5ef15817a5bee837d5a8827fd4a0449e7a99b8759e3ca2fe3f233b4a3a92c8e386e0457191d8d18755dba842224f5cc64ddb89024 dtbTool" sha512sums="77ad411ff482896919d971c5ef15817a5bee837d5a8827fd4a0449e7a99b8759e3ca2fe3f233b4a3a92c8e386e0457191d8d18755dba842224f5cc64ddb89024 dtbTool
3ad31e31a883a1773652149e6e2a7d0225422b3c7576ec58d6bb2db28187096712d24684b3e58f26dec72889c0200d60b763e985a1f6ff60edcb1fe05ab58353 00_fix_version_detection.patch
5d88faa1b714d6c0facb959c85fe639a82debd178f127d83f339b5feffd5925498c06fe5247d1ff6280582498bd83ddc0564d4d64c365e39b83fbaa5d19b0b41 01_find_dtb_in_subfolders.patch"