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 9cc02ddde1
("packages: roms: Start adding automatic tests.").

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2024-09-23 16:42:58 +02:00 committed by Adrien 'neox' Bourmault
parent 56537e0f2e
commit ab4cd051e2
Signed by: neox
GPG Key ID: 57BC26A3687116F6
1 changed files with 15 additions and 3 deletions

View File

@ -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