Class: Getch::Main

Inherits:
Object
  • Object
show all
Defined in:
lib/getch.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Main

Returns a new instance of Main.



62
63
64
65
66
# File 'lib/getch.rb', line 62

def initialize(argv)
  argv[:cli]
  @log = Log.new
  @assembly = Assembly.new
end

Instance Method Details

#bootloaderObject



117
118
119
120
# File 'lib/getch.rb', line 117

def bootloader
  @assembly.luks_keys
  @assembly.bootloader
end

#configureObject



126
127
128
129
130
131
132
133
# File 'lib/getch.rb', line 126

def configure
  config = Getch::Config::Main.new
  config.ethernet
  config.wifi
  config.dns
  config.sysctl
  config.shell
end

#finalizeObject



122
123
124
# File 'lib/getch.rb', line 122

def finalize
  @assembly.finalize
end

#install_systemObject



105
106
107
108
109
110
# File 'lib/getch.rb', line 105

def install_system
  @assembly.tarball
  @assembly.pre_config
  @assembly.update
  @assembly.post_config
end

#prepare_diskObject



98
99
100
101
102
103
# File 'lib/getch.rb', line 98

def prepare_disk
  @assembly.clean
  @assembly.partition
  @assembly.format
  @assembly.mount
end

#resumeObject



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/getch.rb', line 68

def resume
  STATES[:partition] && return

  @log.fatal 'No disk, use at least getch with -d DISK' unless OPTIONS[:disk]
  os_cap = OPTIONS[:os].capitalize

  puts "\nBuild #{os_cap} Linux with the following args:\n"
  puts
  puts "\tLang: #{OPTIONS[:language]}"
  puts "\tTimezone: #{OPTIONS[:timezone]}"
  puts "\tKeymap: #{OPTIONS[:keymap]}"
  puts "\tDisk: #{OPTIONS[:disk]}"
  puts "\tFilesystem: #{OPTIONS[:fs]}"
  puts "\tUsername: #{OPTIONS[:username]}"
  puts "\tEncrypt: #{OPTIONS[:encrypt]}"
  puts "\tMusl: #{OPTIONS[:musl]}"
  puts "\tBinary mode: #{OPTIONS[:binary]}"
  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/
  else
    exit
  end
end

#terraformObject



112
113
114
115
# File 'lib/getch.rb', line 112

def terraform
  @assembly.terraform
  @assembly.services
end