configure do check_c_compiler "i686-elf-gcc" check_program "genext2fs" check_program "grub-mkstandalone" check_program "mformat", on_fail: "Install the mtools package" end build do require "tmpdir" # EFI (w/ GRUB) partition size (MiB) EFI_PART_SIZE = 8 # HOS partition size (MiB) HOS_PART_SIZE = 4 class Image < Builder def run(options) unless @cache.up_to_date?(@target, nil, @sources, @env) print_run_message("Generating disk image #{@target}", nil) Dir.mktmpdir do |tmpdir| # Build a standalone GRUB. File.open("#{tmpdir}/grub.cfg", "wb") do |fh| fh.write(<