From: Leo Sandoval via Grub-devel <grub-devel@gnu.org>
To: grub-devel@gnu.org
Cc: Leo Sandoval <lsandova@redhat.com>
Subject: [PATCH v5] Define a Containerfile and instructions to build distro images
Date: Mon, 7 Jul 2025 17:09:38 -0600 [thread overview]
Message-ID: <20250707230938.760746-1-lsandova@redhat.com> (raw)
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 <lsandova@redhat.com>
---
Changes between v3-v4:
* Define a generic container file (Containerfile) with several build arguments, so
packages are now passed through the command line instead of statically defined
into the container file per distro. This is a little more work for the user when
invoking the podman build command but with the benefit of having a single place
defining the required distro packages for GRUB development.
Changes between v4-v5:
* INSTALL: include texinfo & texlive on fedora podman build command
* Containerfile: remove containerfile comments (cmds are simple, no need to describe them)
---
INSTALL | 149 ++++++++++++++++++++++++++++++++++++++++++++++++
container/Containerfile | 13 +++++
2 files changed, 162 insertions(+)
create mode 100644 container/Containerfile
diff --git a/INSTALL b/INSTALL
index 724584c575..8533ff7902 100644
--- a/INSTALL
+++ b/INSTALL
@@ -105,6 +105,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
+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
====================
@@ -354,3 +361,145 @@ 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
+
+$ 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 \
+ squashfs-tools \
+ swtpm-tools \
+ texinfo \
+ 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 \
+ squashfs-tools \
+ swtpm-tools \
+ texinfo \
+ texlive \
+ tpm2-tools \
+ udftools \
+ unifont \
+ wamerican \
+ which \
+ xfonts-unifont \
+ xfsprogs \
+ xorriso \
+ zfs-fuse" \
+ -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
+
+ # ./bootstrap
+ # ./configure
+ # ./make
+ # ./make html
+ # ./make pdf
+ # ./make check
diff --git a/container/Containerfile b/container/Containerfile
new file mode 100644
index 0000000000..356f6319a8
--- /dev/null
+++ b/container/Containerfile
@@ -0,0 +1,13 @@
+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}
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
reply other threads:[~2025-07-07 23:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250707230938.760746-1-lsandova@redhat.com \
--to=grub-devel@gnu.org \
--cc=lsandova@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).