Re: [PATCH V3 1/1] Define a Containerfile and instructions to build distro images

Daniel Kiper <[email protected]>
Newsgroups org.gnu.grub-devel
Message-ID <[email protected]>
On Fri, Sep 19, 2025 at 05:39:18PM -0600, Leo Sandoval via Grub-devel wrote:
> Containers bring the ability to have ready-to-use environments
> isolated completely from the build environment. Once users manually
> build it, they can launch the desired container, jump into it and have
> a setup ready for development. On the other hand, if users prefer to
> use bare metal instead of a containerized environment, it is still
> useful to have a the full list of the required packages.
>
> Signed-off-by: Leo Sandoval <[email protected]>
> ---
>  INSTALL                 | 158 ++++++++++++++++++++++++++++++++++++++++
>  container/Containerfile |  16 ++++
>  container/check.sh      |  18 +++++
>  3 files changed, 192 insertions(+)
>  create mode 100644 container/Containerfile
>  create mode 100644 container/check.sh
>
> diff --git a/INSTALL b/INSTALL
> index 22b68cb6c7..305e0ae29a 100644
> --- a/INSTALL
> +++ b/INSTALL
> @@ -109,6 +109,13 @@ To use the gdb_grub GDB script you'll need:
>  * GNU Debugger > 7, built with python support (gdb package)
>  * Python >= 3.5 (python3 package)
>
> +To easier the task of package installation, the Container section list

s/easier/ease/

> +the above packages per distribution (see the command line examples, the
> +--build-arg PKGS argument on the podman build command). In case the installation
> +of these packages is not possible on your host, one can rely on containers which
> +are ready-to-use container images for GRUB development. For more informacion see
> +Container section.
> +
>  Configuring the GRUB
>  ====================
>
> @@ -358,3 +365,154 @@ operates.
>  `--version'
>       Print the version of Autoconf used to generate the `configure'
>       script, and exit.
> +
> +Container
> +=========
> +
> +Containers bring the ability to have ready-to-use environments isolated completely
> +from the build environment. Once users manually build it, they can launch the desired
> +container, jump into it and have a setup ready for development. On the other hand, if users
> +prefer to use bare metal instead of a containerized environment, it is still useful to have a
> +the full list of the required packages.
> +
> +Assuming your build OS support containers, e.g. all Linux distros, install 'podman' on
> +your favorite distro, move into the container folder then build a specific distro image with

I think you should mention here that the command below is for Fedora.

> +$ cd container
> +$ podman build \
> +  --build-arg BASE_IMAGE=fedora \
> +  --build-arg PKG_MANAGER=dnf \
> +  --build-arg PKGS="\
> +        attr \
> +        autoconf \
> +        automake \
> +        autopoint \
> +        bison \
> +        btrfs-progs \
> +        cpio \
> +        cryptsetup \
> +        dosfstools \
> +        e2fsprogs \
> +        edk2-ovmf \
> +        edk2-ovmf-ia32 \
> +        erofs-utils \
> +        exfatprogs \
> +        f2fs-tools \
> +        flex \
> +        gawk \
> +        genromfs \
> +        gettext \
> +        git \
> +        hfsplus-tools \
> +        jfsutils \
> +        libtool \
> +        lzop \
> +        make \
> +        mtools \
> +        nilfs-utils \
> +        ntfsprogs \
> +        parted \
> +        patch \
> +        pkg-config \
> +        python3 \
> +        qemu-system-arm \
> +        qemu-system-aarch64 \
> +        qemu-system-riscv \
> +        qemu-system-x86 \
> +	rsync \

Please fix indention here.

> +        squashfs-tools \
> +        swtpm-tools \
> +        texinfo \
> +	texinfo-tex \

Ditto.

> +        texlive \
> +        tpm2-tools \
> +        udftools \
> +        unifont \
> +        unifont-fonts \
> +        which \
> +        words \
> +        xfsprogs \
> +        xorriso \
> +        zfs-fuse" \
> +  -t fedora-grub .
> +
> +or in case you prefer Debian
> +
> +$ cd container
> +$ podman build \
> +  --build-arg BASE_IMAGE=debian \
> +  --build-arg PKG_MANAGER=apt \
> +  --build-arg PKGS="\
> +        attr \
> +        autoconf \
> +        automake \
> +        autopoint \
> +        bison \
> +        btrfs-progs \
> +        cpio \
> +        cryptsetup \
> +        dosfstools \
> +        e2fsprogs \
> +        erofs-utils \
> +        exfatprogs \
> +        f2fs-tools \
> +        flex \
> +        gawk \
> +        genromfs \
> +        gettext \
> +        git \
> +        hfsplus \
> +        jfsutils \
> +        libtool \
> +        lzop \
> +        make \
> +        mtools \
> +        nilfs-tools \
> +        ntfs-3g \
> +        ovmf \
> +        ovmf-ia32 \
> +        parted \
> +        patch \
> +        pkg-config \
> +        python3 \
> +        qemu-efi-aarch64 \
> +        qemu-efi-arm \
> +        qemu-system \
> +	rsync \

Ditto.

> +        squashfs-tools \
> +        swtpm-tools \
> +        texinfo \
> +        texlive \
> +        tpm2-tools \
> +        udftools \
> +        unifont \
> +        wamerican \
> +        which \
> +        xfonts-unifont \
> +        xfsprogs \
> +        xorriso \
> +        zfs-fuse" \

It seems to me the list of packages for Debian is not consistent with
what is currently in the INSTALL file. Is it? Anyway, I think both
should be checked and Fedora and Debian users should be pointed from
relevant section to the commands building relevant containers and easy
to get list of packages.

> +  -t debian-grub .
> +
> +once built, you can run/launch any of the aboven
> +
> +$ podman run -it fedora-grub
> +
> +or
> +
> +$ podman run -it debian-grub
> +
> +and execute the standard build/test commands inside it, e.g
> +
> +  # ./linguas.sh
> +  # ./bootstrap
> +  # ./configure
> +  # make
> +  # make html
> +  # make pdf
> +  # make check
> +
> +The above commands are collected in a single script inside the container called 'check.sh'
> +and can be useful as sanity check for testing latest upstream changes with
> +
> +$ podman run fedora-grub /grub/check.sh
> diff --git a/container/Containerfile b/container/Containerfile
> new file mode 100644
> index 0000000000..c74f6270c9
> --- /dev/null
> +++ b/container/Containerfile
> @@ -0,0 +1,16 @@
> +ARG BASE_IMAGE
> +FROM ${BASE_IMAGE}
> +
> +ARG PKG_MANAGER
> +ARG PKGS
> +ARG GIT_CLONE_DEPTH=1
> +ARG GRUB_REPO=https://git.savannah.gnu.org/git/grub.git
> +ARG GRUB_DIR=/grub
> +
> +RUN $PKG_MANAGER update -y && $PKG_MANAGER install -y ${PKGS}
> +RUN git clone --depth ${GIT_CLONE_DEPTH} ${GRUB_REPO} ${GRUB_DIR}
> +
> +WORKDIR ${GRUB_DIR}
> +
> +COPY check.sh .
> +RUN chmod +x check.sh
> diff --git a/container/check.sh b/container/check.sh
> new file mode 100644
> index 0000000000..aa3eebcdd5
> --- /dev/null
> +++ b/container/check.sh
> @@ -0,0 +1,18 @@
> +#! /bin/sh
> +
> +set -e
> +set -x

#!/bin/sh -ex

... and you are done

> +
> +cd /grub

This will not work on baremetal machine...

> +./linguas.sh
> +./bootstrap
> +./configure
> +make
> +make html
> +make pdf
> +make check || true
> +
> +if [ -f test-suite.log ]; then
> +    cat test-suite.log
> +fi

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.