From ab4cd051e281af9ae726a392908eaf166604cf07 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Mon, 23 Sep 2024 16:42:58 +0200 Subject: [PATCH] packages: roms: download: fix missing qemu-img. Without that fix we have the following build error on Trisquel when qemu-utils is not installed: successfully built /gnu/store/[...]-gnuboot-trisquel-preseed.img-07-2024.drv resources/packages/roms/download: line 175: qemu-img: command not found make: *** [Makefile:713: release] Error 127 An option would be to make sure that the host has qemu_img by adding its corresponding packages in resources/dependencies/ and to check for it in configure.ac, but since we already build the qemu with Guix, it's easier to just reuse that, and this also gives us less maintenance in the long run. This was broken by the commit 9cc02ddde1e164fabfbddc8bbd3832ef9468d92d ("packages: roms: Start adding automatic tests."). Signed-off-by: Denis 'GNUtoo' Carikli Acked-by: Adrien 'neox' Bourmault --- resources/packages/roms/download | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/resources/packages/roms/download b/resources/packages/roms/download index cea77df..ae52fe0 100755 --- a/resources/packages/roms/download +++ b/resources/packages/roms/download @@ -139,15 +139,26 @@ build_trisquel_rootfs_img() return_guix_qemu_x86_64() { - img_install_path="bin/qemu-system-x86_64" + qemu_install_path="bin/qemu-system-x86_64" # Guix produces 3 qemu outputs: one for the docs, one for the # static version, and one for all the rest. pkg_path="$(build_guix_qemu_x86_64 | \ grep -v '\-doc$' | grep -v '\-static$')" - qemu_path="${pkg_path}/${img_install_path}" + qemu_path="${pkg_path}/${qemu_install_path}" echo "${qemu_path}" } +return_guix_qemu_img() +{ + qemu_img_install_path="bin/qemu-img" + # Guix produces 3 qemu outputs: one for the docs, one for the + # static version, and one for all the rest. + pkg_path="$(build_guix_qemu_x86_64 | \ + grep -v '\-doc$' | grep -v '\-static$')" + qemu_img_path="${pkg_path}/${qemu_img_install_path}" + echo "${qemu_img_path}" +} + return_trisquel_preseed_x86_64_img() { img_install_path="share/trisquel-installer/preseed.img" @@ -172,7 +183,8 @@ return_trisquel_rootfs_img() cp "${preseed_x86_64_img}" preseed.img chmod 770 preseed.img - qemu-img "create" "-f" "raw" "rootfs.img" "4.1G" + qemu_img="$(return_guix_qemu_img)" + "${qemu_img}" "create" "-f" "raw" "rootfs.img" "4.1G" extra_qemu_args="" if [ "${kvm}" = "yes" ] ; then