summaryrefslogtreecommitdiff
path: root/libre/uboot4extlinux-imx/PKGBUILD
blob: 99f0520d531ccb4e8c0344fdc7f30f637b704ee5 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# U-Boot: I.MX
# Contributor: Isaac David <isacdaavid@at@isacdaavid@dot@info>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Timothy Redaelli <timothy.redaelli@gmail.com>
# Maintainer: Parabola Hackers <dev@lists.parabola.nu>

# TODO:
# - Add the following boards
#   - 'mx6cuboxi'
#   - 'nitrogen6q'
#   - 'udoo'
#   - 'usbarmory'
#   - 'wandboard'
# - Improve the .install:
#   - Make it more generic: share the main part of the code.
#   - Check for the machine name with the device tree and ask for confirmation
#     if the machine is not the same but don't prevent users from installing
#     this bootloader on a totally different machine as the installation could
#     be done in a chroot or in other ways that packagers can't predict.
#   - Handle more than one boot device (microSD, eMMC, USB, etc)
#   - Point to the device documentation if there is some

pkgbase=uboot4extlinux-imx
pkgname=('uboot4extlinux-tbs2910')
pkgver=2020.04
pkgrel=2
arch=('armv7h')
url="http://git.denx.de/u-boot.git/"
license=('GPL')
makedepends=('bc' 'dtc' 'python' 'python2' 'swig')
backup=(boot/extlinux/extlinux.conf)
source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2"
        'extlinux.conf')
sha256sums=('fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372'
            'SKIP')

# Distro boot config and documentation for the TBS TBS2910
# The patches are from the next branch of u-boot git
# a bit after the v2020.07-rc4 tag. They should make it in 1 or two
# u-boot release.
source+=('0001-board-tbs2910-disable-loadb-and-loads-commands.patch'
         '0002-board-tbs2910-disable-CONFIG_GZIP.patch'
         '0003-board-tbs2910-move-CONFIG_BOOTCOMMAND-from-header-to.patch'
         '0004-board-tbs2910_defconfig-Add-support-for-booting-gene.patch'
         '0005-board-tbs2910-Enable-distro_boot-support.patch'
         '0006-board-tbs2910-add-documentation.patch')
sha256sums+=('SKIP'
             'SKIP'
             'SKIP'
             'SKIP'
             'SKIP'
             'SKIP')

boards=('tbs2910')

prepare() {
  cd u-boot-${pkgver}

  # TBS2910 patches
  patch -Np1 -i ../0001-board-tbs2910-disable-loadb-and-loads-commands.patch
  patch -Np1 -i ../0002-board-tbs2910-disable-CONFIG_GZIP.patch
  patch -Np1 -i ../0003-board-tbs2910-move-CONFIG_BOOTCOMMAND-from-header-to.patch
  patch -Np1 -i ../0004-board-tbs2910_defconfig-Add-support-for-booting-gene.patch
  patch -Np1 -i ../0005-board-tbs2910-Enable-distro_boot-support.patch
  patch -Np1 -i ../0006-board-tbs2910-add-documentation.patch
}

build() {
  cd u-boot-${pkgver}

  unset CFLAGS CXXFLAGS LDFLAGS

  for i in ${boards[@]}; do
    mkdir -p ../bin_${i}
    make distclean
    make ${i}_defconfig
    echo 'CONFIG_IDENT_STRING=" Parabola GNU/Linux-libre"' >> .config
    make EXTRAVERSION=-${pkgrel}
    mv -f u-boot.imx ../bin_${i}
  done
}

package_uboot4extlinux-tbs2910() {
  pkgdesc="U-Boot with Extlinux support for the TBS2910 Matrix ARM mini PC"
  install=tbs2910.install
  provides=('uboot4extlinux-imx')

  install -d "${pkgdir}"/boot/extlinux
  install -d "${pkgdir}"/boot/u-boot/images/
  install -Dm644 bin_tbs2910/u-boot.imx "${pkgdir}"/boot/u-boot/images/

  install -Dm644 extlinux.conf "${pkgdir}"/boot/extlinux

  # Package documentation as well
  install -d "${pkgdir}"/usr/share/doc/u-boot
  install -Dm644 u-boot-${pkgver}/doc/board/tbs/tbs2910.rst "${pkgdir}"/usr/share/doc/u-boot
}