class IESD::DMG::BaseSystem

BaseSystem.dmg

The installer DMG before OS X Lion.

Constants

PACKAGES

The relative path to the Packages.

Public Instance Methods

export(options) { |volume_root| ... } click to toggle source

Export to a new DMG.

options - The Dictionary of the export options

# File lib/iesd/InstallESD/BaseSystem.dmg.rb, line 15
def export options
  case options[:type]
  when :BaseSystem, nil
    Dir.mktmpdir { |tmp|
      HDIUtil.write(@url, (tmpfile = File.join(tmp, File.basename(@url))), options[:hdiutil]) { |volume_root|
        options[:extensions][:up_to_date] = (options[:extensions][:uninstall].empty? and options[:extensions][:install].empty?)
        options[:mach_kernel] = File.exist? File.join(volume_root, "mach_kernel") if options[:mach_kernel].nil?

        yield volume_root if block_given?

        pre_update_extension volume_root, options

        IESD::DMG::BaseSystem::Extensions.new(volume_root).update options[:extensions]

        post_update_extension volume_root, options

        if options[:interactive]
          oh1 "Starting Interactive Shell"
          puts "Environment: BaseSystem"
          HDIUtil.shell volume_root
        end
      }
      system("/usr/bin/env", "mv", tmpfile, options[:output])
    }
  else
    raise "invalid output type"
  end
end

Private Instance Methods

post_update_extension(volume_root, options) click to toggle source

Perform certain tasks after updating extensions.

volume_root - The String path to the volume root options - The Dictionary of the export options

# File lib/iesd/InstallESD/BaseSystem.dmg.rb, line 61
def post_update_extension volume_root, options
  if !options[:extensions][:up_to_date] and options[:extensions][:postinstall]
    IESD::Packages::OSInstall.new(File.join(volume_root, PACKAGES, "OSInstall.pkg")).postinstall_extensions options[:extensions]
  end
  if !options[:mach_kernel] and File.exist? (mach_kernel = File.join(volume_root, "mach_kernel"))
    system("/usr/bin/env", "rm", mach_kernel)
  end
end
pre_update_extension(volume_root, options) click to toggle source

Perform certain tasks before updating extensions.

volume_root - The String path to the volume root options - The Dictionary of the export options

# File lib/iesd/InstallESD/BaseSystem.dmg.rb, line 50
def pre_update_extension volume_root, options
  if !File.exist? (mach_kernel = File.join(volume_root, "mach_kernel")) and (options[:mach_kernel] or !options[:extensions][:up_to_date])
    IESD::Packages::BaseSystemBinaries.new(File.join(volume_root, PACKAGES, "BaseSystemBinaries.pkg")).extract_mach_kernel mach_kernel
    system("/usr/bin/env", "chflags", "hidden", mach_kernel)
  end
end