108 lines
3.1 KiB
Text
108 lines
3.1 KiB
Text
# Contributor: William Pitcock <nenolod@dereferenced.org>
|
|
# Contributor: Timo Teras <timo.teras@iki.fi>
|
|
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
|
|
pkgname=u-boot-rm
|
|
pkgver=2016.05
|
|
_gittag=97b35fdddf0077abd2e0f0409b94ef20adbe8565
|
|
pkgrel=0
|
|
|
|
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
|
|
|
|
pkgdesc="u-boot bootloader common files"
|
|
url="http://www.denx.de/wiki/U-Boot/"
|
|
arch="armv7"
|
|
license="GPL2"
|
|
depends=""
|
|
depends_dev=""
|
|
makedepends="$depends_dev bc dtc gcc$_cross"
|
|
install=""
|
|
source="https://github.com/reMarkable/uboot/archive/$_gittag.tar.gz
|
|
README.txt
|
|
uboot-config-patch.patch
|
|
update-u-boot
|
|
"
|
|
|
|
builddir="$srcdir"/uboot-$_gittag
|
|
|
|
case "$CARCH" in
|
|
armv7) board_configs="
|
|
rm1:zero-gravitas
|
|
";;
|
|
esac
|
|
|
|
_allboards=""
|
|
for board_config in $board_configs; do
|
|
_allboards="$_allboards $pkgname-${board_config%%:*}"
|
|
done
|
|
subpackages="$pkgname-all:_all $_allboards"
|
|
|
|
build() {
|
|
touch include/config.h
|
|
LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > include/timestamp_autogenerated.h
|
|
LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> include/timestamp_autogenerated.h
|
|
|
|
local board_config board
|
|
for board_config in $board_configs; do
|
|
local configs="${board_config#*:}"
|
|
for board in ${configs//,/ }; do
|
|
msg "Building u-boot for $board"
|
|
export BUILD_DIR="$builddir"/$board
|
|
mkdir -p "$BUILD_DIR"
|
|
make O="$BUILD_DIR" ${board}_config || return 1
|
|
make O="$BUILD_DIR" all || return 1
|
|
done
|
|
done
|
|
}
|
|
|
|
package() {
|
|
cd "$builddir"
|
|
mkdir -p "$pkgdir"/usr/share/$pkgname "$pkgdir"/usr/sbin
|
|
install "$srcdir"/README.txt "$pkgdir"/usr/share/$pkgname/README.txt || return 1
|
|
install "$srcdir"/update-u-boot "$pkgdir"/usr/sbin || return 1
|
|
}
|
|
|
|
_all() {
|
|
pkgdesc="u-boot for all boards (meta package)"
|
|
depends="$_allboards"
|
|
|
|
mkdir -p "$subpkgdir"/
|
|
}
|
|
|
|
_split_boards() {
|
|
cd "$builddir"
|
|
pkgdesc="u-boot for $1"
|
|
depends="u-boot"
|
|
shift
|
|
local board
|
|
for board; do
|
|
msg "Including board $board"
|
|
mkdir -p "$subpkgdir"/usr/share/$pkgname/$board
|
|
export BUILD_DIR="$builddir"/$board
|
|
local ok=no
|
|
for image in u-boot-sunxi-with-spl.bin -- MLO SPL u-boot.img -- u-boot.bin; do
|
|
if [ "$image" = "--" ]; then
|
|
[ "$ok" = yes ] && break
|
|
continue
|
|
fi
|
|
if [ -e "$BUILD_DIR"/$image ]; then
|
|
cp "$BUILD_DIR"/$image "$subpkgdir"/usr/share/$pkgname/$board \
|
|
|| return 1
|
|
ok=yes
|
|
fi
|
|
done
|
|
[ "$ok" = yes ] || return 1
|
|
done
|
|
}
|
|
|
|
for board_config in $board_configs; do
|
|
_board="${board_config%%:*}"
|
|
_configs="${board_config#*:}"
|
|
eval "${_board}() { _split_boards $_board ${_configs//,/ }; }"
|
|
done
|
|
|
|
sha512sums="
|
|
7cc8d513cac1d63ee5119529caa056164ee3bc3633da5d880fbfb344b770c7c53c41475d42dd129b505390dcd5449e14524afc06f7cdba9354af7e70a7035ef9 97b35fdddf0077abd2e0f0409b94ef20adbe8565.tar.gz
|
|
f8c9bb6e84d6f0620c976ac7ad5dd7ec7ff9dfdd4b1d03d2bf6653e7beccf80bdf2debfc92fb1f696dba92fb40287d3c45897e0078951451d0835cb61a5f16d1 README.txt
|
|
673cb917cc565ae245d4a7d659227bc240473112bc9c73ae184a64ce74be7994273d6dc4db17194d348941f83a42b3b67d3140f6f23c37c13d6dc93f7d76cc39 uboot-config-patch.patch
|
|
d57796ce018afa15e12521a90761ab1ae6411acf1fc0c1ce95f0d48630e0949568d8a7e577ba52d91c56918a9d414951c608aa49389ac7f8b50cb8aba5da9697 update-u-boot
|
|
"
|