class Getch::Main

Public Class Methods

new(argv) click to toggle source
# File lib/getch.rb, line 62
def initialize(argv)
  argv[:cli]
  @class_fs = Getch::select_fs
  @log = Log.new
  Getch::States.new # Update States
end

Public Instance Methods

configure() click to toggle source
# File lib/getch.rb, line 145
def configure
  config = Getch::Config::Main.new
  config.ethernet
  config.wifi
  config.dns
  config.sysctl
  config.shell
end
format() click to toggle source
# File lib/getch.rb, line 107
def format
  return if STATES[:format]
  @class_fs::Format.new
end
install() click to toggle source
# File lib/getch.rb, line 117
def install
  if OPTIONS[:os] == 'gentoo'
    install_gentoo
  elsif OPTIONS[:os] == 'void'
    install_void
  else
    puts "Options #{OPTIONS[:os]} not supported...."
    exit 1
  end
end
install_gentoo() click to toggle source
# File lib/getch.rb, line 128
def install_gentoo
  gentoo = Getch::Gentoo::Main.new
  gentoo.stage3
  gentoo.config
  gentoo.chroot
  gentoo.kernel
  gentoo.boot
end
install_void() click to toggle source
# File lib/getch.rb, line 137
def install_void
  void = Getch::Void::Main.new
  void.root_fs
  void.config
  void.chroot
  void.boot
end
mount() click to toggle source
# File lib/getch.rb, line 112
def mount
  return if STATES[:mount]
  @class_fs::Mount.new.run
end
partition() click to toggle source
# File lib/getch.rb, line 94
def partition
  return if STATES[:partition]
  puts
  print "Partition and format disk #{OPTIONS[:disk]}, this will erase all data, continue? (y,N) "
  case gets.chomp
  when /^y|^Y/
    @log.info("Partition start")
    @class_fs::Partition.new
  else
    exit
  end
end
resume() click to toggle source
# File lib/getch.rb, line 69
def resume
  raise "No disk, use at least getch with -d DISK" if !OPTIONS[:disk]
  puts "\nBuild " + OPTIONS[:os].capitalize + " Linux with the following args:\n"
  puts
  puts "\tLang: #{OPTIONS[:language]}"
  puts "\tZoneinfo: #{OPTIONS[:zoneinfo]}"
  puts "\tKeymap: #{OPTIONS[:keymap]}"
  puts "\tDisk: #{OPTIONS[:disk]}"
  puts "\tFilesystem: #{OPTIONS[:fs]}"
  puts "\tUsername: #{OPTIONS[:username]}"
  puts "\tEncrypt: #{OPTIONS[:encrypt]}"
  puts
  puts "\tseparate-boot disk: #{OPTIONS[:boot_disk]}"
  puts "\tseparate-cache disk: #{OPTIONS[:cache_disk]}"
  puts "\tseparate-home disk: #{OPTIONS[:home_disk]}"
  puts
  print "Continue? (y,N) "
  case gets.chomp
  when /^y|^Y/
    return
  else
    exit
  end
end