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.



59
60
61
62
63
# File 'lib/getch.rb', line 59

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

Instance Method Details

#bootloaderObject



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

def bootloader
  @assembly.luks_keys
  @assembly.bootloader
end

#configureObject



121
122
123
124
125
126
127
128
# File 'lib/getch.rb', line 121

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

#finalizeObject



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

def finalize
  @assembly.finalize
end

#install_systemObject



100
101
102
103
104
105
# File 'lib/getch.rb', line 100

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

#prepare_diskObject



93
94
95
96
97
98
# File 'lib/getch.rb', line 93

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

#resumeObject



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

def resume
  STATES[:partition] && return

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

  puts "\nBuild " + OPTIONS[:os].capitalize + " 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
  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



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

def terraform
  @assembly.terraform
  @assembly.services
end