grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Leo Sandoval via Grub-devel <grub-devel@gnu.org>
To: grub-devel@gnu.org
Cc: Leo Sandoval <lsandova@redhat.com>
Subject: [PATCH v2] Create Containerfiles with required grub packages for development
Date: Fri, 20 Jun 2025 18:03:41 -0600	[thread overview]
Message-ID: <20250621000343.2843347-1-lsandova@redhat.com> (raw)

Containers bring the ability to have ready-to-use environments and in
this case complete Fedora and Debian container files are described
containing all required packages for building and testing grub2.

Once users manually build it, they can run the desired container, jump
into 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 file explicitly indicating the required packages.

Signed-off-by: Leo Sandoval <lsandova@redhat.com>
---
Some facts observed while creating and testing these containes:

NOTE: all the below results are based on

    root@a613d2d32efa:/grub# git log --oneline
    db506b3 (grafted, HEAD -> master, origin/master, origin/HEAD) gnulib/regexec: Fix resource leak

* compilation time

Done on my mostly idle-laptop (20 i7-12800H cores) so this is not really an isolated system, as any other benchmark,
do not trust too much on these numbers

Debian:
    root@a613d2d32efa:/grub# time make &>/dev/null

    real	1m15.486s
    user	0m51.869s
    sys	        0m23.338s

Fedora:
    [root@4eabb29f0ef2 grub]# time make &>/dev/null

    real	1m18.679s
    user	0m51.352s
    sys	        0m27.417s


* image sizes:

    $ podman images | grep '\-grub'
    localhost/debian-grub                      latest      e789c1f8da26  About a minute ago  2.34 GB
    localhost/fedora-grub                      latest      b2dd8ef96b85  15 minutes ago      2.04 GB

so debian is a 'bit' heavier than fedora.

* compilation issue

Due to a more recent gcc version on Fedora compared to Debian, compilation failed on the Fedora container
with the following error (already reported but not yet at upstream)

    lib/gnulib/base64.c:65:3: error: initializer-string for array of ‘char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (65 chars into 64 available) [-Werror=unterminated-string-initialization]
       65 |   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

whereas not observed in Debian. To fix the above, one can install b4 and patch the repo

    [root@4eabb29f0ef2 grub]# b4 shazam https://lore.kernel.org/grub-devel/20250618015826.270234-2-adhamilt@gmail.com/
    Grabbing thread from lore.kernel.org/all/20250618015826.270234-2-adhamilt@gmail.com/t.mbox.gz
    Checking for newer revisions
    Grabbing search results from lore.kernel.org
    Analyzing 6 messages in the thread
    Analyzing 3 code-review messages
    Checking attestation on all messages, may take a moment...
    ---
      ✗ [PATCH v2 1/2] gnulib: Add patch to allow GRUB w/GCC-15 compile
        + Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com> (✗ DKIM/ibm.com)
      ✗ [PATCH v2 2/2] util/grub-protect: Correct uninit 'err' Variable
        + Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com> (✗ DKIM/ibm.com)
      ---
      ✗ BADSIG: DKIM/gmail.com
    ---
    Total patches: 2
    ---
    Applying: gnulib: Add patch to allow GRUB w/GCC-15 compile
    Applying: util/grub-protect: Correct uninit 'err' Variable


* make check results

Debian:
    ============================================================================
    Testsuite summary for GRUB 2.13
    ============================================================================
    # TOTAL: 88
    # PASS:  64
    # SKIP:  3
    # XFAIL: 0
    # FAIL:  2
    # XPASS: 0
    # ERROR: 19

Fedora:
    ============================================================================
    Testsuite summary for GRUB 2.13
    ============================================================================
    # TOTAL: 88
    # PASS:  63
    # SKIP:  3
    # XFAIL: 0
    # FAIL:  3
    # XPASS: 0
    # ERROR: 19

In general, the same results in both distros.
---
 container/Containerfile.debian | 56 +++++++++++++++++++++++++++++++++++++++++
 container/Containerfile.fedora | 57 ++++++++++++++++++++++++++++++++++++++++++
 container/README               | 22 ++++++++++++++++
 3 files changed, 135 insertions(+)
 create mode 100644 container/Containerfile.debian
 create mode 100644 container/Containerfile.fedora
 create mode 100644 container/README

diff --git a/container/Containerfile.debian b/container/Containerfile.debian
new file mode 100644
index 0000000000..8906b2921e
--- /dev/null
+++ b/container/Containerfile.debian
@@ -0,0 +1,56 @@
+FROM debian
+
+# Install required packages for configuration & compilation & check
+RUN apt update -y  && \
+    apt install -y \
+        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 \
+        tpm2-tools \
+        udftools \
+        unifont \
+        wamerican \
+        which \
+        xfonts-unifont \
+        xfsprogs \
+        xorriso \
+        zfs-fuse
+
+# clone tip of grub repository
+RUN git clone --depth 1 https://https.git.savannah.gnu.org/git/grub.git /grub
+
+WORKDIR /grub
diff --git a/container/Containerfile.fedora b/container/Containerfile.fedora
new file mode 100644
index 0000000000..e5b33bfd71
--- /dev/null
+++ b/container/Containerfile.fedora
@@ -0,0 +1,57 @@
+FROM registry.fedoraproject.org/fedora
+
+# Install required packages for configuration & compilation & check
+RUN dnf update -y && \
+    dnf install -y \
+        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 \
+        tpm2-tools \
+        udftools \
+        unifont \
+        unifont-fonts \
+        which \
+        words \
+        xfsprogs \
+        xorriso \
+        zfs-fuse
+
+# clone tip of grub repository
+RUN git clone --depth 1 https://https.git.savannah.gnu.org/git/grub.git /grub
+
+WORKDIR /grub
diff --git a/container/README b/container/README
new file mode 100644
index 0000000000..be5e988b9d
--- /dev/null
+++ b/container/README
@@ -0,0 +1,22 @@
+install `podman` on your favorite distro then build it with
+
+$ podman build -t fedora-grub -f Containerfile.fedora .
+
+or in case you prefer Debian
+
+$ podman build -t debian-grub -f Containerfile.debian .
+
+once built, you can run/launch any of the above
+
+$ 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 check
\ No newline at end of file


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

             reply	other threads:[~2025-06-21  0:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-21  0:03 Leo Sandoval via Grub-devel [this message]
2025-06-21 15:52 ` [PATCH v2] Create Containerfiles with required grub packages for development Andrew Hamilton
2025-06-24 17:04 ` Daniel Kiper
2025-06-30 19:45 ` Glenn Washburn
2025-06-30 20:15   ` Leo Sandoval via Grub-devel
2025-07-09  1:24     ` Glenn Washburn
2025-07-09 16:54       ` Leo Sandoval via Grub-devel

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=20250621000343.2843347-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).