Sha256: 70f537cd9346a23e8939a9924d2f4a79da1c20be2b08f9b8fd9d94d66a54ad91

Contents?: true

Size: 821 Bytes

Versions: 1

Compression:

Stored size: 821 Bytes

Contents

#!/usr/bin/env ruby

require 'hackmac'
include Hackmac
include Utils

$config = Hackmac::Config.load

dev = ARGV.shift or fail "need usb device"

dev = File.basename(dev)

mountpoint     = $config.usb.mp
mountpoint_efi = '/Volumes/%s' % $config.devices.usb.name

ask("Really erase #{dev.inspect} and install #{$config.usb.os.inspect}? (y/n) ") or exit

x %{diskutil partitionDisk #{dev.inspect} GPT JHFS+ "USB" 100%}

x %{sudo "#{$config.usb.os}/Contents/Resources/createinstallmedia" --volume #{mountpoint.inspect} --nointeraction}

x %{sudo mkdir -p #{mountpoint_efi.inspect}}
x %{sudo mount -t msdos #{('/dev/' + dev + 's1').inspect} #{mountpoint_efi.inspect}}

cd mountpoint_efi do
  x %{sudo chown $USER .}
  x %{git init}
  x %{git remote add origin #{$config.efi.source.inspect}}
  x %{git pull origin master}
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hackmac-1.1.3 bin/usb