Class: CryptSetup

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

Overview

Used to interact with dmcrypt

Instance Method Summary collapse

Constructor Details

#initialize(devs, options) ⇒ CryptSetup

Returns a new instance of CryptSetup.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/cryptsetup.rb', line 7

def initialize(devs, options)
  @boot = devs[:boot]
  @root = devs[:root]
  @home = devs[:home]
  @swap = devs[:swap] ||= nil
  @options = options
  @luks = options[:luks_name]
  @vg = options[:vg_name]
  @fs = options[:fs] ||= 'ext4'
  @mountpoint = options[:mountpoint] ||= '/mnt/getch'
end

Instance Method Details

#configsObject



31
32
33
34
35
36
# File 'lib/cryptsetup.rb', line 31

def configs
  config_boot
  config_root
  config_home
  config_swap
end

#formatObject



19
20
21
22
23
# File 'lib/cryptsetup.rb', line 19

def format
  format_boot
  format_root
  format_home
end

#keysObject



25
26
27
28
29
# File 'lib/cryptsetup.rb', line 25

def keys
  add_boot_key
  add_root_key
  add_home_key
end

#swap_confObject



38
39
40
# File 'lib/cryptsetup.rb', line 38

def swap_conf
  config_swap
end