From 95f283331263e754a95170ad97f08f68e554f7d4 Mon Sep 17 00:00:00 2001 From: graysky Date: Sat, 30 Sep 2023 10:47:36 -0400 Subject: [PATCH] alarm/rpi-eeprom to 20230929-2 Split for bcm2711 and bcm2712 --- alarm/rpi-eeprom/PKGBUILD | 74 +++++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 19 deletions(-) diff --git a/alarm/rpi-eeprom/PKGBUILD b/alarm/rpi-eeprom/PKGBUILD index de74987ab..6adcb7f5f 100644 --- a/alarm/rpi-eeprom/PKGBUILD +++ b/alarm/rpi-eeprom/PKGBUILD @@ -1,42 +1,78 @@ # Maintainer: graysky -pkgname=rpi-eeprom +pkgbase=rpi-eeprom +pkgname=(rpi4-eeprom rpi5-eeprom) + _commit=4f2d676b4e2a9c2d9ee1ab42015ce711fde97afa pkgver=20230929 -pkgrel=1 -pkgdesc="Bootloader and VL805 USB controller EEPROM update tool for RPi4" -arch=('any') +pkgrel=2 +arch=(any) url='https://github.com/raspberrypi/rpi-eeprom' -license=('custom') -depends=(python pciutils raspberrypi-firmware coreutils binutils) -backup=("etc/default/$pkgname-update") -source=("$pkgname-$pkgver-${_commit:0:10}.tar.gz::https://github.com/raspberrypi/rpi-eeprom/archive/$_commit.tar.gz") +license=(custom) +source=("$pkgbase-$pkgver-${_commit:0:10}.tar.gz::https://github.com/raspberrypi/rpi-eeprom/archive/$_commit.tar.gz") md5sums=('5a4d33d67a10035b214b43e4a8e7d52d') -install="$pkgname.install" -package() { - cd "$pkgname-$_commit" +package_rpi4-eeprom() { + pkgdesc="Bootloader and VLI USB controller EEPROM update for bcm2711/RPi4 SoC" + depends=(python pciutils raspberrypi-firmware coreutils binutils) + conflicts=(rpi5-eeprom rpi-eeprom) + replaces=(rpi-eeprom) + backup=("etc/default/$pkgbase-update") + install="rpi-eeprom.install" + + cd "$pkgbase-$_commit" install -pd "$pkgdir/usr/bin" install -pm755 rpi-eeprom-config "$pkgdir/usr/bin/rpi-eeprom-config" install -pm755 rpi-eeprom-digest "$pkgdir/usr/bin/rpi-eeprom-digest" install -pm755 rpi-eeprom-update "$pkgdir/usr/bin/rpi-eeprom-update" - install -pDm644 "$pkgname-update-default" "$pkgdir/etc/default/$pkgname-update" - # Arch ARM does not ship raspi-config sed -i '/to change the release/d' "$pkgdir/usr/bin/rpi-eeprom-update" + install -pDm644 rpi-eeprom-update-default "$pkgdir/etc/default/rpi-update" + install -pDm644 LICENSE "$pkgdir/usr/share/doc/$pkgname" install -pd "$pkgdir/usr/lib/firmware/raspberrypi/bootloader/backup" - for target in beta critical stable; do - cp -a "firmware/$target" "$pkgdir/usr/lib/firmware/raspberrypi/bootloader" + for target in latest default; do + cp -a "firmware-2711/$target" "$pkgdir/usr/lib/firmware/raspberrypi/bootloader" # remove old images rm -f "$pkgdir/usr/lib/firmware/raspberrypi/bootloader/$target/"pieeprom-202[0,1,2]*.bin done - ln -sf critical "$pkgdir/usr/lib/firmware/raspberrypi/bootloader/default" - ln -sf stable "$pkgdir/usr/lib/firmware/raspberrypi/bootloader/latest" - install -pDm644 LICENSE "$pkgdir/usr/share/doc/$pkgname" + cd $pkgdir/usr/lib/firmware/raspberrypi/bootloader + ln -sf latest beta + ln -sf latest stable + ln -sf default critical + + # firmware files should not be executable + find "$pkgdir/usr/lib/firmware/raspberrypi/bootloader" -name '*.bin' -exec chmod 644 '{}' + +} + +package_rpi5-eeprom() { + pkgdesc="Bootloader and VLI USB controller EEPROM update for bcm2712/RPi5 SoC" + depends=(python pciutils raspberrypi-firmware coreutils binutils) + conflicts=(rpi4-eeprom) + backup=("etc/default/$pkgbase-update") + install="rpi-eeprom.install" + + cd "$pkgbase-$_commit" + install -pd "$pkgdir/usr/bin" + install -pm755 rpi-eeprom-config "$pkgdir/usr/bin/rpi-eeprom-config" + install -pm755 rpi-eeprom-digest "$pkgdir/usr/bin/rpi-eeprom-digest" + install -pm755 rpi-eeprom-update "$pkgdir/usr/bin/rpi-eeprom-update" + # Arch ARM does not ship raspi-config + sed -i '/to change the release/d' "$pkgdir/usr/bin/rpi-eeprom-update" + install -pDm644 rpi-eeprom-update-default "$pkgdir/etc/default/rpi-update" + install -pDm644 LICENSE "$pkgdir/usr/share/doc/$pkgname" + + install -pd "$pkgdir/usr/lib/firmware/raspberrypi/bootloader/backup" + for target in latest default; do + cp -a "firmware-2712/$target" "$pkgdir/usr/lib/firmware/raspberrypi/bootloader" + done + + cd $pkgdir/usr/lib/firmware/raspberrypi/bootloader + ln -sf latest beta + ln -sf latest stable + ln -sf default critical # firmware files should not be executable find "$pkgdir/usr/lib/firmware/raspberrypi/bootloader" -name '*.bin' -exec chmod 644 '{}' + - }