Skip to content

Commit

Permalink
x86_64-elf-grub 2.06 (new formula)
Browse files Browse the repository at this point in the history
Add GNU GRUB bootloader cross-compiler for x86_64-elf target. This formula
builds GRUB bootloader components specifically for x86_64 architecture,
which is essential for OS development and bootloader customization.

Signed-off-by: Polina Simonenko <[email protected]>
  • Loading branch information
rabarbra committed Feb 27, 2025
1 parent fba41d7 commit f153b03
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 1 deletion.
76 changes: 76 additions & 0 deletions Formula/x/x86_64-elf-grub.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
class X8664ElfGrub < Formula
desc "GNU GRUB bootloader for x86_64-elf"
homepage "https://savannah.gnu.org/projects/grub"
url "https://ftp.gnu.org/gnu/grub/grub-2.06.tar.xz"
mirror "https://mirrors.ocf.berkeley.edu/gnu/grub/grub-2.06.tar.xz"
sha256 "b79ea44af91b93d17cd3fe80bdae6ed43770678a9a5ae192ccea803ebb657ee1"
license "GPL-3.0-or-later"

depends_on "help2man" => :build
depends_on "objconv" => :build
depends_on "texinfo" => :build
depends_on "x86_64-elf-binutils" => :build
depends_on "x86_64-elf-gcc" => [:build, :test]
depends_on "freetype"
depends_on "gettext"
depends_on "mtools"
depends_on "xorriso"
depends_on "xz"
uses_from_macos "bison" => :build
uses_from_macos "flex" => :build
uses_from_macos "python" => :build

resource "unifont" do
url "https://ftp.gnu.org/gnu/unifont/unifont-16.0.02/unifont-16.0.02.pcf.gz", using: :nounzip
mirror "https://mirrors.ocf.berkeley.edu/gnu/unifont/unifont-16.0.02/unifont-16.0.02.pcf.gz"
sha256 "02a3fe11994d3cdaf1d4bd5d2b6b609735e6823e01764ae83b704e02ec2f640d"
end

def install

Check failure on line 29 in Formula/x/x86_64-elf-grub.rb

View workflow job for this annotation

GitHub Actions / Linux

`brew install --verbose --formula --build-bottle x86_64-elf-grub` failed on Linux!

checking whether nm accepts -P... yes checking whether nm accepts --defined-only... yes checking whether -nostdinc -isystem works... yes checking whether -Wtrampolines work... yes checking for FREETYPE... no configure: error: grub-mkfont was explicitly requested but can't be compiled (need freetype2 library) ==> Formula Path: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/x/x86_64-elf-grub.rb ==> Configuration HOMEBREW_VERSION: 4.4.22-74-gc21021c ORIGIN: https://github.com/Homebrew/brew HEAD: c21021c49b60b56199071e048d449d855b71065a Last commit: 68 minutes ago Branch: master Core tap HEAD: 9452064f74506b1c8bfe9182ce58bb4cac7564f0 Core tap last commit: 12 minutes ago Core tap JSON: 27 Feb 17:51 UTC HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew HOMEBREW_BOOTSNAP: set HOMEBREW_CASK_OPTS: [] HOMEBREW_COLOR: set HOMEBREW_CURL_PATH: /usr/bin/curl HOMEBREW_FAIL_LOG_LINES: 150 HOMEBREW_GITHUB_API_TOKEN: set HOMEBREW_GIT_EMAIL: [email protected] HOMEBREW_GIT_NAME: BrewTestBot HOMEBREW_GIT_PATH: /usr/bin/git HOMEBREW_LOGS: /github/home/bottles/logs HOMEBREW_MAKE_JOBS: 4 HOMEBREW_NO_AUTO_UPDATE: set HOMEBREW_NO_EMOJI: set HOMEBREW_NO_ENV_HINTS: set HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set HOMEBREW_NO_INSTALL_FROM_API: set HOMEBREW_SORBET_RUNTIME: set HOMEBREW_VERIFY_ATTESTATIONS: set Homebrew Ruby: 3.3.7 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby CPU: quad-core 64-bit zen3 Clang: N/A Git: 2.48.1 => /usr/bin/git Curl: 7.81.0 => /usr/bin/curl Kernel: Linux 6.8.0-1021-azure x86_64 GNU/Linux OS: Ubuntu 22.04.5 LTS Host glibc: 2.35 /usr/bin/gcc: 11.4.0 /usr/bin/ruby: N/A glibc: N/A gcc@11: N/A gcc: N/A xorg: N/A ==> ENV HOMEBREW_CC: gcc-11 HOMEBREW_CXX: g++-11 CFLAGS: -Os -Wno-error=incompatible-pointer-types MAKEFLAGS: -j4 CMAKE_PREFIX_PATH: /home/linuxbrew/.linuxbrew PKG_CONFIG_PATH: /home/linuxbrew/.linuxbrew/opt/zlib/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/libpng/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/bzip2/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/freetype/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/icu4c@76/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/ncurses/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/readline/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/libxml2/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/acl/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/xz/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/pkgconfig PKG_CONFIG_LIBDIR: HOMEBREW_MAKE_JOBS: 4 HOMEBREW_GIT: /usr/bin/git ACLOCAL_PATH: /home/linuxbrew/.linuxbrew/share/aclocal PATH: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/linux/super:/home/linuxbrew/.linuxbrew/opt/help2man/bin:/home/linuxbrew/.linuxbrew/opt/objconv/bin:/home/linuxbrew/.linuxbrew/opt/texinfo/bin:/home/linuxbrew/.linuxbrew/opt/x86_64-elf-binutils/bin:/home/linuxbrew/.linuxbrew/opt/x86_64-elf-gcc/bin:/home/linuxbrew/.linuxbrew/opt/libpng/bin:/home/linuxbrew/.linuxbrew/opt/bzip2/bin:/home/linuxbrew/.linuxbrew/opt/freetype/bin:/home/linuxbrew/.linuxbrew/opt/icu4c@76/bin:/home/linuxbrew/.linuxbrew/opt/ncurses/bin:/home/linuxbrew/.linuxbrew/opt/libxml2/bin:/home/linuxbrew/.linuxbrew/opt/acl/bin:/home/linuxbrew/.linuxbrew/opt/gettext/bin:/home/linuxbrew/.linuxbrew/opt/mtools/bin:/home/linuxbrew/.linuxbrew/opt/xorriso/bin:/home/linuxbrew/.linuxbrew/opt/xz/bin:/home/linuxbrew/.linuxbrew/opt/bison/bin:/home/linuxbrew/.linuxbrew/opt/flex/bin:/home/linuxbrew/.linuxbrew/opt/[email protected]/bin:/home/linuxbrew/.linuxbrew/opt/[email protected]/libexec/bin:/usr/bin:/bin:/usr/sbin:/sbin Logs: /github/home/bottles/logs/x86_64-elf-grub/00.options.out /github/home/bottles/logs/x86_64-elf-grub/01.configure /github/home/bottles/logs/x86_64-elf-grub/01.configure.cc /github/home/bottles/logs/x86_64-elf-grub/build READ THIS: https://docs.brew.sh/Troubleshooting ::error::x86_64-elf-grub 2.06 did not build

Check failure on line 29 in Formula/x/x86_64-elf-grub.rb

View workflow job for this annotation

GitHub Actions / macOS 15-arm64

`brew install --verbose --formula --build-bottle x86_64-elf-grub` failed on macOS Sequoia (15) on Apple Silicon!

checking whether nm accepts -P... yes checking whether nm accepts --defined-only... yes checking whether -nostdinc -isystem works... yes checking whether -Wtrampolines work... yes checking for FREETYPE... no configure: error: grub-mkfont was explicitly requested but can't be compiled (need freetype2 library) ==> Formula Path: /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/x/x86_64-elf-grub.rb ==> Configuration HOMEBREW_VERSION: 4.4.22-74-gc21021c ORIGIN: https://github.com/Homebrew/brew HEAD: c21021c49b60b56199071e048d449d855b71065a Last commit: 68 minutes ago Branch: master Core tap HEAD: 9452064f74506b1c8bfe9182ce58bb4cac7564f0 Core tap last commit: 12 minutes ago Core tap JSON: 27 Feb 17:51 UTC Core cask tap JSON: 27 Feb 17:51 UTC HOMEBREW_PREFIX: /opt/homebrew HOMEBREW_CACHE: /Users/brew/Library/Caches/Homebrew HOMEBREW_CASK_OPTS: [] HOMEBREW_COLOR: set HOMEBREW_CURL_PATH: /usr/bin/curl HOMEBREW_FAIL_LOG_LINES: 150 HOMEBREW_GITHUB_API_TOKEN: set HOMEBREW_GIT_EMAIL: [email protected] HOMEBREW_GIT_NAME: BrewTestBot HOMEBREW_GIT_PATH: /usr/bin/git HOMEBREW_LOGS: /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs HOMEBREW_MAKE_JOBS: 4 HOMEBREW_NO_AUTO_UPDATE: set HOMEBREW_NO_EMOJI: set HOMEBREW_NO_ENV_HINTS: set HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set HOMEBREW_NO_INSTALL_FROM_API: set HOMEBREW_SORBET_RUNTIME: set HOMEBREW_VERIFY_ATTESTATIONS: set Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby CPU: quad-core 64-bit dunno Clang: 16.0.0 build 1600 Git: 2.39.5 => /usr/bin/git Curl: 8.7.1 => /usr/bin/curl macOS: 15.2-arm64 CLT: 16.2.0.0.1.1733547573 Xcode: 16.2 Rosetta 2: false ==> ENV HOMEBREW_CC: clang HOMEBREW_CXX: clang++ CFLAGS: -Os -Wno-error=incompatible-pointer-types MAKEFLAGS: -j4 CMAKE_PREFIX_PATH: /opt/homebrew CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries PKG_CONFIG_PATH: /opt/homebrew/opt/libpng/lib/pkgconfig:/opt/homebrew/opt/freetype/lib/pkgconfig:/opt/homebrew/opt/xz/lib/pkgconfig PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/15 HOMEBREW_MAKE_JOBS: 4 HOMEBREW_GIT: /usr/bin/git HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk ACLOCAL_PATH: /opt/homebrew/share/aclocal PATH: /opt/homebrew/Library/Homebrew/shims/mac/super:/opt/homebrew/opt/help2man/bin:/opt/homebrew/opt/objconv/bin:/opt/homebrew/opt/texinfo/bin:/opt/homebrew/opt/x86_64-elf-binutils/bin:/opt/homebrew/opt/x86_64-elf-gcc/bin:/opt/homebrew/opt/libpng/bin:/opt/homebrew/opt/freetype/bin:/opt/homebrew/opt/gettext/bin:/opt/homebrew/opt/mtools/bin:/opt/homebrew/opt/xorriso/bin:/opt/homebrew/opt/xz/bin:/usr/bin:/bin:/usr/sbin:/sbin Logs: /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/x86_64-elf-grub/00.options.out /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/x86_64-elf-grub/01.configure /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/x86_64-elf-grub/01.configure.cc /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/x86_64-elf-grub/build READ THIS: https://docs.brew.sh/Troubleshooting ::error::x86_64-elf-grub 2.06 did not build

Check failure on line 29 in Formula/x/x86_64-elf-grub.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

`brew install --verbose --formula --build-bottle x86_64-elf-grub` failed on macOS Sonoma (14) on Apple Silicon!

checking whether nm accepts -P... yes checking whether nm accepts --defined-only... yes checking whether -nostdinc -isystem works... yes checking whether -Wtrampolines work... yes checking for FREETYPE... no configure: error: grub-mkfont was explicitly requested but can't be compiled (need freetype2 library) ==> Formula Path: /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/x/x86_64-elf-grub.rb ==> Configuration HOMEBREW_VERSION: 4.4.22-74-gc21021c ORIGIN: https://github.com/Homebrew/brew HEAD: c21021c49b60b56199071e048d449d855b71065a Last commit: 68 minutes ago Branch: master Core tap HEAD: 9452064f74506b1c8bfe9182ce58bb4cac7564f0 Core tap last commit: 12 minutes ago Core tap JSON: 27 Feb 17:51 UTC Core cask tap JSON: 27 Feb 17:51 UTC HOMEBREW_PREFIX: /opt/homebrew HOMEBREW_BOOTSNAP: set HOMEBREW_CACHE: /Users/brew/Library/Caches/Homebrew HOMEBREW_CASK_OPTS: [] HOMEBREW_COLOR: set HOMEBREW_CURL_PATH: /usr/bin/curl HOMEBREW_FAIL_LOG_LINES: 150 HOMEBREW_GITHUB_API_TOKEN: set HOMEBREW_GIT_EMAIL: [email protected] HOMEBREW_GIT_NAME: BrewTestBot HOMEBREW_GIT_PATH: /usr/bin/git HOMEBREW_LOGS: /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs HOMEBREW_MAKE_JOBS: 4 HOMEBREW_NO_AUTO_UPDATE: set HOMEBREW_NO_EMOJI: set HOMEBREW_NO_ENV_HINTS: set HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set HOMEBREW_NO_INSTALL_FROM_API: set HOMEBREW_SORBET_RUNTIME: set HOMEBREW_VERIFY_ATTESTATIONS: set Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby CPU: quad-core 64-bit dunno Clang: 16.0.0 build 1600 Git: 2.39.5 => /usr/bin/git Curl: 8.7.1 => /usr/bin/curl macOS: 14.7.2-arm64 CLT: 16.2.0.0.1.1733547573 Xcode: 16.2 Rosetta 2: false ==> ENV HOMEBREW_CC: clang HOMEBREW_CXX: clang++ CFLAGS: -Os -Wno-error=incompatible-pointer-types MAKEFLAGS: -j4 CMAKE_PREFIX_PATH: /opt/homebrew CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries PKG_CONFIG_PATH: /opt/homebrew/opt/libpng/lib/pkgconfig:/opt/homebrew/opt/freetype/lib/pkgconfig:/opt/homebrew/opt/xz/lib/pkgconfig PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/14 HOMEBREW_MAKE_JOBS: 4 HOMEBREW_GIT: /usr/bin/git HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk ACLOCAL_PATH: /opt/homebrew/share/aclocal PATH: /opt/homebrew/Library/Homebrew/shims/mac/super:/opt/homebrew/opt/help2man/bin:/opt/homebrew/opt/objconv/bin:/opt/homebrew/opt/texinfo/bin:/opt/homebrew/opt/x86_64-elf-binutils/bin:/opt/homebrew/opt/x86_64-elf-gcc/bin:/opt/homebrew/opt/libpng/bin:/opt/homebrew/opt/freetype/bin:/opt/homebrew/opt/gettext/bin:/opt/homebrew/opt/mtools/bin:/opt/homebrew/opt/xorriso/bin:/opt/homebrew/opt/xz/bin:/usr/bin:/bin:/usr/sbin:/sbin Logs: /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/x86_64-elf-grub/00.options.out /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/x86_64-elf-grub/01.configure /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/x86_64-elf-grub/01.configure.cc /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/x86_64-elf-grub/build READ THIS: https://docs.brew.sh/Troubleshooting ::error::x86_64-elf-grub 2.06 did not build

Check failure on line 29 in Formula/x/x86_64-elf-grub.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

`brew install --verbose --formula --build-bottle x86_64-elf-grub` failed on macOS Ventura (13) on Apple Silicon!

checking whether nm accepts -P... yes checking whether nm accepts --defined-only... yes checking whether -nostdinc -isystem works... yes checking whether -Wtrampolines work... yes checking for FREETYPE... no configure: error: grub-mkfont was explicitly requested but can't be compiled (need freetype2 library) ==> Formula Path: /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/x/x86_64-elf-grub.rb ==> Configuration HOMEBREW_VERSION: 4.4.22-74-gc21021c ORIGIN: https://github.com/Homebrew/brew HEAD: c21021c49b60b56199071e048d449d855b71065a Last commit: 67 minutes ago Branch: master Core tap HEAD: 9452064f74506b1c8bfe9182ce58bb4cac7564f0 Core tap last commit: 12 minutes ago Core tap JSON: 27 Feb 17:51 UTC Core cask tap JSON: 27 Feb 17:51 UTC HOMEBREW_PREFIX: /opt/homebrew HOMEBREW_BOOTSNAP: set HOMEBREW_CACHE: /Users/brew/Library/Caches/Homebrew HOMEBREW_CASK_OPTS: [] HOMEBREW_COLOR: set HOMEBREW_CURL_PATH: /usr/bin/curl HOMEBREW_FAIL_LOG_LINES: 150 HOMEBREW_GITHUB_API_TOKEN: set HOMEBREW_GIT_EMAIL: [email protected] HOMEBREW_GIT_NAME: BrewTestBot HOMEBREW_GIT_PATH: /usr/bin/git HOMEBREW_LOGS: /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs HOMEBREW_MAKE_JOBS: 4 HOMEBREW_NO_AUTO_UPDATE: set HOMEBREW_NO_EMOJI: set HOMEBREW_NO_ENV_HINTS: set HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set HOMEBREW_NO_INSTALL_FROM_API: set HOMEBREW_SORBET_RUNTIME: set HOMEBREW_VERIFY_ATTESTATIONS: set Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby CPU: quad-core 64-bit dunno Clang: 15.0.0 build 1500 Git: 2.39.3 => /usr/bin/git Curl: 8.7.1 => /usr/bin/curl macOS: 13.7.2-arm64 CLT: 15.1.0.0.1.1700200546 Xcode: 15.2 Rosetta 2: false ==> ENV HOMEBREW_CC: clang HOMEBREW_CXX: clang++ CFLAGS: -Os -Wno-error=incompatible-pointer-types MAKEFLAGS: -j4 CMAKE_PREFIX_PATH: /opt/homebrew CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries PKG_CONFIG_PATH: /opt/homebrew/opt/libpng/lib/pkgconfig:/opt/homebrew/opt/freetype/lib/pkgconfig:/opt/homebrew/opt/xz/lib/pkgconfig PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/13 HOMEBREW_MAKE_JOBS: 4 HOMEBREW_GIT: /usr/bin/git HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk ACLOCAL_PATH: /opt/homebrew/share/aclocal PATH: /opt/homebrew/Library/Homebrew/shims/mac/super:/opt/homebrew/opt/help2man/bin:/opt/homebrew/opt/objconv/bin:/opt/homebrew/opt/texinfo/bin:/opt/homebrew/opt/x86_64-elf-binutils/bin:/opt/homebrew/opt/x86_64-elf-gcc/bin:/opt/homebrew/opt/libpng/bin:/opt/homebrew/opt/freetype/bin:/opt/homebrew/opt/gettext/bin:/opt/homebrew/opt/mtools/bin:/opt/homebrew/opt/xorriso/bin:/opt/homebrew/opt/xz/bin:/usr/bin:/bin:/usr/sbin:/sbin Logs: /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/x86_64-elf-grub/00.options.out /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/x86_64-elf-grub/01.configure /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/x86_64-elf-grub/01.configure.cc /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/x86_64-elf-grub/build READ THIS: https://docs.brew.sh/Troubleshooting ::error::x86_64-elf-grub 2.06 did not build
target = "x86_64-elf"
ENV["CFLAGS"] = "-Os -Wno-error=incompatible-pointer-types"

resource("unifont").stage do
cp "unifont-16.0.02.pcf.gz", buildpath/"unifont.pcf.gz"
end
ENV["UNIFONT"] = buildpath/"unifont.pcf.gz"

mkdir "build" do
args = %W[
--disable-werror
--enable-grub-mkfont
--target=#{target}
--prefix=#{prefix}/#{target}
--bindir=#{bin}
--libdir=#{lib}/#{target}
--with-platform=efi
--program-prefix=#{target}-
]

system "../configure", *args
system "make"
system "make", "install"

mkdir_p "#{prefix}/#{target}/share/grub"

system "./grub-mkfont",
"--output=#{prefix}/#{target}/share/grub/unicode.pf2",
ENV["UNIFONT"].to_s
end
end

test do
target = "x86_64-elf"
(testpath/"boot.c").write <<~C
__asm__(
".align 4\\n"
".long 0x1BADB002\\n"
".long 0x0\\n"
".long -(0x1BADB002 + 0x0)\\n"
);
C
system Formula["#{target}-gcc"].bin/"#{target}-gcc", "-c", "-o", "boot", "boot.c"
assert_match "0",
shell_output("#{bin}/#{target}-grub-file --is-x86-multiboot boot; echo -n $?")
end
end
3 changes: 2 additions & 1 deletion audit_exceptions/mismatched_binary_allowlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"i686-elf-grub": "lib/i686-elf/grub/i386-pc/*",
"lima": "share/lima/lima-guestagent.Linux-*",
"picotool": "share/picotool/xip_ram_perms.elf",
"qemu": "share/qemu/*"
"qemu": "share/qemu/*",
"x86_64-elf-grub": "lib/x86_64-elf/grub/i386-pc/*"
}

0 comments on commit f153b03

Please sign in to comment.