2018-09-16 15:53:45 +00:00
|
|
|
# Contributor: He Yangxuan <yangxuan8282@gmail.com>
|
|
|
|
# Contributor: William Pitcock <nenolod@dereferenced.org>
|
|
|
|
# Contributor: Timo Teras <timo.teras@iki.fi>
|
|
|
|
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
|
|
|
|
pkgname=u-boot
|
2019-01-19 13:40:15 +00:00
|
|
|
pkgver=2019.01
|
|
|
|
pkgrel=0
|
|
|
|
_atfversion="f0bfe15b81e50c6561a3a9a8e269db0267778910"
|
2018-09-16 15:53:45 +00:00
|
|
|
pkgdesc="u-boot bootloader common files"
|
|
|
|
url="http://www.denx.de/wiki/U-Boot/"
|
2019-01-19 13:40:15 +00:00
|
|
|
arch="armhf armv7 aarch64"
|
|
|
|
license="GPL-2.0-or-later OFL-1.1 BSD-2-Clause BSD-3-Clause eCos-2.0 IBM-pibs
|
|
|
|
ISC LGPL-2.0-only LGPL-2.1-only X11"
|
2018-09-16 15:53:45 +00:00
|
|
|
depends=""
|
|
|
|
depends_dev=""
|
2019-01-19 13:40:15 +00:00
|
|
|
makedepends="$depends_dev bc dtc python2-dev swig binutils coreutils bison flex"
|
2018-09-16 15:53:45 +00:00
|
|
|
install=""
|
2019-01-19 13:40:15 +00:00
|
|
|
source="http://ftp.denx.de/pub/u-boot/u-boot-${pkgver//_/-}.tar.bz2
|
|
|
|
arm-trusted-firmware-${_atfversion}.tar.gz::https://github.com/ARM-software/arm-trusted-firmware/archive/${_atfversion}.tar.gz
|
2018-09-16 15:53:45 +00:00
|
|
|
README.txt
|
|
|
|
update-u-boot
|
|
|
|
"
|
|
|
|
builddir="$srcdir"/u-boot-${pkgver//_/-}
|
|
|
|
atfbuilddir="$srcdir"/arm-trusted-firmware-${_atfversion}
|
|
|
|
|
|
|
|
case "$CARCH" in
|
2019-01-19 13:40:15 +00:00
|
|
|
arm*) board_configs="
|
2018-09-16 15:53:45 +00:00
|
|
|
beagleboard:am335x_boneblack
|
|
|
|
cubieboard:Cubieboard,Cubieboard2
|
|
|
|
cuboxi:mx6cuboxi
|
|
|
|
raspberrypi:rpi_0_w,rpi,rpi_2,rpi_3_32b
|
|
|
|
wandboard:wandboard
|
|
|
|
";;
|
|
|
|
aarch64) board_configs="
|
|
|
|
thunderx:thunderx_88xx
|
|
|
|
raspberrypi:rpi_3
|
2019-01-19 13:40:15 +00:00
|
|
|
odroid:odroid-c2
|
|
|
|
pine64:pine64-lts
|
2018-09-16 15:53:45 +00:00
|
|
|
";;
|
|
|
|
esac
|
|
|
|
|
|
|
|
_allboards=""
|
|
|
|
for board_config in $board_configs; do
|
|
|
|
_allboards="$_allboards $pkgname-${board_config%%:*}"
|
|
|
|
done
|
|
|
|
subpackages="$pkgname-all:_all $_allboards"
|
|
|
|
|
|
|
|
build() {
|
|
|
|
if [ "$CARCH" = "aarch64" ]; then
|
|
|
|
export LDFLAGS=""
|
|
|
|
msg "Building ARM trusted firmware for allwinner"
|
|
|
|
cd "$atfbuilddir"
|
2019-01-19 13:40:15 +00:00
|
|
|
make PLAT=sun50i_a64 DEBUG=1 bl31
|
|
|
|
export BL31="$atfbuilddir"/build/sun50i_a64/debug/bl31.bin
|
|
|
|
# Sanity check $BL31
|
|
|
|
if [ ! -f "$BL31" ]; then
|
|
|
|
echo 'The $BL31 variable is invalid. Please adjust.'
|
|
|
|
return 1
|
|
|
|
fi
|
2018-09-16 15:53:45 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
cd "$builddir"
|
|
|
|
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"/build/$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"/build
|
|
|
|
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"/build
|
|
|
|
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"/build/$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
|
|
|
|
|
2019-01-19 13:40:15 +00:00
|
|
|
sha512sums="d9699cd22afe9bc747d64208068c2cf8a2c3143d161ede24536f6fd6adfd6b81e28920589722639e2e48fcf34e8dbde3ead7f691f14cbcc38cd75694d14d719b u-boot-2019.01.tar.bz2
|
|
|
|
732b806bf3a612ded9351226c8fae78d02741220034009350be1c2237341584bcb366c0db2a19b64e4548e9a720d9380d1240680459b831943d3936077eecb13 arm-trusted-firmware-f0bfe15b81e50c6561a3a9a8e269db0267778910.tar.gz
|
2018-09-16 15:53:45 +00:00
|
|
|
f8c9bb6e84d6f0620c976ac7ad5dd7ec7ff9dfdd4b1d03d2bf6653e7beccf80bdf2debfc92fb1f696dba92fb40287d3c45897e0078951451d0835cb61a5f16d1 README.txt
|
2019-01-19 13:40:15 +00:00
|
|
|
f3bb656bbd13caf10a8ea619bc08b439e7dc27526c9cbdfa0374f4f8e277632ff4df06b34d441d6723a93d4a54aa03465d4270c44219d6a150d416b9c56edbbe update-u-boot"
|