From 98b60a86eb642db7beed4b4451235c5c62335c42 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: May 06 2022 21:56:45 +0000 Subject: pcr: libreboot-utils: armv7h: skip remaining tools requiring port mapped I/O The warning about bucts was removed as in fact most of these tools are probably dangerous in one way or another if used improperly. Flashrom which is packaged in most GNU/Linux distributions is also very dangerous if used improperly, though it comes with warnings and safe defaults. Signed-off-by: Denis 'GNUtoo' Carikli --- diff --git a/pcr/libreboot-utils/PKGBUILD b/pcr/libreboot-utils/PKGBUILD index a4e5297..ca816f7 100644 --- a/pcr/libreboot-utils/PKGBUILD +++ b/pcr/libreboot-utils/PKGBUILD @@ -4,7 +4,7 @@ # Maintainers: Parabola hackers pkgname=libreboot-utils -pkgrel=4 +pkgrel=5 _upstream_ver=20211122 pkgver=4.15.libreboot${_upstream_ver} pkgdesc="Misc. Coreboot/Libreboot utils (bucts, cbfstool, ECtool, nvramtool, superiotool)" @@ -54,29 +54,27 @@ build() { # Get to the directory. cd "$srcdir/libreboot-${_upstream_ver}_src/coreboot/default/util/" - # Bucts uses port-mapped I/O which doesn't exist on armv7h, so - # it fails to compile when including sys/io.h. And it's only - # useful for x86 computers anyway as it's supposed to run on - # computers with an I945 chipset. - # - # Note that it could also be dangerous to use for people that - # are not installing Libreboot or that don't know what they - # are doing. In case it happens, removing the CMOS battery and - # all other power sources should reset the BUC.TS register to - # its default value and enable the computer to boot again. + # These tools uses port-mapped I/O which doesn't exist on armv7h, + # so they fails to compile when including sys/io.h. They also need + # port-mapped I/O to work so it's pointless to try to build them + # on armv7h. if [ "${CARCH}" = "i686" -o "${CARCH}" = "x86_64" ] ; then # Build bucts. make -C bucts + + # Build ECtool. + make -C ectool + + # Build superiotool. + make -C superiotool fi # Build cbfstool. make -C cbfstool WERROR='' - # Build ECtool. - make -C ectool + # Build nvramtool. make -C nvramtool - # Build superiotool. - make -C superiotool + } package() { @@ -85,17 +83,28 @@ package() { # Set directories up. install -d "${pkgdir}"/usr/bin "${pkgdir}"/usr/share/man/man8 - # Install bucts. - install -Dm755 bucts/bucts "${pkgdir}"/usr/bin/bucts + + # These tools uses port-mapped I/O which doesn't exist on armv7h, + # so they fails to compile when including sys/io.h. So we also need + # to skip their installation. + if [ "${CARCH}" = "i686" -o "${CARCH}" = "x86_64" ] ; then + # Install bucts. + install -Dm755 bucts/bucts "${pkgdir}"/usr/bin/bucts + + # Install ECtool. + install -Dm755 ectool/ectool "${pkgdir}"/usr/bin/ectool + + # Install superiotool. + install -Dm755 superiotool/superiotool \ + "${pkgdir}"/usr/bin/superiotool + install -m644 superiotool/superiotool.8 \ + "${pkgdir}"/usr/share/man/man8 + fi + # Install cbfstool. install -Dm755 cbfstool/cbfstool "${pkgdir}"/usr/bin/cbfstool - # Install ECtool. - install -Dm755 ectool/ectool "${pkgdir}"/usr/bin/ectool # Install nvramtool. install -Dm755 nvramtool/nvramtool "${pkgdir}"/usr/bin/nvramtool install -m644 nvramtool/cli/nvramtool.8 "${pkgdir}"/usr/share/man/man8 - # Install superiotool. - install -Dm755 superiotool/superiotool "${pkgdir}"/usr/bin/superiotool - install -m644 superiotool/superiotool.8 "${pkgdir}"/usr/share/man/man8 }