PKGBUILDs/alarm/uboot-raspberrypi/PKGBUILD
2024-06-01 08:40:13 -04:00

95 lines
3.8 KiB
Bash

# U-Boot: Raspberry Pi
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
# Maintainer: graysky <therealgraysky@proton.me>
pkgname=uboot-raspberrypi
pkgver=2024.04
pkgrel=1
pkgdesc="U-Boot for Raspberry Pi"
arch=('armv7h' 'aarch64')
url='https://docs.u-boot.org/en/latest'
license=('GPL')
backup=('boot/boot.txt' 'boot/boot.scr' 'boot/config.txt')
makedepends=('bc' 'dtc' 'git')
conflicts_armv7h=('linux-rpi' 'linux-rpi-16k')
_commit=f31d28d61e048c9d918874be8e7ebbc30db90617
source=(
"https://github.com/u-boot/u-boot/archive/refs/tags/v${pkgver/rc/-rc}.tar.gz"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2710-rpi-2-b.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2710-rpi-3-b-plus.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2710-rpi-3-b.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2710-rpi-cm3.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2710-rpi-zero-2-w.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2710-rpi-zero-2.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2711-rpi-4-b.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2711-rpi-400.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2711-rpi-cm4-io.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2711-rpi-cm4.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2711-rpi-cm4s.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2712-rpi-5-b.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2712d0-rpi-5-b.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2712-rpi-cm5-cm4io.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2712-rpi-cm5-cm5io.dtb"
'0001-rpi-increase-space-for-kernel.patch'
'boot.txt.v2'
'boot.txt.v3'
'mkscr')
md5sums=('4f21d9a53df6f5c2e66f54e747af9265'
'7ad31a4789385a7b00ecd9672578ccef'
'b76403a75e35fa94e8fd8e5e836a2d00'
'f5d057efb61fcae81ac9551a4137752d'
'c032f183c57d07cbe0d2eaf876a1a578'
'486addde4a99e7cf92c1a6082dd95c15'
'486addde4a99e7cf92c1a6082dd95c15'
'77e2e811c6d5c8b7fce9e6ffb470e12f'
'896eb2a7985a9f2565c7c7e05e9f7f68'
'3efd77582f05e5ca6f55ec14f00810e1'
'ab4c34a753bff6b6cfaf91b6bc2175b0'
'261991100d8f9fb6ea1360789a70401b'
'12ea531239034d7192900ea42fb57523'
'5f9b71fd12055915221fd02a623cb4bb'
'51be7ecbdf013c69d6c347d5916660f6'
'54a9def6a54fc25a12a9f05e9367cafd'
'6aaffd002561e8dcbbf0b26422040143'
'69e883f0b8d1686b32bdf79684623f06'
'be8abe44b86d63428d7ac3acc64ee3bf'
'021623a04afd29ac3f368977140cfbfd')
prepare() {
cd u-boot-${pkgver/rc/-rc}
patch -p1 -i ../0001-rpi-increase-space-for-kernel.patch
}
build() {
cd u-boot-${pkgver/rc/-rc}
unset CFLAGS
unset CXXFLAGS
unset CPPFLAGS
make distclean
[[ $CARCH == "armv7h" ]] && make rpi_2_config
[[ $CARCH == "aarch64" ]] && make rpi_arm64_config
echo 'CONFIG_IDENT_STRING=" Arch Linux ARM"' >> .config
make EXTRAVERSION=-${pkgrel}
}
package() {
cd u-boot-${pkgver/rc/-rc}
mkdir -p "${pkgdir}"/boot
if [[ $CARCH == "armv7h" ]]; then
cp u-boot.bin ${pkgdir}/boot/kernel7.img
cp ../boot.txt.v2 ../boot.txt
elif [[ $CARCH == "aarch64" ]]; then
cp u-boot.bin ${pkgdir}/boot/kernel8.img
cp ../*.dtb ${pkgdir}/boot
cp ../boot.txt.v3 ../boot.txt
echo "enable_uart=1" > ${pkgdir}/boot/config.txt
fi
tools/mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d ../boot.txt "${pkgdir}"/boot/boot.scr
cp ../{boot.txt,mkscr} "${pkgdir}"/boot
}