Hello,
I've just finished packaging canoeboot-utils, this is essentially the same as
the old libreboot-utils package, but libre.
One notable change is the inclusion of the new nvmutil tool, which can be used
to manipulate NV-RAM.

-- 
Kind Regards,
Wael Karram.


From 5b269b4828572a538c4ceb05c7d214450ce0b4be Mon Sep 17 00:00:00 2001
From: Wael Karram <[email protected]>
Date: Thu, 1 Feb 2024 21:56:27 +0200
Subject: [PATCH] Added canoeboot-utils as a replacement to libreboot-utils.

---
 pcr/canoeboot-utils/PKGBUILD | 184 +++++++++++++++++++++++++++++++++++
 1 file changed, 184 insertions(+)
 create mode 100644 pcr/canoeboot-utils/PKGBUILD

diff --git a/pcr/canoeboot-utils/PKGBUILD b/pcr/canoeboot-utils/PKGBUILD
new file mode 100644
index 000000000..137563168
--- /dev/null
+++ b/pcr/canoeboot-utils/PKGBUILD
@@ -0,0 +1,184 @@
+# Copyright (C) 2024 Denis 'GNUtoo' Carikli <[email protected]>
+# Copyright (C) 2024 Wael Karram <[email protected]>
+# SPDX-License-Identifier: CC0-1.0
+# Maintainer: Parabola Hackers <[email protected]>
+
+pkgname=canoeboot-utils
+pkgrel=1
+_upstream_ver=20231107
+pkgver=4.15.canoeboot${_upstream_ver}
+pkgdesc="Misc. Coreboot/Canoeboot utils (bucts, cbfstool, ECtool, nvramtool, nvmutil, superiotool)"
+url="https://canoeboot.org/";
+conflicts=('libreboot-utils')
+replaces=('libreboot-utils')
+arch=('x86_64' 'i686' 'armv7h')
+license=('GPL2')
+makedepends=('pciutils' 'python' 'python-setuptools' 'flex')
+
+_mirror="https://mirrors.mit.edu/libreboot/canoeboot"; # use a mirror per canoeboot's request
+source=("${_mirror}/${_upstream_ver}/canoeboot-${_upstream_ver}_src.tar.xz"{,.sig})
+#        "0001-cbfstool-enable-to-disable-Werror-in-standalone-buil.patch")
+sha256sums=('19abf0cd253d18ad154868f932ad17438d9337807f8c9652869926be2fc12248'
+	'SKIP')
+validpgpkeys=('98CCDDF8E56047F475C044BDD0C62464FA8B4856') # Leah Rowe
+
+
+prepare() {
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/src/coreboot/default/"
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/src/coreboot/default/util/bucts/"
+	sed 's#/sbin#/bin#' -i Makefile
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/src/coreboot/default/util/cbfstool/"
+	sed 's#/sbin#/bin#' -i Makefile
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/src/coreboot/default/util/cbmem/"
+	sed 's#/sbin#/bin#' -i Makefile
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/src/coreboot/default/util/ectool/"
+	sed 's#/sbin#/bin#' -i Makefile
+	#cd "$srcdir/canoeboot-${_upstream_ver}_src/src/coreboot/default/util/intelmetool/"
+	#sed 's#/sbin#/bin#' -i Makefile
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/src/coreboot/default/util/inteltool/"
+	sed 's#/sbin#/bin#' -i Makefile
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/src/coreboot/default/util/nvramtool/"
+	sed 's#/sbin#/bin#' -i Makefile
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/src/coreboot/default/util/superiotool/"
+	sed 's#/sbin#/bin#' -i Makefile
+
+	# Remove uneeded files.
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/src/coreboot/default/"
+	rm -rf tests
+	rm -rf spd
+	rm -rf payloads
+	rm -rf Documentation
+}
+
+build() {
+	# Build ich9deblob, ich9gen, demefactory, ich9show, etc
+	#cd "$srcdir/canoeboot-${_upstream_ver}_src"
+	#make -C ich9utils
+
+	# Get to the directory.
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/src/coreboot/default/util/"
+
+	# 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 intelmetool.
+		#make -C intelmetool
+
+		# Build inteltool.
+		make -C inteltool
+
+		# Build superiotool.
+		make -C superiotool
+	fi
+
+	# Build bincfg.
+	make -C bincfg WERROR=""
+
+	# Build cbfstool.
+	make -C cbfstool WERROR=''
+
+	# Build cbmem.
+	make -C cbmem
+
+	# Build ifdtool
+	make -C ifdtool
+
+	# Build me_cleaner.
+	cd me_cleaner
+	python3 setup.py build
+	cd ..
+
+	# Build nvramtool.
+	make -C nvramtool
+
+	# Build spkmodem_recv.
+	make -C spkmodem_recv
+
+	# Build nvmutil
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/util/nvmutil/"
+	make
+}
+
+package() {
+	# Set directories up.
+	install -d "${pkgdir}"/usr/bin "${pkgdir}"/usr/share/man/man8
+
+	# Install ich9deblob, ich9gen, demefactory, ich9show, etc
+	#cd "$srcdir/canoeboot-${_upstream_ver}_src/src/ich9utils"
+	#for binary in ich9deblob ich9gen demefactory ich9show ; do
+	#	install -Dm755 "${binary}" "${pkgdir}"/usr/bin/"${binary}"
+	#done
+
+	# Get to the directory.
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/src/coreboot/default/util/"
+
+	# 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.
+		make -C ectool install PREFIX="${pkgdir}"/usr
+
+		# Install intelmetool.
+		#make -C intelmetool install DESTDIR="${pkgdir}" PREFIX=/usr
+
+		# Install inteltool.
+		make -C inteltool install DESTDIR="${pkgdir}" PREFIX=/usr
+
+		# Install superiotool.
+		make -C superiotool install DESTDIR="${pkgdir}" PREFIX=/usr
+	fi
+
+	# Install bincfg.
+	install -Dm755 bincfg/bincfg "${pkgdir}"/usr/bin/bincfg
+
+	install -d "${pkgdir}"/usr/share/bincfg
+	for _file in ddr3_unregistered_spd_128.spec \
+		    ddr3_unregistered_spd_256.spec \
+		    ddr4_registered_spd_512.spec \
+		    ddr4_unbuffered_spd_512.spec \
+		    gbe-82579LM.set \
+		    gbe-82579LM.spec \
+		    gbe-ich9m.set \
+		    gbe-ich9m.spec \
+		    ifd-x200.set \
+		    ifd-x200.spec \
+		    it8718f-ec.spec ; do
+		install -Dm644 bincfg/"${_file}" "${pkgdir}"/usr/share/bincfg/"${_file}"
+	done
+
+	# Install cbfstool.
+	make -C cbfstool install DESTDIR="${pkgdir}" PREFIX=/usr
+
+	# Install cbmem.
+	make -C cbmem install DESTDIR="${pkgdir}" PREFIX=/usr
+
+	# Install ifdtool.
+	make -C ifdtool install DESTDIR="${pkgdir}" PREFIX=/usr
+
+	# Install me_cleaner.
+	cd me_cleaner
+	python3 setup.py install --root="$pkgdir/" --optimize=1
+	cd ..
+
+	# Install nvramtool.
+	make -C nvramtool install DESTDIR="${pkgdir}" PREFIX=/usr
+
+	# Install spkmodem_recv.
+	make -C spkmodem_recv install PREFIX="${pkgdir}/usr"
+
+	# Install nvmutil
+	cd "$srcdir/canoeboot-${_upstream_ver}_src/util/nvmutil/"
+	make install PREFIX="${pkgdir}/usr"
+}
-- 
2.43.0

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Dev mailing list
[email protected]
https://lists.parabola.nu/mailman/listinfo/dev

Reply via email to