All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
	qemu-devel@nongnu.org
Cc: peterx@redhat.com, "Alex Bennée" <alex.bennee@linaro.org>,
	mjt@tls.msk.ru,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>
Subject: Re: [PATCH v4 2/2] scripts: add build_release_container.sh
Date: Wed, 28 Oct 2026 20:00:27 -0300	[thread overview]
Message-ID: <874ie5jur8.fsf@suse.de> (raw)
In-Reply-To: <20261026210801.179790-3-pierrick.bouvier@oss.qualcomm.com>

Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> writes:

> This script allows to easily build a qemu release container, based on
> dockerfile introduced in previous commit.
>
> It names image "qemu/$version" and automatically detects which ubuntu
> version should be used to build it.
>
> $ ./scripts/build_release_container.sh v3.1.0
> $ podman run -it --rm qemu/v3.1.0 qemu-system-arm --version
> QEMU emulator version 3.1.0 (-dirty)
> Copyright (c) 2003-2018 Fabrice Bellard and the QEMU Project developers
>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
> ---
>  scripts/build_release_container.sh | 63 ++++++++++++++++++++++++++++++
>  1 file changed, 63 insertions(+)
>  create mode 100755 scripts/build_release_container.sh
>
> diff --git a/scripts/build_release_container.sh b/scripts/build_release_container.sh
> new file mode 100755
> index 00000000000..ae57aa21db3
> --- /dev/null
> +++ b/scripts/build_release_container.sh
> @@ -0,0 +1,63 @@
> +#!/usr/bin/env bash
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +set -euo pipefail
> +
> +script_dir=$(dirname $(readlink -f $0))
> +
> +# The oldest buildable release we support is v3.1.0, as previous ones require
> +# additional tweaks in Dockerfile.
> +# For building previous releases (down to v0.12.0),
> +# see: 20261014005338.34657-1-pierrick.bouvier@oss.qualcomm.com
> +oldest_release=v3.1.0
> +
> +if [ $# -lt 1 ] || [ $# -gt 2 ]; then
> +    echo "usage: version [git_repo]"
> +    echo
> +    echo "- version: tag or sha-1 (>= v3.1.0)"
> +    echo "- git_repo: (optional) QEMU repository URL"
> +    exit 1
> +fi
> +version=$1;shift
> +
> +git_repo="https://gitlab.com/qemu-project/qemu.git"
> +if [ $# -eq 1 ]; then
> +    git_repo=$1;shift
> +fi
> +
> +year=$(date +%Y)
> +month=$(date +%m)
> +if git rev-parse $version >& /dev/null; then
> +    year=$(git log -1 --format='%cd' --date='format:%Y' $version)
> +    month=$(git log -1 --format='%cd' --date='format:%m' $version)
> +fi
> +
> +# Ubuntu LTS are published every (even) two years in April.
> +ubuntu=
> +if [ $((year % 2)) -eq 1 ]; then
> +    # pick latest LTS from previous year
> +    ubuntu=$((year - 1))
> +elif [ $month -gt 6 ]; then
> +    # LTS published this year should work
> +    ubuntu=$year
> +else
> +    # pick latest LTS from two years ago
> +    ubuntu=$((year - 2))
> +fi
> +if [ $ubuntu -lt 2014 ]; then
> +    # oldest ubuntu release available with containers is 14.04
> +    ubuntu=2014
> +fi
> +ubuntu=$((ubuntu - 2000))
> +ubuntu_version=$ubuntu.04
> +
> +dockerfile=$script_dir/../tests/docker/dockerfiles/release.docker
> +docker=$($script_dir/../tests/docker/docker.py probe)

For docker this gives:

 ERROR: docker: 'docker buildx build' requires 1 argument                                                                                                                      
 Usage:  docker buildx build [OPTIONS] PATH | URL | -

I think it expects a . or - since the dockerfile is passed with -f
below. Going back to

  docker=$script_dir/../tests/docker/docker.py

makes it work.

> +
> +set -x
> +$docker build \
> +    -f $dockerfile \
> +    --build-arg QEMU_VERSION=$version \
> +    --build-arg UBUNTU_VERSION=$ubuntu_version \
> +    --build-arg QEMU_REPO="$git_repo" \
> +    -t qemu/$version


  reply	other threads:[~2026-10-28 23:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 21:07 [PATCH v4 0/2] releases: build and run any QEMU release easily! Pierrick Bouvier
2026-10-26 21:08 ` [PATCH v4 1/2] tests/docker/dockerfiles: add release.docker Pierrick Bouvier
2026-10-28 23:00   ` Fabiano Rosas
2026-10-26 21:08 ` [PATCH v4 2/2] scripts: add build_release_container.sh Pierrick Bouvier
2026-10-28 23:00   ` Fabiano Rosas [this message]
2026-10-29  0:01     ` Pierrick Bouvier
2026-10-27  3:26 ` [PATCH v4 0/2] releases: build and run any QEMU release easily! Philippe Mathieu-Daudé
2026-10-29  0:10 ` Pierrick Bouvier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874ie5jur8.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=mjt@tls.msk.ru \
    --cc=peterx@redhat.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.