Create image file with Ruby instead of dd

This commit is contained in:
Josh Holtrop 2022-03-11 16:43:02 -05:00
parent 1c8ef32b00
commit ccaa5db1f5

View File

@ -8,7 +8,7 @@ class Image < Builder
def run(options) def run(options)
unless @cache.up_to_date?(@target, nil, @sources, @env) unless @cache.up_to_date?(@target, nil, @sources, @env)
print_run_message("Image <target>#{@target}<reset>", nil) print_run_message("Image <target>#{@target}<reset>", nil)
system(*%W[dd if=/dev/zero of=#{@target} bs=1k count=1440]) File.binwrite(@target, "\0" * (1440 * 1024))
system(*%W[mformat -i #{@target} -f 1440 ::]) system(*%W[mformat -i #{@target} -f 1440 ::])
system(*%W[mmd -i #{@target} ::/EFI]) system(*%W[mmd -i #{@target} ::/EFI])
system(*%W[mmd -i #{@target} ::/EFI/BOOT]) system(*%W[mmd -i #{@target} ::/EFI/BOOT])