From 1611a810b4bdfef3be169977b0448378d1a9f513 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Sun, 10 Dec 2023 21:56:04 +0100 Subject: [PATCH] packages: roms: boot: filter out invalid computers. For some reason, 'make release' produces the following files: - release/roms/gnuboot-lbwww-20211122-328-gafe01fb_default.tar.xz - release/roms/gnuboot-lbwww-20211122-328-gafe01fb_fam15h_rdimm.tar.xz - release/roms/gnuboot-lbwww-20211122-328-gafe01fb_fam15h_udimm.tar.xz This commit works around that issue. Signed-off-by: Denis 'GNUtoo' Carikli Acked-by: Adrien 'neox' Bourmault --- Makefile | 1 + resources/packages/roms/boot | 10 ++++++++ tests/targets | 44 ++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100755 tests/targets diff --git a/Makefile b/Makefile index b7f6a65..47d8c4d 100644 --- a/Makefile +++ b/Makefile @@ -103,4 +103,5 @@ check: echo 'Makefile: running $@ target' >> $(LOG) set -o pipefail ; ./tests/lint | tee -a $(LOG) set -o pipefail ; ./tests/distclean | tee -a $(LOG) + set -o pipefail ; ./tests/targets 2>&1 | tee -a $(LOG) @echo "[ OK ] Makefile: $@ target. See $(LOG) for the log." diff --git a/resources/packages/roms/boot b/resources/packages/roms/boot index 2f3d76f..e79a667 100755 --- a/resources/packages/roms/boot +++ b/resources/packages/roms/boot @@ -33,6 +33,16 @@ listboards() { if [ ! -d "${boarddir}" ]; then continue; fi board="${boarddir##resources/coreboot/}" board="${board%/}" + + # TODO: In GNU Boot 0.1 RC1 build the release didn't produce + # images for the 'default', 'fam15h_rdimm' and 'fam15h_udimm' + # 'computers'. So a bug was introduced at some point and made + # GNU Boot build these targets. Since we didn't find the bug we + # workaround it instead. + if [ "${board}" = "default" ]; then continue; fi + if [ "${board}" = "fam15h_rdimm" ]; then continue; fi + if [ "${board}" = "fam15h_udimm" ]; then continue; fi + printf '%s\n' "${board##*/}" done } diff --git a/tests/targets b/tests/targets new file mode 100755 index 0000000..8cab02f --- /dev/null +++ b/tests/targets @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2023 Denis 'GNUtoo' Carikli +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +printf "+-----------------------+\n" +printf "| Running targets test: |\n" +printf "+-----------------------+\n" + +errors=0 + +report() +{ + ret=$? + target="$1" + + if [ ${ret} -ne 0 ] ; then + echo "[ OK ] ./build boot roms list: ${target} target not found." + else + errors=$(expr ${errors} + 1) + echo "[ !! ] ./build boot roms list: found ${target} target." + fi +} + +for target in default fam15h_rdimm fam15h_udimm ; do + ./build boot roms list | grep "^${target}\$" 2>&1 >/dev/null; \ + report "${target}" +done + +if [ ${errors} -gt 0 ] ; then + exit 1 +fi