summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: e995676d982fb3e34b05d95c115acc2a5358c3ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Maintainer (Manjaro): Dan Johansen <strit@manjaro.org>
# Contributor (Manjaro): Spikerguy <tech@fkardame.com>
# Contributor (Manjaro): Kevin Mihelich 
# Contributor (Manjaro): Adam <adam900710@gmail.com>

# # I maintain this because:
# Not in an official repo and I use it
# Manjaro version fails to build

pkgname=uboot-pinebookpro
pkgver=2017.09
pkgrel=2
pkgdesc="U-Boot for Pinebook Pro - MrFixit2001's source tree"
#arch=('aarch64')
arch=('x86_64')
url='http://www.denx.de/wiki/U-Boot/WebHome'
license=('GPL')
backup=('boot/boot.txt' 'boot/boot.scr')
depends=('uboot-tools')
makedepends=('bc' 'git' 'rockchip-tools' 'python' 'dtc')
install=${pkgname}.install
_commit_rkbin=0d4740f2c0c897ebc1a074580376689b8454ddd8
_commit_uboot=183e247f9022f934a2224ce71f3030447068c32c
source=("git+https://github.com/mrfixit2001/rockchip-u-boot.git#commit=$_commit_uboot"
        "git+https://github.com/rockchip-linux/rkbin.git#commit=$_commit_rkbin"
        "0001-nvme-support.patch"
        'rk3399trust.ini'
        'boot.txt'
        'mkscr')
b2sums=('SKIP'
        'SKIP'
        '8b63d5ac418d5fe0fc4df35086ce437f228bcd087ca63625c0e4c2670d106b8eaa6bd54f325f3cfdce16b91ed697205d8dba32c8c78a506f9bdffd12e94dde34'
        'd2e62e9d4950c89c5597590adbb399d615414d634c607c3c9a70a90ccee451b85b6563b7f568c668395e1e843821323fce48e03fe35aa2f5a211e4ae08d7e2ab'
        'cf03a62fd803187ab91db0942a5d7f835ffcf75c3b0b6ab8ca8c3e8a6762b328339580f3a80eeb1569bf4bca87a9cd60a83c3713338af2de4244717177c8d363'
        '4ea782264696aa85e30847413088bd338e2beb2ec4e57c2808f80af28ac613ab4ae82b37eb0ff902e66f8a12082a1f9a546bbf20dfeb4c43f59f465987043ede')
prepare() {
  cd rockchip-u-boot
  patch -Np1 -i "${srcdir}/0001-nvme-support.patch"
  sed -i 's/KBUILD_CFLAGS	+= -fshort-wchar -Werror/KBUILD_CFLAGS	+= -fshort-wchar/' Makefile
}

build() {
  cd rockchip-u-boot

  unset CLFAGS CXXFLAGS CPPFLAGS LDFLAGS

  make pinebookpro-rk3399_defconfig

  sed -i 's/CONFIG_IDENT_STRING=""/CONFIG_IDENT_STRING=" Manjaro ARM"/' .config
  make EXTRAVERSION=-${pkgrel}

}

package() {
  cd rockchip-u-boot

  mkdir -p "${pkgdir}/boot"

  tools/mkimage -n rk3399 -T rksd -d ../rkbin/bin/rk33/rk3399_ddr_800MHz_v1.23.bin "${pkgdir}/boot/idbloader.img"
  cat ../rkbin/bin/rk33/rk3399_miniloader_v1.19.bin >> "${pkgdir}/boot/idbloader.img"

  loaderimage --pack --uboot u-boot-dtb.bin "${pkgdir}/boot/uboot.img" 0x200000

  trust_merger ../rk3399trust.ini

  cp trust.img "${pkgdir}/boot"

  tools/mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d ../boot.txt "${pkgdir}/boot/boot.scr"
  cp ${srcdir}/{boot.txt,mkscr} "${pkgdir}"/boot
}