class Getch::FileSystem::Lvm::Encrypt::Format

Public Class Methods

new() click to toggle source
# File lib/getch/filesystem/lvm/encrypt/format.rb, line 6
def initialize
  super
  @fs = 'ext4'
  @state = Getch::States.new()
  format
end

Public Instance Methods

format() click to toggle source
# File lib/getch/filesystem/lvm/encrypt/format.rb, line 13
def format
  return if STATES[:format]
  puts "Format #{@disk}"
  exec("mkfs.fat -F32 #{@dev_esp}") if @dev_esp
  exec("mkfs.#{@fs} -F #{@dev_boot}") if @dev_boot
  exec("mkfs.#{@fs} -F #{@lv_root}")
  exec("mkfs.#{@fs} -F #{@lv_home}") if @lv_home
  @state.format
end

Private Instance Methods

exec(cmd) click to toggle source
# File lib/getch/filesystem/lvm/encrypt/format.rb, line 24
def exec(cmd)
  Getch::Command.new(cmd).run!
end